mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 19:47:31 +00:00
improve arm/thumb detection for .so
This commit is contained in:
parent
e805d701db
commit
149c7567ed
@ -305,7 +305,7 @@ R_API int r_asm_set_pc(RAsm *a, ut64 pc) {
|
||||
R_API int r_asm_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
||||
int oplen, ret = op->payload = 0;
|
||||
op->size = 4;
|
||||
if (len<1)
|
||||
if (len < 1)
|
||||
return 0;
|
||||
op->buf_asm[0] = '\0';
|
||||
if (a->pcalign) {
|
||||
|
@ -47,9 +47,8 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
||||
} else {
|
||||
cs_option (cd, CS_OPT_DETAIL, CS_OPT_OFF);
|
||||
}
|
||||
n = cs_disasm (cd, buf, R_MIN (4, len),
|
||||
a->pc, 1, &insn);
|
||||
if (n<1) {
|
||||
n = cs_disasm (cd, buf, R_MIN (4, len), a->pc, 1, &insn);
|
||||
if (n < 1) {
|
||||
ret = -1;
|
||||
goto beach;
|
||||
}
|
||||
|
@ -1529,8 +1529,9 @@ int Elf_(r_bin_elf_get_bits)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
if (bin->ehdr.e_type != ET_EXEC) {
|
||||
struct r_bin_elf_symbol_t *symbol;
|
||||
if ((symbol = Elf_(r_bin_elf_get_symbols) (bin, R_BIN_ELF_SYMBOLS))) {
|
||||
if (!symbol[0].last) {
|
||||
ut64 paddr = symbol[0].offset;
|
||||
int i = 0;
|
||||
for (i = 0; !symbol[i].last; i++) {
|
||||
ut64 paddr = symbol[i].offset;
|
||||
if (paddr & 1) {
|
||||
free (symbol);
|
||||
return 16;
|
||||
|
Loading…
Reference in New Issue
Block a user