diff --git a/libr/anal/p/anal_arm.c b/libr/anal/p/anal_arm.c index 8142c7737c..e36080ebeb 100644 --- a/libr/anal/p/anal_arm.c +++ b/libr/anal/p/anal_arm.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2007-2012 - pancake */ +/* radare - LGPL - Copyright 2007-2013 - pancake */ #include #include @@ -277,10 +277,22 @@ static int arm_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) } } - if (IS_EXITPOINT (code[i])) { + if ( +( ((code[i]&0xff)>=0x10 && (code[i]&0xff)<0x20) +) && ((code[i]&0xffffff00) == 0xe12fff00) +|| + IS_EXITPOINT (code[i])) { +//if (IS_EXITPOINT (code[i])) { b=data; branch_dst_addr = disarm_branch_offset (addr, b[0] | (b[1]<<8) | (b[2]<<16)); //code[i]&0x00FFFFFF); op->ref = 0; +if ( +( ((code[i]&0xff)>=0x10 && (code[i]&0xff)<0x20) +) && ((code[i]&0xffffff00) == 0xe12fff00) +) { + op->type = R_ANAL_OP_TYPE_UJMP; + op->eob = 1; +} else if (IS_BRANCHL (code[i])) { if (IS_BRANCH (code[i])) { op->type = R_ANAL_OP_TYPE_CALL; @@ -294,7 +306,6 @@ static int arm_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) } else if (IS_BRANCH (code[i])) { if (IS_CONDAL (code[i])) { op->type = R_ANAL_OP_TYPE_JMP; - //op->type = R_ANAL_OP_TYPE_NOP; op->jump = branch_dst_addr; op->fail = UT64_MAX; op->eob = 1; @@ -306,8 +317,10 @@ static int arm_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) } } else { //unknown jump o return - op->type = R_ANAL_OP_TYPE_UJMP; - op->eob = 1; + //op->type = R_ANAL_OP_TYPE_UJMP; + //op->type = R_ANAL_OP_TYPE_NOP; + // op->eob = 1; + op->eob = 0; } } //op->jump = arminsn->jmp; diff --git a/libr/bin/bin.c b/libr/bin/bin.c index b4cf54cdc9..b303a1f2f0 100644 --- a/libr/bin/bin.c +++ b/libr/bin/bin.c @@ -67,7 +67,7 @@ static int is_data_section(RBinArch *a, RBinSection *s) { RBinObject *o = a->o; if (strstr (o->info->bclass, "MACH0") && strstr (s->name, "_cstring")) // OSX return 1; - if (strstr (o->info->bclass, "ELF") && strstr (s->name, "data")) // LINUX + if (strstr (o->info->bclass, "ELF") && strstr (s->name, "data") && !strstr (s->name, "rel")) // LINUX return 1; #define X 1 #define ROW (4|2) diff --git a/libr/bin/format/elf/elf.c b/libr/bin/format/elf/elf.c index 69be04dbdb..440d7fc20c 100644 --- a/libr/bin/format/elf/elf.c +++ b/libr/bin/format/elf/elf.c @@ -83,7 +83,7 @@ static int Elf_(r_bin_elf_init_shdr)(struct Elf_(r_bin_elf_obj_t) *bin) { #endif bin->ehdr.e_shnum); if (len == -1) { - eprintf ("Error: read (shdr)\n"); + eprintf ("Error: read (shdr) at 0x%"PFMT64x"\n", (ut64) bin->ehdr.e_shoff); R_FREE (bin->shdr); return R_FALSE; } @@ -94,11 +94,11 @@ static int Elf_(r_bin_elf_init_strtab)(struct Elf_(r_bin_elf_obj_t) *bin) { int sz; if (bin->strtab || !bin->shdr) return R_FALSE; bin->shstrtab_section = - bin->strtab_section = &bin->shdr[bin->ehdr.e_shstrndx]; + bin->strtab_section = &bin->shdr[bin->ehdr.e_shstrndx]; if (bin->strtab_section == NULL) return R_FALSE; bin->shstrtab_size = - bin->strtab_size = bin->strtab_section->sh_size; + bin->strtab_size = bin->strtab_section->sh_size; sz = sizeof (struct r_bin_elf_section_t) + bin->strtab_section->sh_size; if ((bin->strtab = (char *)malloc (sz)) == NULL) { perror ("malloc"); @@ -107,9 +107,11 @@ static int Elf_(r_bin_elf_init_strtab)(struct Elf_(r_bin_elf_obj_t) *bin) { } memset (bin->strtab, 0, sz); bin->shstrtab = bin->strtab; + //bin->strtab_section->sh_offset = 0; if (r_buf_read_at (bin->b, bin->strtab_section->sh_offset, (ut8*)bin->strtab, bin->strtab_section->sh_size) == -1) { - eprintf ("Error: read (strtab)\n"); + eprintf ("Error: read (strtab) at 0x%"PFMT64x"\n", + (ut64) bin->strtab_section->sh_offset); R_FREE (bin->strtab); bin->shstrtab = NULL; return R_FALSE; @@ -185,7 +187,7 @@ static int Elf_(r_bin_elf_init)(struct Elf_(r_bin_elf_obj_t) *bin) { } Elf_(r_bin_elf_init_phdr) (bin); //if (!Elf_(r_bin_elf_init_phdr) (bin)) - //eprintf ("Warning: Cannot initialize program headers\n"); + // eprintf ("Warning: Cannot initialize program headers\n"); if (!Elf_(r_bin_elf_init_shdr) (bin)) eprintf ("Warning: Cannot initialize section headers\n"); if (!Elf_(r_bin_elf_init_strtab) (bin)) @@ -549,9 +551,9 @@ char* Elf_(r_bin_elf_get_elf_class)(struct Elf_(r_bin_elf_obj_t) *bin) { int Elf_(r_bin_elf_get_bits)(struct Elf_(r_bin_elf_obj_t) *bin) { switch (bin->ehdr.e_ident[EI_CLASS]) { - case ELFCLASSNONE: return 0; case ELFCLASS32: return 32; case ELFCLASS64: return 64; + case ELFCLASSNONE: default: return 32; // defaults } } @@ -863,7 +865,7 @@ struct r_bin_elf_symbol_t* Elf_(r_bin_elf_get_symbols)(struct Elf_(r_bin_elf_obj ut64 sym_offset = 0, data_offset = 0, toffset; int shdr_size, tsize, nsym, ret_ctr, i, j, k, len; - if (!bin->shdr || bin->ehdr.e_shnum == 0) + if (!bin->shdr || bin->ehdr.e_shnum == 0 || bin->ehdr.e_shnum == 0xffff) return NULL; if (bin->ehdr.e_type == ET_REL) { // XXX: we must obey shndx here @@ -873,11 +875,9 @@ struct r_bin_elf_symbol_t* Elf_(r_bin_elf_get_symbols)(struct Elf_(r_bin_elf_obj data_offset = 0; } shdr_size = bin->ehdr.e_shnum * sizeof (Elf_(Shdr)); - for (i = 0; i < bin->ehdr.e_shnum; i++) - if ((type == R_BIN_ELF_IMPORTS && - bin->shdr[i].sh_type == (bin->ehdr.e_type == ET_REL ? SHT_SYMTAB : SHT_DYNSYM)) || - (type == R_BIN_ELF_SYMBOLS && - bin->shdr[i].sh_type == (Elf_(r_bin_elf_get_stripped) (bin) ? SHT_DYNSYM : SHT_SYMTAB))) { + for (i = 0; i < bin->ehdr.e_shnum; i++) { + if ((type == R_BIN_ELF_IMPORTS && bin->shdr[i].sh_type == (bin->ehdr.e_type == ET_REL ? SHT_SYMTAB : SHT_DYNSYM)) || + (type == R_BIN_ELF_SYMBOLS && bin->shdr[i].sh_type == (Elf_(r_bin_elf_get_stripped) (bin) ? SHT_DYNSYM : SHT_SYMTAB))) { if (bin->shdr[i].sh_link > shdr_size) { /* oops. fix out of range pointers */ continue; @@ -989,6 +989,7 @@ struct r_bin_elf_symbol_t* Elf_(r_bin_elf_get_symbols)(struct Elf_(r_bin_elf_obj ret[ret_ctr].last = 1; // ugly dirty hack :D break; } + } return ret; } diff --git a/libr/bin/p/bin_elf.c b/libr/bin/p/bin_elf.c index 336efd0140..982372c441 100644 --- a/libr/bin/p/bin_elf.c +++ b/libr/bin/p/bin_elf.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2012 - nibble */ +/* radare - LGPL - Copyright 2009-2013 - nibble */ #include #include diff --git a/libr/bin/p/bin_te.c b/libr/bin/p/bin_te.c index 16800d5e36..b5668b1a6d 100644 --- a/libr/bin/p/bin_te.c +++ b/libr/bin/p/bin_te.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2013 - nibble, pancake, xvilka */ +/* radare - LGPL - Copyright 2013 - xvilka */ #include #include diff --git a/libr/core/visual.c b/libr/core/visual.c index 688cf4a160..f7deac4cc2 100644 --- a/libr/core/visual.c +++ b/libr/core/visual.c @@ -215,6 +215,7 @@ R_API int r_core_visual_cmd(RCore *core, int ch) { if (ch>='0'&& ch<='9') { r_io_sundo_push (core->io, core->offset); r_core_seek (core, core->asmqjmps[ch-'0'], 1); + r_core_block_read (core, 1); } else switch (ch) { case 9: // tab diff --git a/media/images/r2pow.png b/media/images/r2pow.png index ef58f4e015..3068489517 100644 Binary files a/media/images/r2pow.png and b/media/images/r2pow.png differ diff --git a/media/images/r2pow.svg b/media/images/r2pow.svg index 6a890c30e1..9513e1d1fd 100644 --- a/media/images/r2pow.svg +++ b/media/images/r2pow.svg @@ -7,54 +7,78 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" width="500" height="300" id="svg3004" - xml:space="preserve">image/svg+xmlPowered by - \ No newline at end of file + id="clipPath3018"> +Powered by + \ No newline at end of file