- unstable 5.5.0+dfsg-1
|RAGG2(1)||General Commands Manual||RAGG2(1)|
ragg2 — radare2
frontend for r_egg, compile programs into tiny binaries for x86-32/64 and
ragg2 is a frontend for r_egg, compile programs into tiny binaries for x86-32/64 and arm.
This tool is experimental and it is a rewrite of the old rarc2 and rarc2-tool programs as a library and integrated with r_asm and r_bin.
Programs generated by r_egg are relocatable and can be injected in a running process or on-disk binary file.
ragg2-cc is another tool that comes with r2 and it is used to generate shellcodes from C code. The final code can be linked with rabin2 and it is relocatable, so it can be used to inject it on any remote process.
ragg2-cc is conceptually based on shellforge4, but only linux/osx x86-32/64 platforms are supported.
The rr2 (ragg2) configuration file accepts the following directives, described as key=value entries and comments defined as lines starting with '#'.
- set architecture x86, arm
- 32 or 64
- windows, linux or osx
- select binary format (pe, elf, mach0)
- output file to write result of compilation
- specify shellcode name to be used (see -L)
- specify encoder name to be used (see -L)
- specify shellcode as hexpairs
- set configure option for the shellcode encoder. The argument must be key=value.
- include contents of file
- Patch final buffer with given dword at specified offset
- Patch final buffer with given qword at specified offset
- Patch final buffer with given hexpairs at specified offset
- Append a 32bit number in little endian
- Append a 64bit number in little endian
- Specify generic paddings with a format string.
- Prepend debruijn sequence of given length.
- Output offset of debruijn sequence fragment.
- autodetect native file format (osx=mach0, linux=elf, ..)
- use default output file (filename without extension or a.out)
- add include path
- show assembler code
- show raw bytes instead of hexpairs
- execute (just-in-time)
- output in C string syntax
$ cat hi.r
/* hello world in r_egg */
write@syscall(4); //x64 write@syscall(1);
exit@syscall(1); //x64 exit@syscall(60);
.var0 = "hi!\n";
$ ragg2 -O -F hi.r
$ cat hi.c
write(1, "Hello0, 6);
$ ragg2 hi.c
Written by pancake <email@example.com>.
|September 30, 2014|