混淆代码包含相同的成员变量名称 [英] Obfuscated code contains same member variable names

查看:93
本文介绍了混淆代码包含相同的成员变量名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个经过混淆处理的 jar,它是我机器上 Tomcat 中部署的应用程序的一部分.jar 由一些具有相同变量名称的奇怪代码组成.我使用 jshrink 来反编译代码.

I have an obfuscated jar which is part of a deployed application in Tomcat on my machine. The jar consists of some weird code with same variable names. I used jshrink in order to decompile the code.

  static private org.apache.commons.logging.Log a;
  private org.springframework.context.MessageSource a;
  private org.springframework.context.support.MessageSourceAccessor a;
  static private LicenseBean a;
  static private ThreadLocal a;
  private javax.servlet.ServletContext a;
  private String a;

  public LicenseBean() {
    a = null;
    a = null;
    a = this;
  }

这是反编译过程的问题吗?我的问题是,如果反编译过程正确,JVM 是如何处理的?

Is it an issue with decompilation process? My question is how does JVM handle this if the decompilation process is correct?

推荐答案

一些混淆器使用控制符号使标识符更难阅读.这尤其涉及将代码打印到解释这些符号而不是打印其转义图标的控制台的情况.因此,这些名称实际上可能被混淆了,例如:

Some obfuscators use control symbols for making identifiers harder to read. This concerns especially situations where code is printed to a console which interprets these symbols instead of printing their escaped icon. It could therefore be that these names are actually obfuscated as for example:

U+0061 U+200B * n

其中 U+0061 代表 aU+200B 是零长度宽度符号每个 n 标识符.在普通编辑器中,所有标识符都将显示为 a.

where U+0061 represents a and U+200B is the zero-length width symbol which is entailed an incremented amount of times for each of the n identifiers. In a normal editor, all identifiers would then displayed as a.

一般来说,Java 字节码不允许类的字段有重复的标识符,但它允许在 Java 源代码中使用不正常的标识符.如果您的代码运行,Unicode 理论是最可能的解释.也许您的反编译器也错过了这些字符,或者它们甚至没有放入源代码中.尝试使用显示不可见 Unicode 的编辑器读取上述类文件的字节码(javap 输出)以验证该理论.

In general, Java byte code does not allow duplicate identifiers for fields of a class but it allows identifiers which are not normal legal in Java source code. If your code runs, the Unicode theory is the most likely explanation. Maybe your decompiler also misses these characters or and they are not even put into the source code. Try to read the byte code (javap output) of the above class file with an editor which displays invisible Unicode to verify this theory.

这篇关于混淆代码包含相同的成员变量名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆