static RBinInfo* info(RBinArch *arch) { const char *archstr; RBinInfo *ret = NULL; int big_endian = 0; int bits = 32; int bina; if (!(bina = r_bin_p9_get_arch (arch->buf->buf, &bits, &big_endian))) return NULL; if ((ret = R_NEW0 (RBinInfo)) == NULL) return NULL; strncpy (ret->file, arch->file, R_BIN_SIZEOF_STRINGS); strncpy (ret->rpath, "NONE", R_BIN_SIZEOF_STRINGS); strncpy (ret->bclass, "program", R_BIN_SIZEOF_STRINGS); strncpy (ret->rclass, "p9", R_BIN_SIZEOF_STRINGS); strncpy (ret->os, "plan9", R_BIN_SIZEOF_STRINGS); archstr = r_sys_arch_str (bina); strncpy (ret->arch, archstr, R_BIN_SIZEOF_STRINGS); strncpy (ret->machine, archstr, R_BIN_SIZEOF_STRINGS); strncpy (ret->subsystem, "plan9", R_BIN_SIZEOF_STRINGS); strncpy (ret->type, "EXEC (Executable file)", R_BIN_SIZEOF_STRINGS); ret->bits = bits; ret->has_va = R_TRUE; ret->big_endian = big_endian; ret->dbg_info = 0; ret->dbg_info = 0; return ret; }
static char *__esil_reg_profile(RDebug *dbg) { eprintf ("TODO: esil %s\n", r_sys_arch_str (dbg->arch)); if (dbg->arch == R_SYS_ARCH_BF) { return strdup ( "=pc pc\n" "=sp esp\n" "=bp ptr\n" "gpr rax .32 0 0\n" "gpr pc .32 0 0\n" "gpr ptr .32 4 0\n" "gpr esp .32 8 0\n" "gpr scr .32 12 0\n" "gpr scri .32 16 0\n" "gpr inp .32 20 0\n" "gpr inpi .32 24 0\n" "gpr mem .32 28 0\n" "gpr memi .32 32 0\n" ); } else if (dbg->arch == R_SYS_ARCH_X86) { eprintf ("[DEBUGESIL] Missing regprofile for x86\n"); return NULL; } else { return NULL; } }
static RBinInfo* info(RBinFile *arch) { RBinInfo *ret = NULL; int bits=32, bina, big_endian = 0; if (!(bina = r_bin_p9_get_arch (arch->buf->buf, &bits, &big_endian))) return NULL; if ((ret = R_NEW0 (RBinInfo)) == NULL) return NULL; ret->file = strdup (arch->file); ret->bclass = strdup ("program"); ret->rclass = strdup ("p9"); ret->os = strdup ("Plan9"); ret->arch = strdup (r_sys_arch_str (bina)); ret->machine = strdup (ret->arch); ret->subsystem = strdup ("plan9"); ret->type = strdup ("EXEC (executable file)"); ret->bits = bits; ret->has_va = R_TRUE; ret->big_endian = big_endian; ret->dbg_info = 0; ret->dbg_info = 0; return ret; }