java反编译源代码处理技巧
[ 大恐龙 发表于 2007年11月20日 15:48 ]
| public static final class Type extends Enum { public static final Type SELECT; public static final Type UPDATE; public static final Type INSERT; public static final Type DELETE; private static final Type $VALUES[]; public static final Type[] values() { return (Type[])$VALUES.clone(); } public static Type valueOf(String name) { return (Type)Enum.valueOf(com/***/***/***/***$Type, name); } static { SELECT = new Type("SELECT", 0); UPDATE = new Type("UPDATE", 1); INSERT = new Type("INSERT", 2); DELETE = new Type("DELETE", 3); $VALUES = (new Type[] { SELECT, UPDATE, INSERT, DELETE }); } private Type(String s, int i) { super(s, i); } } |
public enum Type { SELECT, UPDATE, INSERT, DELETE }; |
enum的处理
| Script script; int iLine; int ofInLine; script = m_script; iLine = script.getLine(); ofInLine = script.getOffset(); if(script.nextChar() != '<') goto _L2; else goto _L1 _L1: script.nextChar(); JVM INSTR lookupswitch 3: default 330 // 33: 124 // 47: 72 // 63: 98; goto _L3 _L4 _L5 _L6 _L5: m_nCtx = 5; return new XmlToken(XmlToken.TOK_ENDTAG_START, iLine, ofInLine, script.getOffset() - ofInLine); _L6: m_nCtx = 4; return new XmlToken(XmlToken.TOK_PI_START, iLine, ofInLine, script.getOffset() - ofInLine); _L4: script.nextChar(); JVM INSTR lookupswitch 3: default 313 // 45: 164 // 68: 275 // 91: 196; goto _L7 _L8 _L9 _L10 _L8: match('-'); m_nCtx = 3; return new XmlToken(XmlToken.TOK_COMMENT_START, iLine, ofInLine, script.getOffset() - ofInLine); _L10: String sData; match("CDATA["); ParsePosition pos = script.savePosition(); scan("]]>"); sData = script.subScript(pos).toString(); script.nextChar(); script.nextChar(); script.nextChar(); return new XmlToken(2, 4, 4, sData, sData, iLine, ofInLine, script.getOffset() - ofInLine); _L9: script.putBackChar(); match("DOCTYPE"); m_nCtx = 2; return new XmlToken(XmlToken.TOK_DOCTYPE_START, iLine, ofInLine, script.getOffset() - ofInLine); _L7: script.putBackChar(); match('-'); throw internalError(); _L3: script.putBackChar(); m_nCtx = 5; return new XmlToken(XmlToken.TOK_ELEMENT_START, iLine, ofInLine, script.getOffset() - ofInLine); _L2: script.putBackChar(); ParsePosition pos = script.savePosition(); while(script.nextChar() != '<') ; script.putBackChar(); sData = script.subScript(pos).toString(); return new XmlToken(2, 4, 3, sData, sData, iLine, ofInLine, script.getOffset() - ofInLine); EOFException e; e; logError(3, "XT-002", null, script.getLine(), script.getOffset(), 0); throw new CompilerException(); e; logError(3, "XT-003", new String[] { e.toString() }, script.getLine(), script.getOffset(), 0); throw new CompilerException(); |
Script script = m_script; int iLine = script.getLine(); int ofInLine = script.getOffset(); try { ParsePosition pos; String sData; if(script.nextChar() == '<') { switch(script.nextChar()) { case 47: // '/' m_nCtx = 5; return new XmlToken(XmlToken.TOK_ENDTAG_START, iLine, ofInLine, script.getOffset() - ofInLine); case 63: // '?' m_nCtx = 4; return new XmlToken(XmlToken.TOK_PI_START, iLine, ofInLine, script.getOffset() - ofInLine); case 33: // '!' switch(script.nextChar()) { case 45: // '-' match('-'); m_nCtx = 3; return new XmlToken(XmlToken.TOK_COMMENT_START, iLine, ofInLine, script.getOffset() - ofInLine); case 91: // '[' match("CDATA["); pos = script.savePosition(); scan("]]>"); sData = script.subScript(pos).toString(); script.nextChar(); script.nextChar(); script.nextChar(); return new XmlToken(2, 4, 4, sData, sData, iLine, ofInLine, script.getOffset() - ofInLine); case 68: // 'D' script.putBackChar(); match("DOCTYPE"); m_nCtx = 2; return new XmlToken(XmlToken.TOK_DOCTYPE_START, iLine, ofInLine, script.getOffset() - ofInLine); } script.putBackChar(); match('-'); throw internalError(); } script.putBackChar(); m_nCtx = 5; return new XmlToken(XmlToken.TOK_ELEMENT_START, iLine, ofInLine, script.getOffset() - ofInLine); } script.putBackChar(); pos = script.savePosition(); while(script.nextChar() != '<') ; script.putBackChar(); sData = script.subScript(pos).toString(); return new XmlToken(2, 4, 3, sData, sData, iLine, ofInLine, script.getOffset() - ofInLine); } catch(EOFException e) { logError(3, "XT-002", null, script.getLine(), script.getOffset(), 0); throw new CompilerException(); } catch(IOException e) { logError(3, "XT-003", new String[] { e.toString() }, script.getLine(), script.getOffset(), 0); } throw new CompilerException(); |
java反编译源代码处理技巧(2)-break
[ 大恐龙 发表于 2007年11月20日 16:01 ]
| if(fReentrant) { aoKey = SimpleEnumerator.toArray(iterator(), ao != null ? ao : OverflowMap.EMPTY_ARRAY); break MISSING_BLOCK_LABEL_238; } gate.close(-1L); int cKeys = mapOverflow.size(); if(ao == null) { aoKey = new Object[cKeys]; } else { int cElements = ao.length; if(cKeys > cElements) { aoKey = (Object[])Array.newInstance(((Object) (ao)).getClass().getComponentType(), cKeys); } else { aoKey = ao; if(cKeys < cElements) aoKey[cKeys] = null; } } int iKey = 0; Iterator iter = mapOverflow.getStatusMap().entrySet().iterator(); do { if(!iter.hasNext()) break; java.util.Map.Entry entry = (java.util.Map.Entry)iter.next(); Status status = (Status)entry.getValue(); if(status.isEntryExistent()) aoKey[iKey++] = entry.getKey(); } while(true); if(!$assertionsDisabled && iKey != cKeys) throw new AssertionError(); gate.open(); break MISSING_BLOCK_LABEL_238; |
if(fReentrant) { aoKey = SimpleEnumerator.toArray(iterator(), ao != null ? ao : OverflowMap.EMPTY_ARRAY); }else{ gate.close(-1L); int cKeys = mapOverflow.size(); if(ao == null) { aoKey = new Object[cKeys]; } else { int cElements = ao.length; if(cKeys > cElements) { aoKey = (Object[])Array.newInstance(((Object) (ao)).getClass().getComponentType(), cKeys); } else { aoKey = ao; if(cKeys < cElements) aoKey[cKeys] = null; } } int iKey = 0; Iterator iter = mapOverflow.getStatusMap().entrySet().iterator(); do { if(!iter.hasNext()) break; java.util.Map.Entry entry = (java.util.Map.Entry)iter.next(); Status status = (Status)entry.getValue(); if(status.isEntryExistent()) aoKey[iKey++] = entry.getKey(); } while(true); if(!$assertionsDisabled && iKey != cKeys) throw new AssertionError(); gate.open(); } |
java反编译源代码处理技巧(3)-do while
[ 大恐龙 发表于 2007年11月20日 21:13 ]
| do { if(!e.hasMoreElements()) break label0; key = (String)e.nextElement(); } while(!m_tblCache.containsKey(key)); throw new IllegalStringException(key); |
for(Enumeration e = tblTest.keys(); e.hasMoreElements();) { String key = (String)e.nextElement(); if(m_tblCache.containsKey(key)) throw new IllegalStringException(key); } |
java反编译源代码处理技巧(4)-boolean $assertionsDisabled
[ 大恐龙 发表于 2007年11月20日 21:23 ]
static final boolean $assertionsDisabled; /* synthetic field */
if(!$assertionsDisabled && ((WeakReference)oIterActive).get() != iter)
throw new AssertionError();
static {
$assertionsDisabled = !(SafeHashMap.class).desiredAssertionStatus();
}
|
assert ((WeakReference)oIterActive).get() != iter; |
ContentType - 备忘
[ 大恐龙 发表于 2007年11月21日 18:20 ]
| application/activemessage application/andrew-inset application/applefile application/atomicmail application/dca-rft application/dec-dx application/mac-binhex40 hqx application/mac-compactpro cpt application/macwriteii application/msword doc application/news-message-id application/news-transmission application/octet-stream bin dms lha lzh exe class application/jsp jsp application/oda oda application/pdf pdf application/postscript ai eps ps application/powerpoint ppt application/remote-printing application/rtf rtf application/slate application/wita application/wordperfect5.1 application/x-bcpio bcpio application/x-cdlink vcd application/x-compress Z application/x-cpio cpio application/x-csh csh application/x-director dcr dir dxr application/x-dvi dvi application/x-gtar gtar application/x-gzip gz application/x-hdf hdf application/x-httpd-cgi cgi application/x-java-jnlp-file jnlp application/x-koan skp skd skt skm image/x-xpixmap xpm image/x-xwindowdump xwd |
application/x-sv4cpio sv4cpio |
message/external-body message/news message/partial message/rfc822 multipart/alternative multipart/appledouble multipart/digest multipart/mixed multipart/parallel text/html html htm text/plain txt text/richtext rtx text/tab-separated-values tsv text/x-setext etx text/x-sgml sgml sgm video/mpeg mpeg mpg mpe video/quicktime qt mov video/x-msvideo avi video/x-sgi-movie movie x-conference/x-cooltalk ice x-world/x-vrml wrl vrml text/vnd.wap.wml wml application/vnd.wap.wmlc wmlc text/vnd.wap.wmlscript wmls application/vnd.wap.wmlscriptc wmlsc image/vnd.wap.wbmp wbmp text/css css text/vnd.sun.j2me.app-descriptor jad application/java-archive jar video/3gp 3gp video/3gpp mp4 application/x-mif mif application/x-netcdf nc cdf application/x-sh sh application/x-shar shar application/x-stuffit sit |













![[Valid RSS]](http://www.w3cool.com//images/valid-rss.png)
![Validate my Atom 1.0 feed [Valid Atom 1.0]](http://www.w3cool.com//images/valid-atom.png)






[卓越网] 于 08-12-22 发表: 博主您的博客挺不错的, 可否做个链接? 我那边做好了~ 我的博客是 大恐龙
[购买] 于 08-12-21 发表: 很喜欢这个功能,但是我加入代码还是不能用,是不是有限制呢? 我自己有服务器,可否购买你的软件,我自...
[大恐龙
[linuxes] 于 08-12-13 发表: 请问wordpress里面怎么用?...
[游客] 于 08-12-13 发表: 原来乌班图免费光盘是这样子的 看看就好 索取的人多了 估计要垮掉 不忍心啊...
[大恐龙
[renm79] 于 08-12-11 发表: 今天看了你的文章非常有启发,然后照着文章去试了一试,发现几个不明白的地方,还请赐教。1)直接按你说的...
[hanyu] 于 08-12-10 发表: 没办法.现在网站广告的投放各大媒体都声称自己的可以流量和点击及视频播放可以达到什么程度.其实都是在用...
[大恐龙
[hanyu] 于 08-12-08 发表: 现在ICAST已经减少了前面那种的富媒体投放形式而转为使用MPU中FLASH钳套新的FLASH或视频...
[大恐龙
[tanguan] 于 08-12-04 发表: 老是语音服务忙,怎么办?...
[443205231@qq.com] 于 08-11-28 发表: 这个功能太爽了!!...