付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、javaclass利用jad反编译之后,偶尔回碰到一些不正常的代码,例如:label0:_L1MISSING_BLOCK_LABEL_30、 JVM INSTR ret7、JVM INSTR tableswitch 1 3: default269、JVM INSTR monitorexit JVM INSTR monitorente,这些一般是由特殊 的for循环、try catchfinally语句块、synchronized语句反编译后产生的。下面, 就简单介绍一下,一些反编译后的特殊代码的还原规则。异常下面的代码前提是类中有如下属性,Calendar cal = Calendar.get
2、Instance();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代码的还原反编译后的Java代码如下:
3、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 boolean f2() try return cal.getTime
4、().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.out.println(finally);break MISSING_B
5、LOCK_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、异常中 :label 的还原反编译后的代码publicStringf4()throwsExcepti
6、onlabel0: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 String f4() throws Exception try Integeri = new Inte
7、ger(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 = null;HashMap hashmap;HashMap map = new HashMap();Class.forN
8、ame();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(columnVallue, ) columnVallue = rs.getString(column); hashmap = map;if(conn
9、 != 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;sqle;sqle.printStackTrace();if(conn != null) try conn.close(); catch(SQL
10、Exception 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;实际代码如下:public HashMap f5() Connection conn = null;try HashMap map = new HashMap();Cl
11、ass.forName();conn = DriverManager.getConnection(jdbc: odbc:);PreparedStatement pstmt = conn.prepareStatement(select * from table); pstmt.setString(1, param);ResultSet rs = pstmt.executeQuery();while (rs.next() String columnVallue = rs.getString(column); map.put(columnVallue, ); return map; catch (S
12、QLException 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.printStackTrace();System.out.println(finally);return -1;Exception e2;e2;e2.printStackTrace();S
13、ystem.out.println(finally);return -2;Exception exception;exception;System.out.println(finally);throw exception;1.printStackTrace();return -1; catch (Exception e2) e2.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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年婴幼儿发展引导员理论重点试题及答案
- 安全生产专项整治三年行动工作总结评估报告
- 《翻译的文化学派》课件
- 气候和生物对土壤性质的影响
- 胶质瘤术前术后护理
- 《快速诱导插管》课件
- 如何设计奴佛卡因胺项目可行性研究报告评审方案2026年发改委立项详细
- 2026年四川建筑安全员C证考试题库(含答案)
- 2026年PCB感光油墨项目调研分析报告
- 2026年小学全部英语模拟试题及答案详解
- 急性盆腔炎护理查房课件
- (正式版)DB42∕T 2305-2024 《高品质住宅技术标准》
- 宠物超声教学课件
- DB14∕T 3151-2024 公路钢波纹管涵洞施工技术规程
- 《关于严格规范涉企行政检查》知识培训
- 人工智能导论知到智慧树章节测试课后答案2024年秋天津大学
- 第六章 人体生命活动的调节【单元测试·提升卷】(原卷版)
- NB-T 20580.9-2021 核电厂建设工程概算定额 第9部分:常规岛电气设备安装工程
- Micro Shield程序初级应用指南
- 金匮要略讲义全套教学课件
- 西方法律思想史正式的课件
评论
0/150
提交评论