Switch samples to use long instead of Long for registers
This commit is contained in:
@@ -45,10 +45,10 @@ public class Sample_arm {
|
||||
|
||||
public static void test_arm() {
|
||||
|
||||
Long r0 = 0x1234L; // R0 register
|
||||
Long r2 = 0x6789L; // R1 register
|
||||
Long r3 = 0x3333L; // R2 register
|
||||
Long r1; // R1 register
|
||||
long r0 = 0x1234L; // R0 register
|
||||
long r2 = 0x6789L; // R1 register
|
||||
long r3 = 0x3333L; // R2 register
|
||||
long r1; // R1 register
|
||||
|
||||
System.out.print("Emulate ARM code\n");
|
||||
|
||||
@@ -79,17 +79,17 @@ public class Sample_arm {
|
||||
// now print out some registers
|
||||
System.out.print(">>> Emulation done. Below is the CPU context\n");
|
||||
|
||||
r0 = (Long) u.reg_read(Unicorn.UC_ARM_REG_R0);
|
||||
r1 = (Long) u.reg_read(Unicorn.UC_ARM_REG_R1);
|
||||
System.out.print(String.format(">>> R0 = 0x%x\n", r0.intValue()));
|
||||
System.out.print(String.format(">>> R1 = 0x%x\n", r1.intValue()));
|
||||
r0 = u.reg_read(Unicorn.UC_ARM_REG_R0);
|
||||
r1 = u.reg_read(Unicorn.UC_ARM_REG_R1);
|
||||
System.out.print(String.format(">>> R0 = 0x%x\n", r0));
|
||||
System.out.print(String.format(">>> R1 = 0x%x\n", r1));
|
||||
|
||||
u.close();
|
||||
}
|
||||
|
||||
public static void test_thumb() {
|
||||
|
||||
Long sp = 0x1234L; // R0 register
|
||||
long sp = 0x1234L; // R0 register
|
||||
|
||||
System.out.print("Emulate THUMB code\n");
|
||||
|
||||
@@ -118,8 +118,8 @@ public class Sample_arm {
|
||||
// now print out some registers
|
||||
System.out.print(">>> Emulation done. Below is the CPU context\n");
|
||||
|
||||
sp = (Long) u.reg_read(Unicorn.UC_ARM_REG_SP);
|
||||
System.out.print(String.format(">>> SP = 0x%x\n", sp.intValue()));
|
||||
sp = u.reg_read(Unicorn.UC_ARM_REG_SP);
|
||||
System.out.print(String.format(">>> SP = 0x%x\n", sp));
|
||||
|
||||
u.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user