Skip to content

Commit cd28c25

Browse files
committed
pull and test_disasm
1 parent 54b36f5 commit cd28c25

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/powerpc/test_disasm.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ g++ -std=c++11 -O0 -g -I capstone/include -L./build/capstone test_disasm.cpp dis
2222
int print_errors = 1;
2323
int cs_mode_local = 0;
2424
size_t address_size_ = 4;
25-
bool bigendian = true;
25+
// data in default with strtoul is little endian
26+
bool littleendian = true;
2627

2728
int disas_instr_word(uint32_t instr_word, char *buf)
2829
{
@@ -33,13 +34,13 @@ int disas_instr_word(uint32_t instr_word, char *buf)
3334
struct cs_detail *detail = &(res.detail);
3435
struct cs_ppc *ppc = &(detail->ppc);
3536

36-
if(powerpc_decompose((const uint8_t *)&instr_word, 4, 0, bigendian, &res, address_size_, cs_mode_local)) {
37+
if(powerpc_decompose((const uint8_t *)&instr_word, 4, 0, littleendian, &res, address_size_, cs_mode_local)) {
3738
if(print_errors)
3839
{
39-
if (DoesQualifyForLocalDisassembly((uint8_t*)&instr_word, !bigendian) != PPC_INS_INVALID)
40+
if (DoesQualifyForLocalDisassembly((uint8_t*)&instr_word, !littleendian) != PPC_INS_INVALID)
4041
{
4142
size_t instsz = 4;
42-
PerformLocalDisassembly((uint8_t*)&instr_word, 0, instsz, &res, !bigendian);
43+
PerformLocalDisassembly((uint8_t*)&instr_word, 0, instsz, &res, !littleendian);
4344
}
4445
else
4546
{

0 commit comments

Comments
 (0)