RARC2(1)

NAME
rarc2 - radare2 relocatable compiler

SYNOPSIS
rarc2 [-A] [-l] [-s] [-a[arch]] [< source] [> assembly]
rarc2-tool [-b] [-x] [-c] [-S] [file]

DESCRIPTION
This command is part of the radare project.

This compiler parses a syntax-free language similar to C and generates assembly code for various architectures.

The benefit of using rarc2 instead of any other language is that the generated assembly code is designed to be minimal, position independent and easily injectable into processes or binaries.

OPTIONS for rarc2

-a[arch]
    Specify architecture to generate code for (x86, x64, arm)

-l  List all supported architectures

-s  Use AT&T syntax for assembly instead of the intel one

OPTIONS for rarc2-tool

-b  Dump bytes of compiled code

-x  Execute code instead

-c  Link with libc

-S  Generate .S assembly file instead of executable

USAGE

Using rarc2: $ echo 'main@global(,64){printf("hello world\n");}' | rarc2 -s > hello.S $ gcc hello.S $ ./a.out hello world

Using rarc2-tool: $ cat test.r main@global(,64){ printf("hello world\n"); } $ rarc2-tool -x test.r hello world

SEE ALSO

radare2(1), rahash2(1), rafind2(1), ranal2(1), rabin2(1), radiff2(1), rasm2(1), rasc2(1), rax2(1),

AUTHORS

pancake <pancake@nopcode.org>, nibble <nibble@develsec.org>