Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

指令顺序重排项目进展 #198

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 2 comments
Open

指令顺序重排项目进展 #198

GoogleCodeExporter opened this issue Mar 15, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

基本思路,通过改造d2j-jarjasmin,按新的顺序生成.j文件,然后�
��d2j-jasmin2jar编译,新生成的.jar文件能让jd-gui正确反编译。
把代码划分为顺序代码C,判断代码P,分支代码S,goto代码G,标�
��代码L等,然后组装到有向图中,然后通过找环,识别各类��
�环,判断,形成新的代码执行顺序,生成.j文件。
目前进展,复合的循环基本解决,但try比较难。
如代码修改前反编译为
  public static void checkPath(String paramString1, String paramString2, String paramString3)
  {
    if (paramString2 == null);
    String[] arrayOfString;
    do
    {
      return;
      arrayOfString = paramString2.split(paramString3);
    }
    while (arrayOfString == null);
    Object localObject = null;
    for (int i = 0; ; ++i)
    {
      if (i < arrayOfString.length);
      label40: if (!arrayOfString[i].equals(""))
        break;
    }
    if (localObject != null);
    for (localObject = localObject + FILE + arrayOfString[i]; ; localObject = FILE + arrayOfString[i])
    {
      File localFile = new File(paramString1 + (String)localObject);
      if (!localFile.exists());
      localFile.mkdir();
      break label40:
    }
  }
修改后可以为:
  public static void checkPath(String paramString1, String paramString2, String paramString3)
  {
    if (paramString2 == null)
      return;
    String[] arrayOfString = paramString2.split(paramString3);
    if (arrayOfString == null)
      return;
    Object localObject = null;
    for (int i = 0; i < arrayOfString.length; ++i)
    {
      if ((!arrayOfString[i].equals("")) || (localObject != null))
        localObject = localObject + FILE + arrayOfString[i];
      else
        localObject = FILE + arrayOfString[i];
      File localFile = new File(paramString1 + (String)localObject);
      if (localFile.exists())
        continue;
      localFile.mkdir();
    }
  }
错误明显减少。

Original issue reported on code.google.com by [email protected] on 28 Oct 2013 at 3:57

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

try-catch 比较难,会被分割,特别是 try-finally 识别有困难

Original comment by [email protected] on 5 Nov 2013 at 9:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant