improve arm/thumb detection for .so

This commit is contained in:
Álvaro Felipe Melchor 2016-05-02 22:53:41 +02:00
parent e805d701db
commit 149c7567ed
3 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;