File: lang-plugins

package info (click to toggle)
radare2 6.0.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 77,536 kB
  • sloc: ansic: 889,435; sh: 8,299; javascript: 7,675; makefile: 5,194; python: 1,929; cpp: 789; perl: 438; lisp: 122; sed: 85; asm: 57; cs: 37; xml: 32; ruby: 29; java: 21
file content (34 lines) | stat: -rw-r--r-- 1,011 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
There is a way to implement dynamic language plugins for radare...

A stub generator will be appreciated to create all the necessary
boilerplate to write a single .c file calling the perl/python/ruby
interface from each method hook.

We should define a common and simple way to design those inter-
language communications.

With this interface properly defined we can get some more fun and
write the language bindings using the same lang-C api.

A simple perl script can be used to parse function signatures and
enums to fill the structures in the proper way (SWIG replacement)

help is welcome!

------------------8<------------------------------

some random food:

#include <r_lang_lib.h>

static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len)
{
	LANG_PERL_SET_U8P("$buf", buf);
	LANG_PERL_SET_U64("$len", len);
	LANG_PERL(
	"print \"Hello World $len\";
	$ret = 1;")
	return LANG_PERL_GET($ret);
}

PLUGIN_ASM("asm_ppc", "PPC disassembly plugin", NULL, NULL, &disasm, NULL);