Ragg2

Description

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.

Usage

Syntax

ragg2 [-FOLsrxvh] [-a arch] [-b bits] [-k os] [-o file] [-I /] [-i sc]  [-e enc] [-B hex] [-c k=v] [-C file] [-dDw v] [-p pad] file|f.asm|-

Options

 -a [arch]       select architecture (x86, mips, arm)
 -b [bits]       register size (32, 64, ..)
 -k [os]         operating system's kernel (linux,bsd,osx,w32)
 -f [format]     output format (raw, pe, elf, mach0)
 -F              output native format (osx=mach0, linux=elf, ..)
 -o [file]       output file
 -O              use default output file (filename without extension or a.out)
 -I [path]       add include path
 -L              list all plugins (shellcodes and encoders)
 -i [shellcode]  include shellcode plugin, uses options. see -L
 -e [encoder]    use specific encoder. see -L
 -B [hexpairs]   append some hexpair bytes
 -c [k=v]        set configuration options
 -C [file]       append contents of file
 -d [off:dword]  patch dword (4 bytes) at given offset
 -D [off:qword]  patch qword (8 bytes) at given offset
 -w [off:hex]    patch hexpairs at given offset
 -p [padding]    add padding after compilation (padding=n10s32)
                 ntas : begin nop, trap, 'a', sequence
                 NTAS : same as above, but at the end
 -P [size]       prepend debrujn pattern
 -s              show assembler
 -r              show raw bytes instead of hexpairs
 -x              execute
 -v              show version

Example

cyborg@cyborg:~$ cat hi.r
 /* hello world in r_egg */ 
write@syscall(4); 
exit@syscall(1); 
main@global(128) { .var0 = "hi!0; write(1,.var0, 4); exit(0); } 
cyborg@cyborg:~$ ragg2 -O -F hi.r 
cyborg@cyborg:~$$ ./hi
hi!
0 Comments

Leave a reply

CONTACT US

We're are building as a community and a team. Be a part of it.

Sending

©2017 Ztrela Knowledge Solutions Pvt. Ltd

Log in with your credentials

Forgot your details?