From affbba8aa23afcf5d1b3453d0bf28968723af239 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 28 Jun 2010 20:30:20 +0200 Subject: [PATCH] * Rename r2rc to rarc2 - Moved into binr/rarc2 - Integrated with symstall - rarc2-tool now support -xc and -cx combo - Add rarc2.1 manpage * Add some bugs to review in TODO --HG-- rename : r2rc/Makefile => binr/rarc2/Makefile rename : r2rc/README => binr/rarc2/README rename : r2rc/TODO => binr/rarc2/TODO rename : r2rc/emit_arm.c => binr/rarc2/emit_arm.c rename : r2rc/emit_x64.c => binr/rarc2/emit_x64.c rename : r2rc/emit_x86.c => binr/rarc2/emit_x86.c rename : r2rc/i/libc.r => binr/rarc2/i/libc.r rename : r2rc/i/socket.r => binr/rarc2/i/socket.r rename : r2rc/out.c => binr/rarc2/out.c rename : r2rc/r2rc-tool => binr/rarc2/rarc2-tool rename : r2rc/r2rc.c => binr/rarc2/rarc2.c rename : r2rc/rcc.h => binr/rarc2/rarc2.h rename : r2rc/t/Makefile => binr/rarc2/t/Makefile rename : r2rc/t/argv.r => binr/rarc2/t/argv.r rename : r2rc/t/bytedump.r => binr/rarc2/t/bytedump.r rename : r2rc/t/data.r => binr/rarc2/t/data.r rename : r2rc/t/dump.r => binr/rarc2/t/dump.r rename : r2rc/t/hello.r => binr/rarc2/t/hello.r rename : r2rc/t/if.r => binr/rarc2/t/if.r rename : r2rc/t/inline.r => binr/rarc2/t/inline.r rename : r2rc/t/input.r => binr/rarc2/t/input.r rename : r2rc/t/loop.r => binr/rarc2/t/loop.r rename : r2rc/t/ptr.r => binr/rarc2/t/ptr.r rename : r2rc/t/rawsys.r => binr/rarc2/t/rawsys.r rename : r2rc/t/rawsys64.r => binr/rarc2/t/rawsys64.r rename : r2rc/t/regs.r => binr/rarc2/t/regs.r rename : r2rc/t/ret.r => binr/rarc2/t/ret.r rename : r2rc/t/room.r => binr/rarc2/t/room.r rename : r2rc/t/segfault.r => binr/rarc2/t/segfault.r rename : r2rc/t/shell.r => binr/rarc2/t/shell.r rename : r2rc/t/sub.r => binr/rarc2/t/sub.r rename : r2rc/t/syscall.r => binr/rarc2/t/syscall.r rename : r2rc/test.r => binr/rarc2/test.r --- Makefile | 12 +----- TODO | 21 ++++++++- binr/Makefile | 7 ++- binr/rarc2/Makefile | 44 +++++++++++++++++++ {r2rc => binr/rarc2}/README | 0 {r2rc => binr/rarc2}/TODO | 1 + binr/rarc2/config.def.h | 1 + {r2rc => binr/rarc2}/emit_arm.c | 2 +- {r2rc => binr/rarc2}/emit_x64.c | 0 {r2rc => binr/rarc2}/emit_x86.c | 2 +- {r2rc => binr/rarc2}/i/libc.r | 0 {r2rc => binr/rarc2}/i/socket.r | 0 {r2rc => binr/rarc2}/out.c | 0 r2rc/r2rc-tool => binr/rarc2/rarc2-tool | 22 ++++++---- r2rc/r2rc.c => binr/rarc2/rarc2.c | 2 +- r2rc/rcc.h => binr/rarc2/rarc2.h | 2 +- {r2rc => binr/rarc2}/t/Makefile | 0 {r2rc => binr/rarc2}/t/argv.r | 0 {r2rc => binr/rarc2}/t/bytedump.r | 0 {r2rc => binr/rarc2}/t/data.r | 0 {r2rc => binr/rarc2}/t/dump.r | 0 {r2rc => binr/rarc2}/t/hello.r | 0 {r2rc => binr/rarc2}/t/if.r | 0 {r2rc => binr/rarc2}/t/inline.r | 0 {r2rc => binr/rarc2}/t/input.r | 0 {r2rc => binr/rarc2}/t/loop.r | 0 {r2rc => binr/rarc2}/t/ptr.r | 0 {r2rc => binr/rarc2}/t/rawsys.r | 0 {r2rc => binr/rarc2}/t/rawsys64.r | 0 {r2rc => binr/rarc2}/t/regs.r | 0 {r2rc => binr/rarc2}/t/ret.r | 0 {r2rc => binr/rarc2}/t/room.r | 0 {r2rc => binr/rarc2}/t/segfault.r | 0 {r2rc => binr/rarc2}/t/shell.r | 0 {r2rc => binr/rarc2}/t/sub.r | 0 {r2rc => binr/rarc2}/t/syscall.r | 0 {r2rc => binr/rarc2}/test.r | 0 man/rabin2.1 | 1 + man/radare2.1 | 1 + man/radiff2.1 | 1 + man/rafind2.1 | 1 + man/rahash2.1 | 2 + man/rarc2.1 | 57 +++++++++++++++++++++++++ man/rasm2.1 | 1 + man/rax2.1 | 1 + r2rc/Makefile | 39 ----------------- 46 files changed, 156 insertions(+), 64 deletions(-) create mode 100644 binr/rarc2/Makefile rename {r2rc => binr/rarc2}/README (100%) rename {r2rc => binr/rarc2}/TODO (72%) create mode 100644 binr/rarc2/config.def.h rename {r2rc => binr/rarc2}/emit_arm.c (99%) rename {r2rc => binr/rarc2}/emit_x64.c (100%) rename {r2rc => binr/rarc2}/emit_x86.c (99%) rename {r2rc => binr/rarc2}/i/libc.r (100%) rename {r2rc => binr/rarc2}/i/socket.r (100%) rename {r2rc => binr/rarc2}/out.c (100%) rename r2rc/r2rc-tool => binr/rarc2/rarc2-tool (60%) rename r2rc/r2rc.c => binr/rarc2/rarc2.c (99%) rename r2rc/rcc.h => binr/rarc2/rarc2.h (98%) rename {r2rc => binr/rarc2}/t/Makefile (100%) rename {r2rc => binr/rarc2}/t/argv.r (100%) rename {r2rc => binr/rarc2}/t/bytedump.r (100%) rename {r2rc => binr/rarc2}/t/data.r (100%) rename {r2rc => binr/rarc2}/t/dump.r (100%) rename {r2rc => binr/rarc2}/t/hello.r (100%) rename {r2rc => binr/rarc2}/t/if.r (100%) rename {r2rc => binr/rarc2}/t/inline.r (100%) rename {r2rc => binr/rarc2}/t/input.r (100%) rename {r2rc => binr/rarc2}/t/loop.r (100%) rename {r2rc => binr/rarc2}/t/ptr.r (100%) rename {r2rc => binr/rarc2}/t/rawsys.r (100%) rename {r2rc => binr/rarc2}/t/rawsys64.r (100%) rename {r2rc => binr/rarc2}/t/regs.r (100%) rename {r2rc => binr/rarc2}/t/ret.r (100%) rename {r2rc => binr/rarc2}/t/room.r (100%) rename {r2rc => binr/rarc2}/t/segfault.r (100%) rename {r2rc => binr/rarc2}/t/shell.r (100%) rename {r2rc => binr/rarc2}/t/sub.r (100%) rename {r2rc => binr/rarc2}/t/syscall.r (100%) rename {r2rc => binr/rarc2}/test.r (100%) create mode 100644 man/rarc2.1 delete mode 100644 r2rc/Makefile diff --git a/Makefile b/Makefile index 2287b128ef..37cdb5443d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ include config-user.mk include global.mk -all: plugins.cfg libr binr r2rc +all: plugins.cfg libr binr plugins.cfg: ./configure-plugins @@ -12,9 +12,6 @@ libr: binr: cd binr && ${MAKE} all -r2rc: - cd r2rc && ${MAKE} all - w32dist: rm -rf radare2-w32-${VERSION} w32dist mkdir w32dist @@ -26,12 +23,10 @@ w32dist: clean: cd libr && ${MAKE} clean cd binr && ${MAKE} clean - cd r2rc && ${MAKE} clean mrproper: cd libr && ${MAKE} mrproper cd binr && ${MAKE} mrproper - cd r2rc && ${MAKE} mrproper rm -f config-user.mk plugins.cfg libr/config.h libr/include/r_userconf.h libr/config.mk rm -f pkgcfg/*.pc @@ -53,12 +48,10 @@ install: install-man for a in doc/* ; do ${INSTALL_DATA} $$a ${DESTDIR}/${PREFIX}/share/doc/radare2 ; done cd libr && ${MAKE} install PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} cd binr && ${MAKE} install PREFIX=${PREFIX} DESTDIR=${DESTDIR} - cd r2rc && ${MAKE} install PREFIX=${PREFIX} DESTDIR=${DESTDIR} symstall install-symlink: install-man-symlink cd libr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR} cd binr && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR} - cd r2rc && ${MAKE} install-symlink PREFIX=${PREFIX} DESTDIR=${DESTDIR} uninstall: rm -rf prefix @@ -66,7 +59,6 @@ uninstall: deinstall: uninstall cd libr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} cd binr && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} - cd r2rc && ${MAKE} uninstall PARENT=1 PREFIX=${PREFIX} DESTDIR=${DESTDIR} swig-dist: cd swig && ${MAKE} dist @@ -90,4 +82,4 @@ shot: include ${MKPLUGINS} -.PHONY: all clean mrproper install symstall uninstall deinstall dist shot pkgcfg swig libr binr r2rc install-man +.PHONY: all clean mrproper install symstall uninstall deinstall dist shot pkgcfg swig libr binr install-man diff --git a/TODO b/TODO index f6ea5582a1..acc103914a 100644 --- a/TODO +++ b/TODO @@ -14,10 +14,20 @@ Questions: * imports from PE doesnt works with /a because there's an indirect call * rabin2 doesnt works for osx-x86 mach0 bins..so io.va=1 fails +Bugs: +----- +* if we use objcopy --stripsymbols on a library..the stripped symbols are not + listed by nm or rabin..but objcopy is able to see them O_O +* anal bug: (fixed??) +[0x08048eec]> pd 2 + 0x08048eec 0 c20400 ret 0x4 + -> this opcodes increments the stack 8 bytes (4+4) . it is not handled correctly + + TODO: ----- +* rarc2 : choose syntax in runtime * Store version information in libraries ? debian claims for it -* Write manpages for r2rc, r2rc-tool .. find better name rarc2? * nibble: trace counts after step..thats not correct! * implement grep{col,row} * pancake: dietline.c : do not show all options at first tab if matches @@ -53,6 +63,7 @@ TODO: 0.6 === * rasign2 : must be done, write manpage +* distribute 'spp' with 'rarc2' ? Transaction notes ================= @@ -131,3 +142,11 @@ Future - load the program using r_bin in virtual space - initialize vm and set regs - debug backend should use the vm + +.------------------------. +| ___ ___ ____ | +| | - ) _ _ | _ |/ _/ | please! +| | - \| | |\_ |\_ \ |___. report! :) +| |___/'___'|___'|___/ ___/ +| | +`------------------------' diff --git a/binr/Makefile b/binr/Makefile index 1c13101160..604081b020 100644 --- a/binr/Makefile +++ b/binr/Makefile @@ -4,7 +4,7 @@ include ../config-user.mk PFX=${DESTDIR}${PREFIX} -BINS=rax2 rasm2 rabin2 rahash2 radiff2 radare2 rafind2 +BINS=rax2 rasm2 rabin2 rahash2 radiff2 radare2 rafind2 rarc2 all: @for a in ${BINS} ; do (cd $$a && ${MAKE} all); done @@ -12,16 +12,21 @@ all: install: mkdir -p ${PFX}/bin for a in ${BINS} ; do ${INSTALL_PROGRAM} $$a/$$a ${PFX}/bin ; done + # rarc2 + cp rarc2/rarc2 ${PFX}/bin + cp rarc2/rarc2-tool ${PFX}/bin # shortcut -cd ${PFX}/bin && rm -f r2 ; ln -fs radare2 r2 install-symlink: mkdir -p ${PFX}/bin for a in ${BINS} ; do ln -fs ${PWD}/$$a/$$a ${PFX}/bin/$$a ; done + ln -fs ${PWD}/rarc2/rarc2-tool ${PFX}/bin/rarc2-tool -ln -fs ${PFX}/bin/radare2 ${PFX}/bin/r2 deinstall uninstall: for a in ${BINS} ; do rm -f ${PFX}/bin/$$a ; done + rm -f ${PFX}/bin/rarc2-tool -rm -f ${PFX}/bin/r2 clean mrproper: diff --git a/binr/rarc2/Makefile b/binr/rarc2/Makefile new file mode 100644 index 0000000000..9dfa110b65 --- /dev/null +++ b/binr/rarc2/Makefile @@ -0,0 +1,44 @@ +include ../../config-user.mk + +CFLAGS+=-g -Wall +PFX=${DESTDIR}${PREFIX} + +OBJS=rarc2.o emit_x86.o emit_x64.o emit_arm.o out.o + +all: config.h rarc2${EXT_EXE} + +config.h: + cp -f config.def.h config.h + +rarc2${EXT_EXE}: ${OBJS} + ${CC} ${LDFLAGS} -I. ${OBJS} -o rarc2${EXT_EXE} + +test: + # only works with att mode + ./rarc2 t/hello.r > t/hello.S + gcc t/hello.S -o t/hello +# cat t/hello.S + t/hello + #spp test.r | ./rarc2 + #./rarc2 test.r + +install: + chmod +x rarc2 + mkdir -p ${PFX}/bin + cp rarc2 ${PFX}/bin + chmod +x rarc2-tool + cp rarc2-tool ${PFX}/bin + +install-symlink: + mkdir -p ${PFX}/bin + ln -fs ${PWD}/rarc2 ${PFX}/bin/rarc2 + ln -fs ${PWD}/rarc2-tool ${PFX}/bin/rarc2-tool + +deinstall uninstall: + rm -f ${PFX}/bin/rarc2 ${PFX}/bin/rarc2-tool + +clean mrproper: + cd t && ${MAKE} clean + -rm -f rarc2 rarc2.o out.o emit*.o + +.PHONY: all clean install install-symlink deinstall uninstall test mrproper diff --git a/r2rc/README b/binr/rarc2/README similarity index 100% rename from r2rc/README rename to binr/rarc2/README diff --git a/r2rc/TODO b/binr/rarc2/TODO similarity index 72% rename from r2rc/TODO rename to binr/rarc2/TODO index e1d6872e89..5036e6c648 100644 --- a/r2rc/TODO +++ b/binr/rarc2/TODO @@ -1,3 +1,4 @@ +* specify syntax and arch with envvars or args * Add support for rasm2 * Add preprocessing support to compile 32/64 bit specific code.. or OS-dependent * Rename to r_rcc diff --git a/binr/rarc2/config.def.h b/binr/rarc2/config.def.h new file mode 100644 index 0000000000..75cce90500 --- /dev/null +++ b/binr/rarc2/config.def.h @@ -0,0 +1 @@ +#define SYNTAX_ATT 1 diff --git a/r2rc/emit_arm.c b/binr/rarc2/emit_arm.c similarity index 99% rename from r2rc/emit_arm.c rename to binr/rarc2/emit_arm.c index 6fe1df0f59..4e4c7fee60 100644 --- a/r2rc/emit_arm.c +++ b/binr/rarc2/emit_arm.c @@ -1,7 +1,7 @@ /* TODO */ /* pancake // nopcode.org 2010 -- emit module for rcc */ -#include "rcc.h" +#include "rarc2.h" #define EMIT_NAME emit_arm #define R_ARCH "arm" diff --git a/r2rc/emit_x64.c b/binr/rarc2/emit_x64.c similarity index 100% rename from r2rc/emit_x64.c rename to binr/rarc2/emit_x64.c diff --git a/r2rc/emit_x86.c b/binr/rarc2/emit_x86.c similarity index 99% rename from r2rc/emit_x86.c rename to binr/rarc2/emit_x86.c index 3f463910e1..14c147f012 100644 --- a/r2rc/emit_x86.c +++ b/binr/rarc2/emit_x86.c @@ -1,6 +1,6 @@ /* pancake // nopcode.org 2010 -- emit module for rcc */ -#include "rcc.h" +#include "rarc2.h" #ifdef ARCH_X86_64 # define EMIT_NAME emit_x64 diff --git a/r2rc/i/libc.r b/binr/rarc2/i/libc.r similarity index 100% rename from r2rc/i/libc.r rename to binr/rarc2/i/libc.r diff --git a/r2rc/i/socket.r b/binr/rarc2/i/socket.r similarity index 100% rename from r2rc/i/socket.r rename to binr/rarc2/i/socket.r diff --git a/r2rc/out.c b/binr/rarc2/out.c similarity index 100% rename from r2rc/out.c rename to binr/rarc2/out.c diff --git a/r2rc/r2rc-tool b/binr/rarc2/rarc2-tool similarity index 60% rename from r2rc/r2rc-tool rename to binr/rarc2/rarc2-tool index 9b7d0ab14d..b6f838927c 100755 --- a/r2rc/r2rc-tool +++ b/binr/rarc2/rarc2-tool @@ -1,14 +1,14 @@ #!/bin/sh # pancake / nopcode.org -[ -z "${ARCH}" ] && ARCH=`r2rc -a` +[ -z "${ARCH}" ] && ARCH=`rarc2 -a` compile() { spp -h 2>&1 >/dev/null if [ $? = 0 ]; then - spp -Darch=${ARCH} $@ | r2rc -${ARCH} > .a.S || exit $? + spp -Darch=${ARCH} $@ | rarc2 -${ARCH} > .a.S || exit $? else - r2rc -${ARCH} $@ > .a.S || exit $? + rarc2 -${ARCH} $@ > .a.S || exit $? fi } @@ -26,29 +26,33 @@ case "$flg" in "-S") compile $@ ;; +"-cx"|"-xc") + compile $@ + gcc .a.S -o .a.out + [ -e .a.out ] && ./.a.out + rm -f .a.S .a.out + ;; "-c") compile $@ gcc .a.S -o .a.out - if [ -e .a.out ]; then - cp .a.out $1.out - fi + [ -e .a.out ] && cp .a.out $1.out rm -f .a.S .a.out ;; "-x") compile $@ gcc -nostdlib .a.S -o .a.out if [ -e .a.out ]; then - bytes=`rabin -o d/S/.text .a.out` + bytes=`rabin2 -o d/S/.text .a.out` rasc -s $bytes -X fi rm -f .a.S .a.out ;; *) - echo "Usage: r2rc-tool [-flag] [file]" + echo "Usage: rarc2-tool [-flag] [file]" echo " -b dump bytes" echo " -x execute" echo " -c compile against libc" echo " -S only generate .S file" - echo "ARCH: environ to set architecture: x86, x64" + echo "ARCH: environ to set architecture: arm, x86, x64" ;; esac diff --git a/r2rc/r2rc.c b/binr/rarc2/rarc2.c similarity index 99% rename from r2rc/r2rc.c rename to binr/rarc2/rarc2.c index cae89eb7f4..3a441533dd 100644 --- a/r2rc/r2rc.c +++ b/binr/rarc2/rarc2.c @@ -6,7 +6,7 @@ #include #include #include -#include "rcc.h" +#include "rarc2.h" static int parsechar(char c); diff --git a/r2rc/rcc.h b/binr/rarc2/rarc2.h similarity index 98% rename from r2rc/rcc.h rename to binr/rarc2/rarc2.h index 271a0267a5..2eec6aea4e 100644 --- a/r2rc/rcc.h +++ b/binr/rarc2/rarc2.h @@ -6,7 +6,7 @@ #include #include -#define SYNTAX_ATT 0 +#include "config.h" enum { NORMAL = 0, diff --git a/r2rc/t/Makefile b/binr/rarc2/t/Makefile similarity index 100% rename from r2rc/t/Makefile rename to binr/rarc2/t/Makefile diff --git a/r2rc/t/argv.r b/binr/rarc2/t/argv.r similarity index 100% rename from r2rc/t/argv.r rename to binr/rarc2/t/argv.r diff --git a/r2rc/t/bytedump.r b/binr/rarc2/t/bytedump.r similarity index 100% rename from r2rc/t/bytedump.r rename to binr/rarc2/t/bytedump.r diff --git a/r2rc/t/data.r b/binr/rarc2/t/data.r similarity index 100% rename from r2rc/t/data.r rename to binr/rarc2/t/data.r diff --git a/r2rc/t/dump.r b/binr/rarc2/t/dump.r similarity index 100% rename from r2rc/t/dump.r rename to binr/rarc2/t/dump.r diff --git a/r2rc/t/hello.r b/binr/rarc2/t/hello.r similarity index 100% rename from r2rc/t/hello.r rename to binr/rarc2/t/hello.r diff --git a/r2rc/t/if.r b/binr/rarc2/t/if.r similarity index 100% rename from r2rc/t/if.r rename to binr/rarc2/t/if.r diff --git a/r2rc/t/inline.r b/binr/rarc2/t/inline.r similarity index 100% rename from r2rc/t/inline.r rename to binr/rarc2/t/inline.r diff --git a/r2rc/t/input.r b/binr/rarc2/t/input.r similarity index 100% rename from r2rc/t/input.r rename to binr/rarc2/t/input.r diff --git a/r2rc/t/loop.r b/binr/rarc2/t/loop.r similarity index 100% rename from r2rc/t/loop.r rename to binr/rarc2/t/loop.r diff --git a/r2rc/t/ptr.r b/binr/rarc2/t/ptr.r similarity index 100% rename from r2rc/t/ptr.r rename to binr/rarc2/t/ptr.r diff --git a/r2rc/t/rawsys.r b/binr/rarc2/t/rawsys.r similarity index 100% rename from r2rc/t/rawsys.r rename to binr/rarc2/t/rawsys.r diff --git a/r2rc/t/rawsys64.r b/binr/rarc2/t/rawsys64.r similarity index 100% rename from r2rc/t/rawsys64.r rename to binr/rarc2/t/rawsys64.r diff --git a/r2rc/t/regs.r b/binr/rarc2/t/regs.r similarity index 100% rename from r2rc/t/regs.r rename to binr/rarc2/t/regs.r diff --git a/r2rc/t/ret.r b/binr/rarc2/t/ret.r similarity index 100% rename from r2rc/t/ret.r rename to binr/rarc2/t/ret.r diff --git a/r2rc/t/room.r b/binr/rarc2/t/room.r similarity index 100% rename from r2rc/t/room.r rename to binr/rarc2/t/room.r diff --git a/r2rc/t/segfault.r b/binr/rarc2/t/segfault.r similarity index 100% rename from r2rc/t/segfault.r rename to binr/rarc2/t/segfault.r diff --git a/r2rc/t/shell.r b/binr/rarc2/t/shell.r similarity index 100% rename from r2rc/t/shell.r rename to binr/rarc2/t/shell.r diff --git a/r2rc/t/sub.r b/binr/rarc2/t/sub.r similarity index 100% rename from r2rc/t/sub.r rename to binr/rarc2/t/sub.r diff --git a/r2rc/t/syscall.r b/binr/rarc2/t/syscall.r similarity index 100% rename from r2rc/t/syscall.r rename to binr/rarc2/t/syscall.r diff --git a/r2rc/test.r b/binr/rarc2/test.r similarity index 100% rename from r2rc/test.r rename to binr/rarc2/test.r diff --git a/man/rabin2.1 b/man/rabin2.1 index 3b44d6c0e0..a4962d687d 100644 --- a/man/rabin2.1 +++ b/man/rabin2.1 @@ -46,6 +46,7 @@ Show usage help message. .Xr radiff2(1) , .Xr rasm2(1) , .Xr rax2(1) , +.Xr rarc2(1) , .Sh AUTHORS .Pp pancake diff --git a/man/radare2.1 b/man/radare2.1 index 0fadcd927a..648b4683f9 100644 --- a/man/radare2.1 +++ b/man/radare2.1 @@ -62,6 +62,7 @@ path to the current working file .Xr radiff2(1) , .Xr rasm2(1) , .Xr rax2(1) , +.Xr rarc2(1) , .Sh AUTHORS .Pp pancake <@nopcode.org> diff --git a/man/radiff2.1 b/man/radiff2.1 index e58345db97..1980a8402e 100644 --- a/man/radiff2.1 +++ b/man/radiff2.1 @@ -33,6 +33,7 @@ Show usage help message. .Xr rahash2(1) , .Xr rabin2(1) , .Xr rasm2(1) , +.Xr rarc2(1) , .Xr rax2(1) , .Sh AUTHORS .Pp diff --git a/man/rafind2.1 b/man/rafind2.1 index c7fb02cb66..cf335d2689 100644 --- a/man/rafind2.1 +++ b/man/rafind2.1 @@ -45,6 +45,7 @@ Specify the target adddress .Xr rabin2(1) , .Xr radiff2(1) , .Xr rasm2(1) , +.Xr rarc2(1) , .Xr rax2(1) , .Sh AUTHORS .Pp diff --git a/man/rahash2.1 b/man/rahash2.1 index 349d9f146e..313a126b3a 100644 --- a/man/rahash2.1 +++ b/man/rahash2.1 @@ -42,6 +42,8 @@ Show usage help message. .Xr rabin2(1) , .Xr radiff2(1) , .Xr rasm2(1) , +.Xr rarc2(1) , +.Xr rax2(1) , .Sh AUTHORS .Pp pancake diff --git a/man/rarc2.1 b/man/rarc2.1 new file mode 100644 index 0000000000..06ddf01a77 --- /dev/null +++ b/man/rarc2.1 @@ -0,0 +1,57 @@ +.Dd Jun 28, 2010 +.Dt RARC2 1 +.Os +.Sh NAME +.Nm rarc2 +.Nd radare2 relocatable compiler +.Sh SYNOPSIS +.Nm rarc2 +.Op < source +.Op > assembly +.Nm rarc2-tool +.Op -b +.Op -x +.Op -c +.Op -S +.Op file +.Sh DESCRIPTION +This command is part of the radare project. +.Pp +This compiler parses a syntax-free language similar to C and generates assembly code for various architectures. +.Sh OPTIONS +.Bl -tag -width Fl +.It Fl b +Dump bytes of compiled code +.It Fl x +Execute code instead +.It Fl c +Link with libc +.It Fl S +Generate .S assembly file instead of executable +.El +.Sh USAGE +.Pp +Using rarc2: + $ echo 'main(64){printf("hello world\n");}' | rarc2 > hello.S + $ gcc hello.S + $ ./a.out + hello world +.Pp +Using rarc2-tool: + $ cat test.r + main(64){ printf("hello world\n"); } + $ rarc2-tool -x test.r + hello world +.Sh SEE ALSO +.Pp +.Xr radare2(1) , +.Xr rahash2(1) , +.Xr rafind2(1) , +.Xr rabin2(1) , +.Xr radiff2(1) , +.Xr rasm2(1) , +.Xr rax2(1) , +.Sh AUTHORS +.Pp +pancake +.Pp diff --git a/man/rasm2.1 b/man/rasm2.1 index dbaa184b1f..01a4e600bb 100644 --- a/man/rasm2.1 +++ b/man/rasm2.1 @@ -38,6 +38,7 @@ Show usage help message. .Xr rahash2(1) , .Xr rabin2(1) , .Xr radiff2(1) , +.Xr rarc2(1) , .Xr rax2(1) , .Sh AUTHORS .Pp diff --git a/man/rax2.1 b/man/rax2.1 index 7c8efa4709..32e93244b1 100644 --- a/man/rax2.1 +++ b/man/rax2.1 @@ -56,6 +56,7 @@ Available variable types are: .Xr rafind2(1) , .Xr rabin2(1) , .Xr radiff2(1) , +.Xr rarc2(1) , .Xr rasm2(1) , .Sh AUTHORS .Pp diff --git a/r2rc/Makefile b/r2rc/Makefile deleted file mode 100644 index d4a85c6bce..0000000000 --- a/r2rc/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -CFLAGS+=-g -Wall -PREFIX?=/usr -DESTDIR?= -PFX=${DESTDIR}${PREFIX} - -all: r2rc - -r2rc: r2rc.o emit_x86.o emit_x64.o emit_arm.o out.o - gcc -I. out.o r2rc.o emit*.o -o r2rc - -test: - ./rcc t/hello.r > t/hello.S - gcc t/hello.S -o t/hello -# cat t/hello.S - t/hello - #spp test.r | ./rcc - #./rcc test.r - -install: - chmod +x r2rc - mkdir -p ${PFX}/bin - cp r2rc ${PFX}/bin - chmod +x r2rc-tool - cp r2rc-tool ${PFX}/bin - -install-symlink: - mkdir -p ${PFX}/bin - ln -fs ${PWD}/r2rc ${PFX}/bin/r2rc - ln -fs ${PWD}/r2rc-tool ${PFX}/bin/r2rc-tool - -deinstall uninstall: - rm -f ${PFX}/bin/r2rc ${PFX}/bin/r2rc-tool - -clean mrproper: - cd t && ${MAKE} clean - -rm -f r2rc r2rc.o out.o emit*.o - - -.PHONY: all clean install install-symlink deinstall uninstall r2rc test mrproper