Fix visual regression and add dummy dalvik regprofile

This commit is contained in:
pancake 2015-04-11 04:45:09 +02:00
parent 6ab06a15ba
commit b4bbb2220c
3 changed files with 22 additions and 2 deletions

View File

@ -352,9 +352,29 @@ static int dalvik_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int l
return sz;
}
static int set_reg_profile(RAnal *anal) {
const char *p =
"=pc ip\n"
"=sp sp\n"
"=bp bp\n"
"=a0 v0\n"
"=a1 v1\n"
"=a2 v2\n"
"=a3 v3\n"
"gpr v0 .32 0 0\n"
"gpr v1 .32 4 0\n"
"gpr v2 .32 8 0\n"
"gpr v3 .32 12 0\n"
"gpr ip .32 40 0\n"
"gpr sp .32 44 0\n"
;
return r_reg_set_profile_string (anal->reg, p);
}
struct r_anal_plugin_t r_anal_plugin_dalvik = {
.name = "dalvik",
.arch = R_SYS_ARCH_DALVIK,
.set_reg_profile = &set_reg_profile,
.license = "LGPL3",
.bits = 32,
.desc = "Dalvik (Android VM) bytecode analysis plugin",

View File

@ -1709,7 +1709,7 @@ R_API int r_core_visual(RCore *core, const char *input) {
if (color) flags |= R_PRINT_FLAGS_COLOR;
debug = r_config_get_i (core->config, "cfg.debug");
flags = R_PRINT_FLAGS_ADDRMOD | R_PRINT_FLAGS_HEADER;
r_print_set_flags (core->print, flags);
r_print_set_flags (core->print, core->print->flags);
scrseek = r_num_math (core->num,
r_config_get (core->config, "scr.seek"));
if (scrseek != 0LL)

View File

@ -13,7 +13,7 @@ R_API int r_io_map_count (RIO *io) {
R_API RIOMap * r_io_map_new(RIO *io, int fd, int flags, ut64 delta, ut64 addr, ut64 size) {
RIOMap *map = R_NEW (RIOMap);
if (!map || ((0xffffffffffffffff - size) < addr)) { //prevent interger-overflow
if (!map || ((UT64_MAX - size) < addr)) { //prevent interger-overflow
free (map);
return NULL;
}