Fix some big endian print issues

This commit is contained in:
trndr 2014-12-07 18:37:59 +00:00 committed by pancake
parent 9fa79fbf0c
commit 0af7751bd8
2 changed files with 4 additions and 0 deletions

View File

@ -1825,6 +1825,7 @@ static int cmd_print(void *data, const char *input) {
case 'W':
for (i=0; i<len; i+=4) {
ut32 *p = (ut32*)((ut8*)core->block+i);
r_mem_copyendian((ut8*)p, (ut8*)p, 4, !core->print->big_endian);
r_cons_printf ("0x%08"PFMT64x" 0x%08x\n", core->offset+i, *p);
}
break;

View File

@ -1142,18 +1142,21 @@ static int handle_print_meta_infos (RCore * core, RDisasmState *ds, ut8* buf, in
case 2:
{
ut16 *data = (ut16*)(buf+idx);
r_mem_copyendian((ut8*)data, (ut8*)data, 2, !core->print->big_endian);
r_cons_printf (".word 0x%04x\n", *data);
}
break;
case 4:
{
ut32 *data = (ut32*)(buf+idx);
r_mem_copyendian((ut8*)data, (ut8*)data, 4, !core->print->big_endian);
r_cons_printf (".dword 0x%08x\n", *data);
}
break;
case 8:
{
ut64 *data = (ut64*)(buf+idx);
r_mem_copyendian((ut8*)data, (ut8*)data, 8, !core->print->big_endian);
r_cons_printf (".qword 0x%016x\n", *data);
}
break;