Use a decompiler like JD and send the .class or the .jar file you want/need to decompile. But note that you probably won't get the real exact code that generated those files, only a very similar representation of them.
How to figure out what a .class file does?
-
09-07-2023 - |
質問
I would like to figure out how to reset the age of a battery on a piece of hardware. In the TomCat files I found the function that extracts the age and renders the html:
#macro (renderBatteries $batteryList)
#set ($smartBatteryData = $rack.getSmartBatteryData())
#foreach ($battery in $batteryList)
...
<td class="formlabel">Age:</td>
<td width="50%" class="formvalue">$!battery.getBatteryAge() Day(s)
So I suppose the interesting function to figure out where it gets information from is rack.getSmartBatteryData()
?
If I grep for that I see
~# grep -R 'getSmartBatteryData' /opt/*
/opt/smu/tomcat/webapps/mgr/templates/app/screens/storage/racks/RackMacros.vm:#set ($smartBatteryData = $rack.getSmartBatteryData())
Binary file /opt/smu/tomcat/webapps/mgr/WEB-INF/lib/SYMsdk.jar matches
Binary file /opt/smu/tomcat/webapps/mgr/WEB-INF/classes/com/bluearc/mgr/data/storageManagement/Rack.class matches
Binary file /opt/smu/tomcat/webapps/mgr/WEB-INF/classes/com/bluearc/mgr/services/storageManagement/LSI/LsiRackViewService.class matches
/opt/smu/apache-tomcat-6.0.29/webapps/mgr/templates/app/screens/storage/racks/RackMacros.vm:#set ($smartBatteryData = $rack.getSmartBatteryData())
Binary file /opt/smu/apache-tomcat-6.0.29/webapps/mgr/WEB-INF/lib/SYMsdk.jar matches
Binary file /opt/smu/apache-tomcat-6.0.29/webapps/mgr/WEB-INF/classes/com/bluearc/mgr/data/storageManagement/Rack.class matches
Binary file /opt/smu/apache-tomcat-6.0.29/webapps/mgr/WEB-INF/classes/com/bluearc/mgr/services/storageManagement/LSI/LsiRackViewService.class matches
There is a postgres database that I have full access to, and I suppose the battery age is stored somewhere in there.
Question
Is is possible to reverse engineer the classes I have found to figure out what rack.getSmartBatteryData()
does?
解決
所属していません StackOverflow