Assembly Language for Beginners
4.1. JAVA public static void dump(int a[]) { for (int i=0; i<a.length; i++) System.out.println(a[i]); } public static void du ...
4.1. JAVA 12: iload_2 13: iaload 14: iadd 15: istore_1 16: iinc 2, 1 19: goto 4 22: iload_1 23: ireturn LVAslot 0 contains arefe ...
4.1. JAVA "September", "October", "November", "December" }; public String get_month (int i) { return months[i]; }; } Theget_mont ...
4.1. JAVA 50: ldc #12 // String September 52: aastore 53: dup 54: bipush 9 56: ldc #13 // String October 58: aastore 59: dup 60: ...
4.1. JAVA 14: invokevirtual #3 // Method java/io/PrintStream.println:(I)V 17: iinc 1, 1 20: goto 2 23: return f()just takes an a ...
4.1. JAVA 10: ldc #5 // String int: %d double: %f.%n 12: iconst_2 13: anewarray #6 // class java/lang/Object 16: dup 17: iconst_ ...
4.1. JAVA The value to be written is set at offset 12. iastoreat 13 writes the array’s element. How it is an element accessed? p ...
4.1. JAVA public static int get_elem(int[][][]); flags: ACC_PUBLIC, ACC_STATIC Code: stack=2, locals=1, args_size=1 0: aload_0 1 ...
4.1. JAVA The string the user entered is reloaded at offset 30 and concatenated with the “Hello, ” string using the StringBuilde ...
4.1. JAVA 3: bipush 123 5: istore_2 6: getstatic #3 // Field java/lang/System.out:Ljava/io/PrintStream; 9: new #4 // class java/ ...
4.1. JAVA }; public static void main (String[] args) { try { System.out.println(get_month(100)); } catch(IncorrectMonthException ...
4.1. JAVA The object’s type is passed as an operand to the instruction (which isIncorrectMonthException). Then its constructor i ...
4.1. JAVA Listing 4.14: from some random .class file found on the author’s computer .catch java/io/FileNotFoundException from me ...
4.1. JAVA Code: stack=1, locals=1, args_size=1 0: iload_0 1: putstatic #2 // Field a:I 4: return Getter ofa: public static int g ...
4.1. JAVA Thenewinstruction creates an object, but doesn’t call the constructor (it is called at offset 4). Theset_a()method is ...
4.1. JAVA Figure 4.2:IDA But that doesn’t work (JRE 1.7): Exception in thread "main" java.lang.VerifyError: Expecting a stack ma ...
4.1. JAVA Second example Another simple crackme example: public class password { public static void main(String[] args) { System ...
4.1. JAVA Figure 4.5:IDA That doesn’t work (JRE 1.7): Exception in thread "main" java.lang.VerifyError: Expecting a stackmap fra ...
4.1. JAVA Figure 4.6:IDA 1 needs always to be in theTOSwhen theifeqinstruction is executed, soifeqwould never jump. This works. ...
Chapter 5 5 Finding important/interesting stuff in the code the code Minimalism it is not a prominent feature of modern software ...
«
31
32
33
34
35
36
37
38
39
40
»
Free download pdf