如何计算.class文件的作用?

时间:2021-03-08 21:10:54

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:

我想知道如何在一个硬件上重置电池的年龄。在TomCat文件中,我找到了提取年龄和呈现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()?

因此,我想找出它从哪里获取信息的有趣函数是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.

我有一个postgres数据库,我可以完全访问它,我想电池的年龄就存储在那里。

Question

问题

Is is possible to reverse engineer the classes I have found to figure out what rack.getSmartBatteryData() does?

是否有可能对我发现的类进行反向工程,以找出rack.getSmartBatteryData()的功能?

1 个解决方案

#1


3  

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.

使用像JD这样的反编译器,并发送您想要/需要的.class或.jar文件。但是请注意,您可能不会得到生成这些文件的真正的确切代码,只有非常类似的表示。

#1


3  

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.

使用像JD这样的反编译器,并发送您想要/需要的.class或.jar文件。但是请注意,您可能不会得到生成这些文件的真正的确切代码,只有非常类似的表示。