要使Eclipse摆脱< -MISALIGNED-&gt ;,比jad更准确的反编译器是什么? [英] What would be a more accurate decompiler than jad for Eclipse to get rid of <-MISALIGNED ->?

查看:175
本文介绍了要使Eclipse摆脱< -MISALIGNED-&gt ;,比jad更准确的反编译器是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用jad多年了,其中大多数都与Jadclipse插件配合使用,这使得它非常有用.尤其是使用对齐代码进行调试",它使您可以查看堆栈跟踪中任何行的反编译代码.很好.

I have used jad for many years, most of these with the Jadclipse plugin to eclipse which makes it quite usable. Especially with the "Align code for debugging" which allows you to see the decompiled code for any line in a stack trace. Very nice.

不幸的是,我越来越多地看到<-MISALIGNED->注释潜入,这很可能是因为jad期望类文件按顺序排列,而Java 6运行时库显然不是这种情况.因此,在写入文件时,一条指令说这是第100行",那么将写入99个空行,如果下一条指令说这是第10行",那么jad无法倒带将该输出放在那里,而只是打印指出这是在错误的地方.

Unfortunately I've seen more and more that the <- MISALIGNED -> comment sneaks in, which is most likely because jad expects the classfile to be in order which clearly is not the case for the Java 6 runtime library. Hence when writing the file, and an instruction says "this is line 100" then 99 empty lines are written, and if then the next instruction says "this is for line 10" then jad cannot rewind to put that output there, but just prints out a comment that this is in the wrong place.

以下是HttpURLConnection的示例:

Here is an example for HttpURLConnection:

          protected HttpURLConnection(URL url, Proxy proxy, Handler handler1)
            {
/* <-MISALIGNED-> */ /* 603*/        super(url);
/* <-MISALIGNED-> */ /* 192*/        ps = null;
/* <-MISALIGNED-> */ /* 196*/        errorStream = null;
/* <-MISALIGNED-> */ /* 199*/        setUserCookies = true;
/* <-MISALIGNED-> */ /* 200*/        userCookies = null;
/* <-MISALIGNED-> */ /* 220*/        currentProxyCredentials = null;
/* <-MISALIGNED-> */ /* 221*/        currentServerCredentials = null;
/* <-MISALIGNED-> */ /* 222*/        needToCheck = true;
/* <-MISALIGNED-> */ /* 223*/        doingNTLM2ndStage = false;
/* <-MISALIGNED-> */ /* 224*/        doingNTLMp2ndStage = false;
/* <-MISALIGNED-> */ /* 226*/        tryTransparentNTLMServer = NTLMAuthentication.supportsTransparentAuth();
/* <-MISALIGNED-> */ /* 227*/        tryTransparentNTLMProxy = NTLMAuthentication.supportsTransparentAuth();
/

现在的问题是,是否还有另一个反编译器可以按行生成更准确的输出.实际的反编译不需要很大,也不需要任何东西,但是我真的很喜欢Java堆栈跟踪视图期望的反编译.如果与Jadclipse配合使用,效果更好.

The question is now if there is another decompiler which generates more accurate output linewise. The actual decompilation does not need to be extremely great or anything, but I really like it to be where the Java Stack Trace view expects it to be. If it works well with Jadclipse, thats even better.

推荐答案

调试格式的问题来自jadclipse,而不是jad. jad没有该功能.

The problem with formatting for debug comes from jadclipse and not from jad. jad does not have that capability.

jadclipse插件在类名称为DebugAlignWriter的代码中有一个小段代码,用于执行此操作:

The jadclipse plug-in has a little code section in a class names DebugAlignWriter which does this:

if((align = getAlignTarget(aLine)) != -1)
{
   if(align < curLine)
   {
      if(curLine != 0)
      {
          out.write(10);
      }
      out.write("/* <-MISALIGNED-> */ ");
      out.write(aLine);
      curLine++;
   }
   else if(align == curLine)
   {
      out.write(aLine);
   }
   else
   {
      for(; align > curLine; curLine++)
      {
          out.write(10);
      }
      out.write(aLine);
   }

}

基本上,它尝试对齐jad的输出.

Basically it tries to align the output from jad.

因此,根本原因是jad产生的输出不一定按读取顺序排列.不幸的是,我无法阐明为什么jad如此行事.根据jad帮助,无法控制订单.

So the root cause is that jad produces an output that is not necessarily in reading order. Unfortunately I cannot shed light on why jad acts that way. According to jad help there is no way of controlling the order.

我在jadclipse中注意到,如果您设置 JadClipse-> Formatting->在打开大括号之前不要插入换行符-它会减少 c10>由于其工作方式的性质而进行细分.

I noticed in jadclipse that if you set JadClipse->Formatting->Don't insert a newline before opening brace - it will reduce the number of /* <-MISALIGNED-> */ segments due to the nature of how it works.

此外,如果选中了方法之前的输出字段选项,则它可能会增加/* <-MISALIGNED-> */段的数量,因此请避免使用它.

Also, if you checked the Output fields before methods option it can increase the number of /* <-MISALIGNED-> */ segments, so avoid it.

这篇关于要使Eclipse摆脱&lt; -MISALIGNED-&gt ;,比jad更准确的反编译器是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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