通过混淆库上的PrivateObject访问私有变量 [英] Accessing private variable through PrivateObject on Obfuscated library
本文介绍了通过混淆库上的PrivateObject访问私有变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我的库被混淆,则无法使用PrivateObject
访问私有变量值.我知道在进行混淆时会更改变量名称和其他信息,但是对此有任何解决方法吗?
如果我正在访问 serialized 类的私有变量,则它工作正常,但不能使用PrivateObject
访问非序列化类的私有变量.
有人可以建议其他解决方案来获取私有变量值吗?
谢谢
-Amit.
Hi,
I am not able to access private variable value using PrivateObject
if my library is obfuscated. i know the variable name and other information are changed when we do obfuscation but is there any workaround for that ?
if i am accessing private variable of the serialized class then it is working fine but non-serialized class''s private variables are not accessible using PrivateObject
.
can anyone suggest any other solution to get private variable value ?
Thanks
-Amit.
推荐答案
混淆器是否生成一个日志文件,该文件告诉您每个方法/字段被转换为什么?如果是这样,您也许可以使用它来反转测试工具中的映射并查找混淆后的值.
请注意,如果使用反射在实际代码中查找已知的类/方法/属性名称(与测试相对),则需要从混淆中排除该反射的目标.
Does your obfuscator generate a log file which tells you what each method/field was translated to? If so, you might be able to use that to reverse the mappings in your test harness and look up the post-obfuscation value.
Note that if you''re using reflection looking for known class/method/property names in your actual code (as opposed to the tests), you will need to exclude the targets of that reflection from obfuscation.
这篇关于通过混淆库上的PrivateObject访问私有变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文