Fix sparc disassembler for big endian hosts ##endian

This commit is contained in:
pancake 2024-05-13 18:07:13 +02:00 committed by GitHub
parent 4ee16e2c81
commit 05bf34abe5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -2287,7 +2287,6 @@ ST_FUNC long long expr_const(TCCState *s1) {
expect (s1, "constant expression");
return 0;
}
return r_read_le64 (&s1->vtop->c.ll);
return s1->vtop->c.ll;
}

View File

@ -1,4 +1,4 @@
/* radare2 - LGPL - Copyright 2014-2023 - pancake */
/* radare2 - LGPL - Copyright 2014-2024 - pancake */
#include <r_anal.h>
#include <r_lib.h>
@ -136,7 +136,11 @@ performed in big-endian byte order.
if (op->size < 4) {
return false;
}
#if R_SYS_ENDIAN
ut32 lbuf = r_read_ble32 (op->bytes, R_ARCH_CONFIG_IS_BIG_ENDIAN (as->config));
#else
ut32 lbuf = r_read_ble32 (op->bytes, !R_ARCH_CONFIG_IS_BIG_ENDIAN (as->config));
#endif
// capstone-next
int n = cs_disasm (handle, (const ut8*)&lbuf, sizeof (lbuf), addr, 1, &insn);