ragg2-cc(1) CC frontend for compiling shellcodes


ragg2-cc [-a arch ] [-b bits ] [-k kernel ] [-o file ] [-dscxvh ]


ragg2-cc is a frontend of CC. It is used to creates tiny binaries (1KB) or shellcodes in binary or hexpairs from a C source.

The compiler used is the one configured by the CC environment. This has been tested with gcc, llvm-gcc and clang.

Uses sflib (shellforge4) includes to get the syscall definitions.

Only linux/darwin x86-32/64 is supported at the moment. Planned support for more architectures.


-a arch
set architecture x86, arm
-b bits
32 or 64
-k kernel
windows, linux or osx
-o file
output file to write result of compilation
show help message
show version
show assembler code
generate assembly file
generate compiled shellcode
show hexpair bytes


  $ cat hi.c
  int main() {
    write (1, "Hello World\n", 12);
    exit (0);

  $ ragg2-cc hi.c

  # Linked into a tiny binary. This is 294 bytes
  $ wc -c < hi.c.bin

  $ ./hi.c.bin
  Hello World

  # The compiled shellcode has zeroes
  $ ragg2-cc -x hi.c

  # Use a xor encoder with key 32 to bypass
  $ ragg2 -e xor -c key=32 -B `ragg2-cc -x hi.c`


pancake <[email protected]>