- Many fixes in r_core, r_lib, r_cmd and r_anal - Needs patched vala head with #618933 https://bugzilla.gnome.org/show_bug.cgi?id=618933 * Fix RCmd plugin handlers user data pointer
35 lines
904 B
Vala
35 lines
904 B
Vala
/* vala r2 plugin */
|
|
using Radare;
|
|
|
|
[CCode (has_target = false)]
|
|
private bool mycall(void *user, string cmd) {
|
|
if (cmd.has_prefix (":bc")) {
|
|
if (cmd.len () == 3) {
|
|
print ( "BinCrowd radare2 plugin help:\n"+
|
|
":bc pull retrieve signatures from server\n"+
|
|
":bc push upload signatures to server\n"+
|
|
"See: http://bincrowd.zynamics.com/\n");
|
|
} else {
|
|
RCore* core = (RCore*)user;
|
|
string p = (string)(((char*)cmd)+4);
|
|
print ("Hello World from Vala! (%s)\n", p);
|
|
//core->cmd ("pd 4 @ eip", false);
|
|
//core->cmd ("x", false);
|
|
/* hack to get address of anal .. FIXME */
|
|
RAnal *anal = (RAnal*)(&core->anal);
|
|
foreach (var f in anal->fcns) {
|
|
print ("fun %s @ 0x%08llx\n", f.name, f.addr);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private const RCmdHandle plugin = {
|
|
"my plugin", mycall
|
|
};
|
|
|
|
const RCmdStruct radare_plugin = {
|
|
RLibType.CMD, ref plugin
|
|
};
|