Definition at line 9 of file TestArm.java.
◆ hex() [1/2]
◆ hex() [2/2]
Definition at line 33 of file TestArm.java.
34 return Long.toString(
i, 16);
References i.
◆ hexString2Byte()
static byte [] TestArm.hexString2Byte |
( |
String |
s | ) |
|
|
inlinestaticpackage |
Definition at line 11 of file TestArm.java.
14 byte[] data =
new byte[
len / 2];
15 for (
int i = 0;
i <
len;
i += 2) {
16 data[
i / 2] = (byte) ((Character.digit(
s.charAt(
i), 16) << 4)
17 + Character.digit(
s.charAt(
i+1), 16));
References i, len, and s.
Referenced by main().
◆ main()
static void TestArm.main |
( |
String |
argv[] | ) |
|
|
inlinestatic |
Definition at line 109 of file TestArm.java.
120 System.out.println(
new String(
new char[16]).
replace(
"\0",
"*"));
121 System.out.println(
"Platform: " +
test.comment);
123 System.out.println(
"Disasm:");
126 cs.setDetail(Capstone.CS_OPT_ON);
127 if (
test.syntax != 0)
128 cs.setSyntax(
test.syntax);
129 Capstone.CsInsn[] all_ins =
cs.disasm(
test.code, 0x1000);
131 for (
int j = 0; j < all_ins.length; j++) {
133 System.out.println();
135 System.out.printf(
"0x%x:\n\n", (all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size));
static final String ARM_CODE2
static final String THUMB_CODE2
static final String ARM_CODE
static final String THUMB_CODE
static void print_ins_detail(Capstone.CsInsn ins)
static byte[] hexString2Byte(String s)
static String stringToHex(byte[] code)
int replace(char *string, const char *token, const char *fmt,...)
References test_arm.all_tests, ARM_CODE, ARM_CODE2, cs, hexString2Byte(), i, print_ins_detail(), replace(), TestBasic.stringToHex(), THUMB_CODE, and THUMB_CODE2.
◆ print_ins_detail()
static void TestArm.print_ins_detail |
( |
Capstone.CsInsn |
ins | ) |
|
|
inlinestatic |
Definition at line 37 of file TestArm.java.
38 System.out.printf(
"0x%x:\t%s\t%s\n", ins.address, ins.mnemonic, ins.opStr);
43 System.out.printf(
"\top_count: %d\n",
operands.op.length);
48 System.out.printf(
"\t\toperands[%d].type: SYSREG = %d\n",
c,
i.value.reg);
50 System.out.printf(
"\t\toperands[%d].type: REG = %s\n",
c, ins.regName(
i.value.reg));
52 System.out.printf(
"\t\toperands[%d].type: IMM = 0x%x\n",
c,
i.value.imm);
54 System.out.printf(
"\t\toperands[%d].type: P-IMM = %d\n",
c,
i.value.imm);
56 System.out.printf(
"\t\toperands[%d].type: C-IMM = %d\n",
c,
i.value.imm);
58 System.out.printf(
"\t\toperands[%d].type: SETEND = %s\n",
c,
i.value.setend ==
ARM_SETEND_BE?
"be" :
"le");
60 System.out.printf(
"\t\toperands[%d].type: FP = %f\n",
c,
i.value.fp);
62 System.out.printf(
"\t\toperands[%d].type: MEM\n",
c);
63 String base = ins.regName(
i.value.mem.base);
64 String index = ins.regName(
i.value.mem.index);
66 System.out.printf(
"\t\t\toperands[%d].mem.base: REG = %s\n",
c, base);
68 System.out.printf(
"\t\t\toperands[%d].mem.index: REG = %s\n",
c, index);
69 if (
i.value.mem.scale != 1)
70 System.out.printf(
"\t\t\toperands[%d].mem.scale: %d\n",
c, (
i.value.mem.scale));
71 if (
i.value.mem.disp != 0)
72 System.out.printf(
"\t\t\toperands[%d].mem.disp: 0x%x\n",
c, (
i.value.mem.disp));
73 if (
i.value.mem.lshift != 0)
74 System.out.printf(
"\t\t\toperands[%d].mem.lshift: 0x%x\n",
c, (
i.value.mem.lshift));
76 if (
i.vector_index > 0)
77 System.out.printf(
"\t\t\toperands[%d].vector_index = %d\n",
c, (
i.vector_index));
79 System.out.printf(
"\t\t\tShift: %d = %d\n",
i.shift.type,
i.shift.value);
81 System.out.printf(
"\t\t\toperands[%d].subtracted = True\n",
c);
85 System.out.println(
"\tWrite-back: True");
88 System.out.println(
"\tUpdate-flags: True");
91 System.out.printf(
"\tCode condition: %d\n",
operands.cc);
94 System.out.printf(
"\tCPSI-mode: %d\n",
operands.cpsMode);
97 System.out.printf(
"\tCPSI-flag: %d\n",
operands.cpsFlag);
100 System.out.printf(
"\tVector-data: %d\n",
operands.vectorData);
103 System.out.printf(
"\tVector-size: %d\n",
operands.vectorSize);
106 System.out.printf(
"\tUser-mode: True\n");
@ ARM_SETEND_BE
BE operand.
@ ARM_OP_IMM
= CS_OP_IMM (Immediate operand).
@ ARM_OP_REG
= CS_OP_REG (Register operand).
@ ARM_OP_CIMM
C-Immediate (coprocessor registers)
@ ARM_OP_SETEND
operand for SETEND instruction
@ ARM_OP_PIMM
P-Immediate (coprocessor registers)
@ ARM_OP_MEM
= CS_OP_MEM (Memory operand).
@ ARM_OP_FP
= CS_OP_FP (Floating-Point operand).
@ ARM_OP_SYSREG
MSR/MRS special register operand.
@ ARM_CC_AL
Always (unconditional) Always (unconditional)
if(dbg->bits==RZ_SYS_BITS_64)
References ARM_CC_AL, ARM_CC_INVALID, ARM_OP_CIMM, ARM_OP_FP, ARM_OP_IMM, ARM_OP_MEM, ARM_OP_PIMM, ARM_OP_REG, ARM_OP_SETEND, ARM_OP_SYSREG, ARM_SETEND_BE, ARM_SFT_INVALID, c, hex(), i, if(), and imm.
Referenced by main().
◆ ARM_CODE
final String TestArm.ARM_CODE = "EDFFFFEB04e02de500000000e08322e5f102030e0000a0e30230c1e7000053e3000201f10540d0e8" |
|
staticpackage |
◆ ARM_CODE2
final String TestArm.ARM_CODE2 = "d1e800f0f02404071f3cf2c000004ff00001466c" |
|
staticpackage |
◆ cs
◆ THUMB_CODE
final String TestArm.THUMB_CODE = "7047eb4683b0c9681fb130bfaff32084" |
|
staticpackage |
◆ THUMB_CODE2
final String TestArm.THUMB_CODE2 = "4ff00001bde80088d1e800f018bfadbff3ff0b0c86f3008980f3008c4ffa99f6d0ffa201" |
|
staticpackage |
The documentation for this class was generated from the following file: