




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、javaclass利用jad反编译之后,偶尔回碰到一些不正常的代码,例如: label0:_L1MISSING_BLOCK_LABEL_ 30、 JVM INSTR ret 7、JVM INSTR tableswitch 1 3: default 269、JVM INSTR monitorexit JVM INSTR monitorente,这些一般是由特殊 的for循环、try catchfinally语句块、synchronized语句反编译后产生的。下面, 就简单介绍一下,一些反编译后的特殊代码的还原规则。 异常 下面的代码前提是类中有如下属性, Calendar cal = Calen
2、dar.getInstance(); 1、Exceptioin 的还原 反编译后的代码如下: public boolean f1() return cal.getTime().after(new Date();Exception e; e; e.printStackTrace(); return false; 还原后的 Java代码 public boolean f1() try return cal.getTime().after(new Date(); catch (Exception e) e.printStackTrace(); return false; 2、fin ally代码的还
3、原反编译后的Java代码如下: publicbooleanf2()booleanflag=cal.getTime().after(new Date(); System.out.println(finally); return flag; Exception e; e; e.printStackTrace(); System.out.println(finally); return false; Exception exception; exception; System.out.println(finally); throw exception; 还原后的代码如下: public boolea
4、n f2() try return cal.getTime().after(new Date(); catch (Exception e) e.printStackTrace(); return false; finally System.out.println(finally); 3、missing_block_labEL还原反编译后的代码 publicObjectf22()Datedate=cal.getTime(); system.out.println(finally); return date; Exception e; e; e.printStackTrace(); System.
5、out.println(finally); break MISSING_BLOCK_LABEL_45; Exception exception; exception; System.out.println(finally); throw exception; return null; 还原后的 Java代码 public Object f22() try return cal.getTime(); catch (Exception e) e.printStackTrace(); finally System.out.println(finally); return null; 4、异常中 :
6、label 的还原反编译后的代码 publicStringf4()throwsExceptionlabel0:try Integer i = new Integer (1); if(Value() 0) System.out.println(i); break label0; System.err.println(i); catch(Exception dae) System.err.println(dae); throw new RuntimeException(dae); return null; return Hello; 注意,这个代码有点诡异,实际代码如下: public
7、String f4() throws Exception try Integeri = new Integer (1); if (Value() 0) System.out.println(i); else System.err.println(i); return null; return Hello; catch (Exception dae) System.err.println(dae); throw new RuntimeException(dae); 5、典型数据库操作代码还原反编译后代码 public HashMap f5() Connection conn = nul
8、l;HashMap hashmap; HashMap map = new HashMap(); Class.forName(); conn = DriverManager.getConnection(jdbc: odbc: ); PreparedStatement pstmt = conn.prepareStatement(select * from table); pstmt.setString(1, param); String columnVallue; for(ResultSet rs = pstmt.executeQuery(); rs.next(); map.put(columnV
9、allue, ) columnVallue = rs.getString(column); hashmap = map; if(conn != null) try conn.close(); catch(SQLException sqlce) sqlce.printStackTrace(); return hashmap; if(conn != null) try conn.close(); catch(SQLException sqlce) sqlce.printStackTrace(); break MISSING_BLOCK_LABEL_188; SQLException sqle; s
10、qle; sqle.printStackTrace(); if(conn != null) try conn.close(); catch(SQLException sqlce) sqlce.printStackTrace(); break MISSING_BLOCK_LABEL_188; Exception exception; exception; if(conn != null) try conn.close(); catch(SQLException sqlce) sqlce.printStackTrace(); throw exception; return null; 实际代码如下
11、: public HashMap f5() Connection conn = null; try HashMap map = new HashMap(); Class.forName(); conn = DriverManager.getConnection(jdbc: odbc: ); PreparedStatement pstmt = conn.prepareStatement(select * from table); pstmt.setString(1, param); ResultSet rs = pstmt.executeQuery(); while (rs.next() Str
12、ing columnVallue = rs.getString(column); map.put(columnVallue, ); return map; catch (SQLException sqle) sqle.printStackTrace(); finally if (conn != null) try conn.close(); catch (SQLException sqlce) sqlce.printStackTrace(); return null; System.out.println(finally); return i; Exception e1; e1;e1.prin
13、tStackTrace(); System.out.println(finally); return -1; Exception e2; e2;e2.printStackTrace(); System.out.println(finally); return -2; Exception exception; exception; System.out.println(finally); throw exception; 1.printStackTrace(); return -1; catch (Exception e2) e 2.printStackTrace(); return -2; finally System.out.println(finally); System.out.println(finally); return i; Exception e1; e1;e1.printStackTrace(); _L2: System.out.println(finally); return -1; Exception e2; e2;e2.printStackTrace(); if(true) goto _L2; else got
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 红酒生意基础知识培训课件
- 2025年艺人经纪合同范本:主播艺人签约协议(律师专业风险评估与批注)
- 红楼梦翻译对比课件
- 资源型城市绿色转型发展模式与绿色产业国际合作2025年研究
- 娱乐活动组织与安全保障协议
- 2025年太阳能光伏电站安全生产标准化改造案例集
- 2025年新能源汽车充电服务市场技术创新与充电设备创新研究报告
- 新能源汽车行业2026年市场深度解析:技术创新驱动310亿美元市场规模
- 2025年后视提篮镜行业研究报告及未来行业发展趋势预测
- 2025年社会工作者职业资格考试(社会工作实务初级)冲刺模拟试题及答案
- 2025-2026学年人教版(2024)初中生物八年级上册(全册)教学设计(附目录)
- 2025-2030中国汽车工程服务外包(ESO)行业现状调查与前景趋势研究报告
- 职业中学数学课件学习方法
- 2025年中国药用菌行业投资前景及策略咨询研究报告
- 软陶教学课件
- 2025年黑吉辽蒙高考化学试卷真题解读及答案详解(精校打印)
- 美术教育学新编
- TCDSA 201.22-2024 呼吸气体质量分析仪
- 特种设备重大事故隐患判定准则试题及答案
- 二年级语文(统编版)二年级上册学习导引课课件
- 人工智能全套课件下载
评论
0/150
提交评论