One more standard prelude for x86-32/64

This commit is contained in:
Dima Turchenkov 2015-11-13 14:54:53 +03:00 committed by pancake
parent 97edd9a452
commit e38e5dd5c2

View File

@ -202,7 +202,6 @@ R_API int r_core_search_prelude(RCore *core, ut64 from, ut64 to, const ut8 *buf,
break;
}
}
eprintf ("Analized %d functions based on preludes\n", preludecnt);
free (b);
return preludecnt;
}
@ -235,17 +234,22 @@ R_API int r_core_search_preludes(RCore *core) {
} else if (strstr (arch, "x86")) {
switch (bits) {
case 32:
ret = r_core_search_prelude (core, from, to,
(const ut8 *)"\x55\x89\xe5", 3, NULL, 0);
r_core_search_prelude (core, from, to,
(const ut8 *)"\x55\x89\xe5", 3, NULL, 0) +
r_core_search_prelude (core, from, to,
(const ut8 *)"\x55\x8b\xec", 3, NULL, 0);
break;
case 64:
ret = r_core_search_prelude (core, from, to,
(const ut8 *)"\x55\x48\x89\xe5", 3, NULL, 0);
r_core_search_prelude (core, from, to,
(const ut8 *)"\x55\x48\x89\xe5", 4, NULL, 0);
r_core_search_prelude (core, from, to,
(const ut8 *)"\x55\x48\x8b\xec", 4, NULL, 0);
break;
default:
eprintf ("ap: Unsupported bits: %d\n", bits);
}
} else eprintf ("ap: Unsupported asm.arch and asm.bits\n");
eprintf ("Analyzed %d functions based on preludes\n", ret);
return ret;
}