* Add flag -M to rabin2 at radare2 startup and cg
* Add r_asm_mdisassemble_hexstr * Update r_asm.vapi
This commit is contained in:
parent
2f43431e80
commit
fcc6b8d013
|
@ -170,7 +170,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
// Load the binary information from rabin2
|
||||
{
|
||||
char *cmd = r_str_dup_printf (".!rabin2 -rSIeis%s %s",
|
||||
char *cmd = r_str_dup_printf (".!rabin2 -rSIeMis%s %s",
|
||||
(debug||r.io->va)?"v":"", r.file->filename);
|
||||
r_core_cmd (&r, cmd, 0);
|
||||
r_str_free (cmd);
|
||||
|
|
|
@ -237,6 +237,19 @@ R_API RAsmCode* r_asm_mdisassemble(RAsm *a, ut8 *buf, ut64 len) {
|
|||
return acode;
|
||||
}
|
||||
|
||||
R_API RAsmCode* r_asm_mdisassemble_hexstr(RAsm *a, const char *hexstr) {
|
||||
RAsmCode *ret;
|
||||
ut8 *buf;
|
||||
int len;
|
||||
|
||||
if (!(buf = malloc (strlen (hexstr))))
|
||||
return NULL;
|
||||
len = r_hex_str2bin (hexstr, buf);
|
||||
ret = r_asm_mdisassemble (a, buf, len);
|
||||
free (buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
R_API RAsmCode* r_asm_massemble(RAsm *a, const char *buf) {
|
||||
char *lbuf = NULL, *ptr2, *ptr = NULL, *ptr_start = NULL,
|
||||
*tokens[R_ASM_BUFSIZE], buf_token[R_ASM_BUFSIZE];
|
||||
|
|
|
@ -209,12 +209,13 @@ R_API int r_core_gdiff(RCore *core, char *file1, char *file2, int va) {
|
|||
return R_FALSE;
|
||||
}
|
||||
r_config_set_i (core2->config, "io.va", va);
|
||||
sprintf (cmd, ".!rabin2 -rSIeis%s %s", va?"v":"", files[i]);
|
||||
sprintf (cmd, ".!rabin2 -rSIeMis%s %s", va?"v":"", files[i]);
|
||||
r_core_cmd0 (core2, cmd);
|
||||
/* XXX Select correct analysis plugin */
|
||||
r_core_cmd0 (core2, "ah x86_x86im");
|
||||
r_core_cmd0 (core2, "fs *");
|
||||
r_core_cmd0 (core2, "af @ entry0");
|
||||
r_core_cmd0 (core2, "af @ main");
|
||||
r_core_cmd0 (core2, "af @@ fcn.");
|
||||
r_core_cmd0 (core2, "ab @@ fcn.");
|
||||
/* Copy bb's and fcn's */
|
||||
|
|
|
@ -112,6 +112,7 @@ R_API int r_asm_set_pc(RAsm *a, ut64 pc);
|
|||
R_API int r_asm_disassemble(RAsm *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len);
|
||||
R_API int r_asm_assemble(RAsm *a, struct r_asm_aop_t *aop, const char *buf);
|
||||
R_API struct r_asm_code_t* r_asm_mdisassemble(RAsm *a, ut8 *buf, ut64 len);
|
||||
R_API RAsmCode* r_asm_mdisassemble_hexstr(RAsm *a, const char *hexstr);
|
||||
R_API struct r_asm_code_t* r_asm_massemble(RAsm *a, const char *buf);
|
||||
|
||||
/* code.c */
|
||||
|
|
|
@ -77,6 +77,7 @@ public class RAsm {
|
|||
public int disassemble(out Aop aop, uint8 *buf, uint64 length);
|
||||
public int assemble(out Aop aop, string buf);
|
||||
public Code? mdisassemble(uint8 *buf, uint64 length);
|
||||
public Code? mdisassemble_hexstr(string hexstr);
|
||||
public Code? massemble(string buf);
|
||||
public unowned string fastcall(int idx, int num);
|
||||
|
||||
|
|
Loading…
Reference in New Issue