Use anal-udis86 by default instead of anal-im86

This commit is contained in:
pancake 2013-03-19 10:27:57 +01:00
parent 837489a5ed
commit ce4382abb7
9 changed files with 29 additions and 37 deletions

View file

@ -10,7 +10,7 @@ all: ${ALL_TARGETS} ;
ALL_TARGETS=
# TODO: rename to enabled plugins
ARCHS=x86.mk x86_udis86.mk x86_simple.mk ppc.mk arm.mk avr.mk csr.mk dalvik.mk sh.mk
ARCHS=x86_im.mk x86_udis.mk x86_simple.mk ppc.mk arm.mk avr.mk csr.mk dalvik.mk sh.mk
include $(ARCHS)
clean:

View file

@ -1085,8 +1085,8 @@ static int set_reg_profile(RAnal *anal) {
"drx dr7 .32 28 0\n");
}
struct r_anal_plugin_t r_anal_plugin_x86 = {
.name = "x86",
struct r_anal_plugin_t r_anal_plugin_x86_im = {
.name = "x86.im86",
.desc = "X86 analysis plugin (x86im backend)",
.arch = R_SYS_ARCH_X86,
.bits = 16|32|64,
@ -1104,6 +1104,6 @@ struct r_anal_plugin_t r_anal_plugin_x86 = {
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_x86
.data = &r_anal_plugin_x86_im
};
#endif

View file

@ -234,8 +234,8 @@ static int set_reg_profile(RAnal *anal) {
"drx dr7 .32 28 0\n");
}
struct r_anal_plugin_t r_anal_plugin_x86_udis86 = {
.name = "x86.udis86",
struct r_anal_plugin_t r_anal_plugin_x86_udis = {
.name = "x86",
.desc = "X86 analysis plugin (udis86 backend)",
.arch = R_SYS_ARCH_X86,
.bits = 16|32|64,
@ -253,6 +253,6 @@ struct r_anal_plugin_t r_anal_plugin_x86_udis86 = {
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_x86_udis86
.data = &r_anal_plugin_x86_udis
};
#endif

View file

@ -1,4 +1,4 @@
OBJ_X86=anal_x86.o
OBJ_X86=anal_x86_im.o
OBJ_X86+=../arch/x86/x86im/x86im.o ../arch/x86/x86im/x86im_fmt.o
STATIC_OBJ+=${OBJ_X86}
@ -8,4 +8,4 @@ ALL_TARGETS+=${TARGET_X86}
CFLAGS+=-D__X86IM_USE_FMT__
${TARGET_X86}: ${OBJ_X86}
${CC} $(call libname,anal_x86) ${CFLAGS} -o anal_x86.${EXT_SO} ${OBJ_X86}
${CC} $(call libname,anal_x86) ${CFLAGS} -o anal_x86_im.${EXT_SO} ${OBJ_X86}

View file

@ -1,4 +1,4 @@
OBJ_X86_UDIS86=anal_x86_udis86.o
OBJ_X86_UDIS86=anal_x86_udis.o
SHARED_X86_UDIS86=../../shlr/udis86/decode.o
SHARED_X86_UDIS86+=../../shlr/udis86/input.o
SHARED_X86_UDIS86+=../../shlr/udis86/itab.o
@ -15,4 +15,4 @@ ALL_TARGETS+=${TARGET_X86_UDIS86}
CFLAGS+=-I../asm/arch/x86/udis86 -I../../asm/arch/x86/udis86
${TARGET_X86_UDIS86}: ${OBJ_X86_UDIS86}
${CC} ${CFLAGS} $(call libname,anal_x86) -o anal_x86_udis86.${EXT_SO} ${OBJ_X86_UDIS86}
${CC} ${CFLAGS} $(call libname,anal_x86) -o anal_x86_udis.${EXT_SO} ${OBJ_X86_UDIS86}

View file

@ -531,7 +531,7 @@ static int cmd_system(void *data, const char *input) {
r_cons_memcat (out, olen);
free (out);
free (cmd);
} else eprintf ("Error setting up system environment\n");
} //else eprintf ("Error setting up system environment\n");
}
break;
case '\0':

View file

@ -868,7 +868,8 @@ extern RAnalPlugin r_anal_plugin_csr;
extern RAnalPlugin r_anal_plugin_avr;
extern RAnalPlugin r_anal_plugin_arm;
extern RAnalPlugin r_anal_plugin_x86;
extern RAnalPlugin r_anal_plugin_x86_udis86;
extern RAnalPlugin r_anal_plugin_x86_im;
extern RAnalPlugin r_anal_plugin_x86_udis;
extern RAnalPlugin r_anal_plugin_x86_simple;
extern RAnalPlugin r_anal_plugin_ppc;
extern RAnalPlugin r_anal_plugin_java;

View file

@ -182,38 +182,29 @@ R_API int r_io_read(RIO *io, ut8 *buf, int len) {
// XXX: this is buggy. must use seek+read
#define USE_CACHE 1
R_API int r_io_read_at(RIO *io, ut64 addr, ut8 *buf, int len) {
int ret, l, olen = len;
int w = 0;
ut64 paddr, last, last2;
int ms, ret, l, olen = len, w = 0;
io->off = addr; // HACK
//r_io_seek (io, addr, R_IO_SEEK_SET);
// XXX: this is buggy!
memset (buf, 0xff, len);
io->off = addr;
memset (buf, 0xff, len); // probably unnecessary
if (io->buffer_enabled)
return r_io_buffer_read (io, addr, buf, len);
while (len>0) {
int ms;
ut64 last = r_io_section_next (io, addr+w);
ut64 last2 = r_io_map_next (io, addr+w); // XXX: must use physical address
last = r_io_section_next (io, addr+w);
last2 = r_io_map_next (io, addr+w); // XXX: must use physical address
if (last == (addr+w)) last = last2;
//else if (last2<last) last = last2;
l = (len > (last-addr+w))? (last-addr+w): len;
if (l<1) l = len;
{
ut64 paddr = w? r_io_section_vaddr_to_offset (io, addr+w): addr;
st64 q = last-addr+w;
//if (q>0) l = q;
if (len>0 && l>len) l = len;
addr = paddr-w;
//eprintf ("next read is %llx %llx\n", addr, last);
//eprintf ("-_________----______ w = %d\n", w);
//eprintf ("//-------------------------// ADDR %llx len = %d\n", addr+w, l);
if (r_io_seek (io, paddr, R_IO_SEEK_SET)==UT64_MAX) {
memset (buf+w, 0xff, l);
// return -1;
{
paddr = w? r_io_section_vaddr_to_offset (io, addr+w): addr;
if (len>0 && l>len) l = len;
addr = paddr-w;
if (r_io_seek (io, paddr, R_IO_SEEK_SET)==UT64_MAX) {
memset (buf+w, 0xff, l);
}
}
}
#if 0
if (io->zeromap)
if (!r_io_map_get (io, addr+w)) {

View file

@ -28,8 +28,8 @@ asm.z80
asm.i8080
asm.msil
anal.sh
anal.x86
anal.x86_udis86
anal.x86_im
anal.x86_udis
anal.x86_simple
anal.z80
anal.i8080