mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-21 23:01:03 +00:00
* Move all the r2 programs into binr/
- Little cleanup of the build system
This commit is contained in:
parent
c7b2579c8b
commit
eb05e6a6b2
1
Makefile
1
Makefile
@ -40,6 +40,7 @@ install: install-man
|
||||
${INSTALL_DIR} ${DESTDIR}${PREFIX}/share/doc/radare2
|
||||
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:
|
||||
|
@ -2,7 +2,7 @@ include ../config-user.mk
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
BINS=rabin2
|
||||
BINS=rax2 rasm2 rabin2 rahash2 radiff2 radare2
|
||||
|
||||
all:
|
||||
@for a in ${BINS} ; do (cd $$a && ${MAKE} all); done
|
||||
|
4
binr/radare2/Makefile
Normal file
4
binr/radare2/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
BIN=radare2
|
||||
DEPS=r_core
|
||||
|
||||
include ../binr.mk
|
4
binr/radiff2/Makefile
Normal file
4
binr/radiff2/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
BIN=radiff2
|
||||
DEPS=r_core r_diff r_util
|
||||
|
||||
include ../binr.mk
|
4
binr/rafind2/Makefile
Normal file
4
binr/rafind2/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
BIN=rafind2
|
||||
DEPS=r_search r_util r_io r_cons r_print
|
||||
|
||||
include ../binr.mk
|
182
binr/rafind2/rafind2.c
Normal file
182
binr/rafind2/rafind2.c
Normal file
@ -0,0 +1,182 @@
|
||||
/* radare - LGPL - Copyright 2009 pancake<nopcode.org> */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <r_types.h>
|
||||
#include <r_print.h>
|
||||
#include <r_search.h>
|
||||
#include <r_util.h>
|
||||
#include <r_cons.h>
|
||||
#include <r_lib.h>
|
||||
#include <r_io.h>
|
||||
|
||||
static struct r_io_t *io;
|
||||
static int fd = -1;
|
||||
static int rad = 0;
|
||||
struct r_search_t *rs;
|
||||
static ut64 from = 0LL, to = -1;
|
||||
static char *mask = "";
|
||||
static int nonstop = 0;
|
||||
static int mode = R_SEARCH_STRING;
|
||||
static ut64 cur = 0;
|
||||
static ut8 *buffer = NULL;
|
||||
static char *curfile = NULL;
|
||||
static ut64 bsize = 4096;
|
||||
static int hexstr = 0;
|
||||
static struct r_print_t *pr = NULL;
|
||||
LIST_HEAD(kws_head);
|
||||
|
||||
typedef struct {
|
||||
char *str;
|
||||
struct list_head list;
|
||||
} BoxedString;
|
||||
|
||||
static int hit(RSearchKeyword *kw, void *user, ut64 addr) {
|
||||
//const ut8 *buf = (ut8*)user;
|
||||
int delta = addr-cur;
|
||||
if (rad) {
|
||||
printf("f hit%d_%d 0x%08"PFMT64x" ; %s\n", 0, kw->count, addr, curfile);
|
||||
} else {
|
||||
if (!kw->count) printf("; %s\n", kw->keyword);
|
||||
printf("%s: %03d @ 0x%"PFMT64x"\n", curfile, kw->count, addr);
|
||||
if (pr) {
|
||||
r_print_hexdump(pr, addr, (ut8*)buffer+delta, 78, 16, R_TRUE);
|
||||
r_cons_flush();
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int show_help(char *argv0, int line) {
|
||||
printf("Usage: %s [-Xnzh] [-f from] [-t to] [-z] [-s str] [-x hex] file ...\n", argv0);
|
||||
if (line) return 0;
|
||||
printf(
|
||||
" -z search for zero-terminated strings\n"
|
||||
" -s [str] search for zero-terminated strings (can be used multiple times)\n"
|
||||
" -m [str] set a mask\n"
|
||||
" -x [hex] search for hexpair string (909090) (can be used multiple times)\n"
|
||||
" -f [from] start searching from address 'from'\n"
|
||||
" -f [to] stop search at address 'to'\n"
|
||||
" -X show hexdump of search results\n"
|
||||
" -n do not stop on read errors\n"
|
||||
" -r print using radare commands\n"
|
||||
" -b set block size\n"
|
||||
" -h show this help\n"
|
||||
" -V print version and exit\n"
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rafind_open(char *file) {
|
||||
int ret, last = 0;
|
||||
struct list_head *pos;
|
||||
io = r_io_new();
|
||||
|
||||
fd = r_io_open(io, file, R_IO_READ, 0);
|
||||
if (fd == -1) {
|
||||
fprintf (stderr, "Cannot open file '%s'\n", file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
r_cons_new();
|
||||
rs = r_search_new(mode);
|
||||
buffer = malloc(bsize);
|
||||
r_search_set_callback(rs, &hit, buffer);
|
||||
if (to == -1) {
|
||||
to = r_io_size(io, fd);
|
||||
}
|
||||
if (mode == R_SEARCH_KEYWORD) {
|
||||
list_for_each(pos, &(kws_head)) {
|
||||
BoxedString *kw = list_entry(pos, BoxedString, list);
|
||||
r_search_kw_add (rs, (hexstr)?
|
||||
r_search_keyword_new_hex (kw->str, mask, NULL) :
|
||||
r_search_keyword_new_str (kw->str, mask, NULL));
|
||||
free(kw);
|
||||
}
|
||||
}
|
||||
curfile = file;
|
||||
r_search_begin(rs);
|
||||
r_io_seek(io, from, R_IO_SEEK_SET);
|
||||
//printf("; %s 0x%08"PFMT64x"-0x%08"PFMT64x"\n", file, from, to);
|
||||
for(cur=from; !last && cur<to;cur+=bsize) {
|
||||
if ((cur+bsize)>to) {
|
||||
bsize = to-cur;
|
||||
last=1;
|
||||
}
|
||||
ret = r_io_read(io, buffer, bsize);
|
||||
if (ret == 0) {
|
||||
if (nonstop) continue;
|
||||
// fprintf(stderr, "Error reading at 0x%08"PFMT64x"\n", cur);
|
||||
return 1;
|
||||
}
|
||||
if (ret != bsize)
|
||||
bsize = ret;
|
||||
r_search_update_i(rs, cur, buffer, bsize);
|
||||
}
|
||||
rs = r_search_free(rs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int c;
|
||||
|
||||
while ((c = getopt(argc, argv, "b:m:s:x:Xzf:t:rnhV")) != -1) {
|
||||
BoxedString *kw = R_NEW(BoxedString);
|
||||
INIT_LIST_HEAD(&(kw->list));
|
||||
|
||||
switch(c) {
|
||||
case 'r':
|
||||
rad = 1;
|
||||
break;
|
||||
case 'n':
|
||||
nonstop = 1;
|
||||
break;
|
||||
case 's':
|
||||
mode = R_SEARCH_KEYWORD;
|
||||
hexstr = 0;
|
||||
kw->str = optarg;
|
||||
list_add(&(kw->list), &(kws_head));
|
||||
break;
|
||||
case 'b':
|
||||
bsize = r_num_math(NULL, optarg);
|
||||
break;
|
||||
case 'z':
|
||||
mode = R_SEARCH_STRING;
|
||||
break;
|
||||
case 'x':
|
||||
mode = R_SEARCH_KEYWORD;
|
||||
hexstr = 1;
|
||||
kw->str = optarg;
|
||||
list_add(&(kw->list), &(kws_head));
|
||||
break;
|
||||
case 'm':
|
||||
// XXX should be from hexbin
|
||||
mask = optarg;
|
||||
break;
|
||||
case 'f':
|
||||
from = r_num_math(NULL, optarg);
|
||||
break;
|
||||
case 't':
|
||||
to = r_num_math(NULL, optarg);
|
||||
break;
|
||||
case 'X':
|
||||
pr = r_print_new();
|
||||
break;
|
||||
case 'V':
|
||||
printf("rafind2 v"VERSION"\n");
|
||||
return 0;
|
||||
case 'h':
|
||||
return show_help(argv[0], 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind == argc)
|
||||
return show_help(argv[0], 1);
|
||||
|
||||
for (;optind < argc;optind++)
|
||||
rafind_open(argv[optind]);
|
||||
|
||||
return 0;
|
||||
}
|
50
binr/rafind2/rafind2.d
Normal file
50
binr/rafind2/rafind2.d
Normal file
@ -0,0 +1,50 @@
|
||||
rafind2.o: rafind2.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h \
|
||||
/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
|
||||
/usr/include/getopt.h ../../libr/include/r_types.h \
|
||||
../../libr/include/r_userconf.h ../../libr/include/r_types_base.h \
|
||||
/usr/include/string.h /usr/include/xlocale.h /usr/include/sys/time.h \
|
||||
/usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/fcntl.h \
|
||||
/usr/include/bits/fcntl.h /usr/include/dirent.h \
|
||||
/usr/include/bits/dirent.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
|
||||
/usr/include/bits/confname.h ../../libr/include/r_print.h \
|
||||
../../libr/include/r_types.h ../../libr/include/r_util.h \
|
||||
../../libr/include/btree.h ../../libr/include/r_list.h \
|
||||
../../libr/include/r_flist.h ../../libr/include/list.h \
|
||||
../../libr/include/r_search.h ../../libr/include/r_util.h \
|
||||
../../libr/include/r_cons.h /usr/include/termios.h \
|
||||
/usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \
|
||||
/usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \
|
||||
/usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \
|
||||
/usr/include/sys/wait.h /usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/linux/types.h /usr/include/asm/types.h \
|
||||
/usr/include/asm-generic/types.h /usr/include/asm-generic/int-ll64.h \
|
||||
/usr/include/asm/bitsperlong.h /usr/include/asm-generic/bitsperlong.h \
|
||||
/usr/include/linux/posix_types.h /usr/include/linux/stddef.h \
|
||||
/usr/include/asm/posix_types.h /usr/include/asm/posix_types_32.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
/usr/include/sys/resource.h /usr/include/bits/resource.h \
|
||||
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
|
||||
/usr/include/sys/socket.h /usr/include/sys/uio.h /usr/include/bits/uio.h \
|
||||
/usr/include/bits/socket.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm-generic/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/asm-generic/sockios.h \
|
||||
../../libr/include/r_lib.h ../../libr/include/list.h \
|
||||
../../libr/include/r_io.h
|
BIN
binr/rafind2/rafind2.o
Normal file
BIN
binr/rafind2/rafind2.o
Normal file
Binary file not shown.
4
binr/rahash2/Makefile
Normal file
4
binr/rahash2/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
BIN=rahash2
|
||||
DEPS=r_hash r_util
|
||||
|
||||
include ../binr.mk
|
4
binr/rasm2/Makefile
Normal file
4
binr/rasm2/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
BIN=rasm2
|
||||
DEPS=r_asm r_util
|
||||
|
||||
include ../binr.mk
|
4
binr/rax2/Makefile
Normal file
4
binr/rax2/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
BIN=rax2
|
||||
DEPS=r_util
|
||||
|
||||
include ../binr.mk
|
43
binr/rax2/rax2.c
Normal file
43
binr/rax2/rax2.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* radare - LGPL - Copyright 2007-2009 pancake<nopcode.org> */
|
||||
|
||||
#include <r_util.h>
|
||||
|
||||
static int rax(const char *str) {
|
||||
ut64 n;
|
||||
if (*str=='q')
|
||||
return 0;
|
||||
n = r_num_math(NULL, str);
|
||||
if (str[0]=='0'&&str[1]=='x')
|
||||
printf("%"PFMT64d"\n", n);
|
||||
else printf("0x%"PFMT64x"\n", n);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
char buf[1024];
|
||||
|
||||
if (argc == 1) {
|
||||
while(!feof(stdin)) {
|
||||
fgets(buf, 1023, stdin);
|
||||
if (feof(stdin)) break;
|
||||
buf[strlen(buf)-1] = '\0';
|
||||
if (!rax(buf)) break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (argv[1][0]=='-') {
|
||||
switch(argv[1][1]) {
|
||||
case 'h':
|
||||
printf("Usage: rax2 [-hV] [expression]\n");
|
||||
return 0;
|
||||
case 'V':
|
||||
printf("rax2 v"VERSION"\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
for(i=1; i<argc; i++)
|
||||
rax( argv[i] );
|
||||
return 0;
|
||||
}
|
@ -1,7 +1,5 @@
|
||||
include ../../config.mk
|
||||
|
||||
OBJ=rasm2.o
|
||||
BIN=rasm2${EXT_EXE}
|
||||
BINDEPS=r_lib r_asm r_util
|
||||
LIBS+=-ldl
|
||||
|
||||
@ -9,15 +7,12 @@ LDPATH=-L.. -L../../util -L../../lib
|
||||
LDPATH+=-lr_util -lr_lib
|
||||
CFLAGS+=-DVERSION=\"${VERSION}\"
|
||||
|
||||
all: ${BIN} fastcall${EXT_EXE}
|
||||
all: fastcall${EXT_EXE}
|
||||
|
||||
fastcall${EXT_EXE}: fastcall.o
|
||||
${CC} fastcall.o ${LDPATH} ${LDFLAGS} -o fastcall${EXT_EXE}
|
||||
@#-Wl,-R.. -L.. -lr_asm -o fastcall
|
||||
|
||||
test:
|
||||
./rasm2 -f test.asm
|
||||
|
||||
myclean:
|
||||
rm -f fastcall fastcall.o
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
include ../../config.mk
|
||||
|
||||
OBJ=rabin2.o
|
||||
BIN=rabin2
|
||||
#${EXT_EXE}
|
||||
BINDEPS=r_lib r_bin r_flags r_util r_cons
|
||||
CFLAGS+=-DLIBDIR=\"${PREFIX}/lib\"
|
||||
LIBS+=${DL_LIBS}
|
||||
@ -10,7 +7,7 @@ LIBS+=${DL_LIBS}
|
||||
LDPATH=-L.. -L../../util
|
||||
LDPATH+=-lr_util
|
||||
|
||||
all: ${BIN}${EXT_EXE} test_meta${EXT_EXE} mach-ex${EXT_EXE} rpathdel${EXT_EXE}
|
||||
all: test_meta${EXT_EXE} mach-ex${EXT_EXE} rpathdel${EXT_EXE}
|
||||
|
||||
test_meta${EXT_EXE}: test_meta.o
|
||||
${CC} test_meta.o ${LDPATH} ${LDFLAGS} -o test_meta${EXT_EXE}
|
||||
|
@ -1,634 +0,0 @@
|
||||
/* radare - LGPL - Copyright 2009-2010 nibble<.ds@gmail.com> */
|
||||
|
||||
/* TODO:
|
||||
* -L [lib] dlopen library and show address
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <r_types.h>
|
||||
#include <r_list.h>
|
||||
#include <r_lib.h>
|
||||
#include <r_bin.h>
|
||||
#include <r_flags.h>
|
||||
#include <r_util.h>
|
||||
|
||||
#define ACTION_UNK 0x0000
|
||||
#define ACTION_ENTRIES 0x0001
|
||||
#define ACTION_IMPORTS 0x0002
|
||||
#define ACTION_SYMBOLS 0x0004
|
||||
#define ACTION_SECTIONS 0x0008
|
||||
#define ACTION_INFO 0x0010
|
||||
#define ACTION_OPERATION 0x0020
|
||||
#define ACTION_HELP 0x0040
|
||||
#define ACTION_STRINGS 0x0080
|
||||
#define ACTION_FIELDS 0x0100
|
||||
#define ACTION_LIBS 0x0200
|
||||
#define ACTION_SRCLINE 0x0400
|
||||
|
||||
static struct r_lib_t *l;
|
||||
static struct r_bin_t *bin = NULL;
|
||||
static int rad = R_FALSE;
|
||||
static int rw = R_FALSE;
|
||||
static int va = R_FALSE;
|
||||
static char* file = NULL;
|
||||
static char* output = "a.out";
|
||||
|
||||
static int rabin_show_help() {
|
||||
printf ("rabin2 [options] [file]\n"
|
||||
" -e Entrypoint\n"
|
||||
" -i Imports (symbols imported from libraries)\n"
|
||||
" -s Symbols (exports)\n"
|
||||
" -S Sections\n"
|
||||
" -z Strings\n"
|
||||
" -I Binary info\n"
|
||||
" -H Header fields\n"
|
||||
" -l Linked libraries\n"
|
||||
" -O [str] Write/Extract operations (str=help for help)\n"
|
||||
" -o [file] Output file for write operations (a.out by default)\n"
|
||||
" -f [format] Override file format autodetection\n"
|
||||
" -r radare output\n"
|
||||
" -v Use vaddr in radare output\n"
|
||||
" -m [addr] Show source line at addr\n"
|
||||
" -L List supported bin plugins\n"
|
||||
" -@ [addr] Show section, symbol or import at addr\n"
|
||||
" -V Show version information\n"
|
||||
" -h This help\n");
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_entrypoints() {
|
||||
RList *entries;
|
||||
RListIter *iter;
|
||||
RBinEntry *entry;
|
||||
int i = 0;
|
||||
|
||||
ut64 baddr = r_bin_get_baddr (bin);
|
||||
|
||||
if ((entries = r_bin_get_entries (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
if (rad) printf ("fs symbols\n");
|
||||
else printf ("[Entrypoints]\n");
|
||||
|
||||
r_list_foreach (entries, iter, entry) {
|
||||
if (rad) {
|
||||
printf ("f entry%i @ 0x%08"PFMT64x"\n", i, va?baddr+entry->rva:entry->offset);
|
||||
printf ("s entry%i\n", i);
|
||||
} else printf ("address=0x%08"PFMT64x" offset=0x%08"PFMT64x" baddr=0x%08"PFMT64x"\n",
|
||||
baddr+entry->rva, entry->offset, baddr);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!rad) printf("\n%i entrypoints\n", i);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_libs() {
|
||||
RList *libs;
|
||||
RListIter *iter;
|
||||
char* lib;
|
||||
int i = 0;
|
||||
|
||||
if ((libs = r_bin_get_libs (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
printf ("[Linked libraries]\n");
|
||||
|
||||
r_list_foreach (libs, iter, lib) {
|
||||
printf ("%s\n", lib);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!rad) printf ("\n%i libraries\n", i);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_imports(ut64 at) {
|
||||
RList *imports;
|
||||
RListIter *iter;
|
||||
RBinImport *import;
|
||||
ut64 baddr;
|
||||
int i = 0;
|
||||
|
||||
baddr = r_bin_get_baddr (bin);
|
||||
|
||||
if ((imports = r_bin_get_imports (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
if (!at && !rad)
|
||||
printf ("[Imports]\n");
|
||||
|
||||
r_list_foreach (imports, iter, import) {
|
||||
if (at) {
|
||||
if (baddr+import->rva == at || import->offset == at)
|
||||
printf ("%s\n", import->name);
|
||||
} else {
|
||||
if (rad) {
|
||||
r_flag_name_filter (import->name);
|
||||
printf ("fs imports\n");
|
||||
printf ("f imp.%s @ 0x%08"PFMT64x"\n",
|
||||
import->name, va?baddr+import->rva:import->offset);
|
||||
printf ("fs functions\n");
|
||||
printf ("f fcn.imp.%s @ 0x%08"PFMT64x"\n",
|
||||
import->name, va?baddr+import->rva:import->offset);
|
||||
} else printf ("address=0x%08"PFMT64x" offset=0x%08"PFMT64x" ordinal=%03"PFMT64d" "
|
||||
"hint=%03"PFMT64d" bind=%s type=%s name=%s\n",
|
||||
baddr+import->rva, import->offset,
|
||||
import->ordinal, import->hint, import->bind,
|
||||
import->type, import->name);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!at && !rad) printf ("\n%i imports\n", i);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_symbols(ut64 at) {
|
||||
RList *symbols;
|
||||
RListIter *iter;
|
||||
RBinSymbol *symbol;
|
||||
ut64 baddr;
|
||||
int i = 0;
|
||||
|
||||
baddr = r_bin_get_baddr (bin);
|
||||
|
||||
if ((symbols = r_bin_get_symbols (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
if (!at) {
|
||||
if (rad) printf ("fs symbols\n");
|
||||
else printf ("[Symbols]\n");
|
||||
}
|
||||
|
||||
r_list_foreach (symbols, iter, symbol) {
|
||||
if (at) {
|
||||
if ((symbol->size != 0 &&
|
||||
((baddr+symbol->rva <= at && baddr+symbol->rva+symbol->size > at) ||
|
||||
(symbol->offset <= at && symbol->offset+symbol->size > at))) ||
|
||||
baddr+symbol->rva == at || symbol->offset == at)
|
||||
printf("%s\n", symbol->name);
|
||||
} else {
|
||||
if (rad) {
|
||||
r_flag_name_filter (symbol->name);
|
||||
if (!strncmp (symbol->type,"FUNC", 4)) {
|
||||
if (symbol->size)
|
||||
printf ("CF %"PFMT64d" @ 0x%08"PFMT64x"\n",
|
||||
symbol->size, va?baddr+symbol->rva:symbol->offset);
|
||||
printf ("fs functions\n");
|
||||
printf ("f fcn.sym.%s %"PFMT64d" 0x%08"PFMT64x"\n",
|
||||
symbol->name, symbol->size,
|
||||
va?baddr+symbol->rva:symbol->offset);
|
||||
printf ("fs symbols\n");
|
||||
} else if (!strncmp (symbol->type,"OBJECT", 6))
|
||||
printf ("Cd %"PFMT64d" @ 0x%08"PFMT64x"\n",
|
||||
symbol->size, va?baddr+symbol->rva:symbol->offset);
|
||||
printf ("f sym.%s %"PFMT64d" 0x%08"PFMT64x"\n",
|
||||
symbol->name, symbol->size,
|
||||
va?baddr+symbol->rva:symbol->offset);
|
||||
} else printf ("address=0x%08"PFMT64x" offset=0x%08"PFMT64x" ordinal=%03"PFMT64d" "
|
||||
"forwarder=%s size=%"PFMT64d" bind=%s type=%s name=%s\n",
|
||||
baddr+symbol->rva, symbol->offset,
|
||||
symbol->ordinal, symbol->forwarder,
|
||||
symbol->size, symbol->bind, symbol->type,
|
||||
symbol->name);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!at && !rad) printf ("\n%i symbols\n", i);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_strings() {
|
||||
RList *strings;
|
||||
RListIter *iter;
|
||||
RBinString *string;
|
||||
RBinSection *section;
|
||||
ut64 baddr;
|
||||
int i = 0;
|
||||
|
||||
baddr = r_bin_get_baddr (bin);
|
||||
|
||||
if ((strings = r_bin_get_strings (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
if (rad) printf ("fs strings\n");
|
||||
else printf ("[strings]\n");
|
||||
|
||||
r_list_foreach (strings, iter, string) {
|
||||
section = r_bin_get_section_at (bin, string->offset, 0);
|
||||
if (rad) {
|
||||
r_flag_name_filter (string->string);
|
||||
printf ("f str.%s %"PFMT64d" @ 0x%08"PFMT64x"\n"
|
||||
"Cs %"PFMT64d" @ 0x%08"PFMT64x"\n",
|
||||
string->string, string->size, va?baddr+string->rva:string->offset,
|
||||
string->size, va?baddr+string->rva:string->offset);
|
||||
} else printf ("address=0x%08"PFMT64x" offset=0x%08"PFMT64x" ordinal=%03"PFMT64d" "
|
||||
"size=%"PFMT64d" section=%s string=%s\n",
|
||||
baddr+string->rva, string->offset,
|
||||
string->ordinal, string->size,
|
||||
section?section->name:"unknown", string->string);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!rad) printf ("\n%i strings\n", i);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_sections(ut64 at) {
|
||||
RList *sections;
|
||||
RListIter *iter;
|
||||
RBinSection *section;
|
||||
ut64 baddr;
|
||||
int i = 0;
|
||||
|
||||
baddr = r_bin_get_baddr (bin);
|
||||
|
||||
if ((sections = r_bin_get_sections (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
if (!at) {
|
||||
if (rad) printf ("fs sections\n");
|
||||
else printf ("[Sections]\n");
|
||||
}
|
||||
|
||||
r_list_foreach (sections, iter, section) {
|
||||
if (at) {
|
||||
if ((section->size != 0 &&
|
||||
((baddr+section->rva <= at && baddr+section->rva+section->size > at) ||
|
||||
(section->offset <= at && section->offset+section->size > at))) ||
|
||||
baddr+section->rva == at || section->offset == at)
|
||||
printf ("%s\n", section->name);
|
||||
} else {
|
||||
if (rad) {
|
||||
r_flag_name_filter (section->name);
|
||||
printf ("S 0x%08"PFMT64x" 0x%08"PFMT64x" 0x%08"PFMT64x" 0x%08"PFMT64x" %s %d\n",
|
||||
section->offset, baddr+section->rva,
|
||||
section->size, section->vsize, section->name, (int)section->characteristics);
|
||||
printf ("f section.%s %"PFMT64d" 0x%08"PFMT64x"\n",
|
||||
section->name, section->size, va?baddr+section->rva:section->offset);
|
||||
printf ("CC [%02i] va=0x%08"PFMT64x" pa=0x%08"PFMT64x" sz=%"PFMT64d" vsz=%"PFMT64d" "
|
||||
"rwx=%c%c%c%c %s @ 0x%08"PFMT64x"\n",
|
||||
i, baddr+section->rva, section->offset, section->size, section->vsize,
|
||||
R_BIN_SCN_SHAREABLE (section->characteristics)?'s':'-',
|
||||
R_BIN_SCN_READABLE (section->characteristics)?'r':'-',
|
||||
R_BIN_SCN_WRITABLE (section->characteristics)?'w':'-',
|
||||
R_BIN_SCN_EXECUTABLE (section->characteristics)?'x':'-',
|
||||
section->name,va?baddr+section->rva:section->offset);
|
||||
} else printf ("idx=%02i address=0x%08"PFMT64x" offset=0x%08"PFMT64x" size=%"PFMT64d" vsize=%"PFMT64d" "
|
||||
"privileges=%c%c%c%c name=%s\n",
|
||||
i, baddr+section->rva, section->offset, section->size, section->vsize,
|
||||
R_BIN_SCN_SHAREABLE (section->characteristics)?'s':'-',
|
||||
R_BIN_SCN_READABLE (section->characteristics)?'r':'-',
|
||||
R_BIN_SCN_WRITABLE (section->characteristics)?'w':'-',
|
||||
R_BIN_SCN_EXECUTABLE (section->characteristics)?'x':'-',
|
||||
section->name);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!at && !rad) printf ("\n%i sections\n", i);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_info() {
|
||||
RBinInfo *info;
|
||||
|
||||
if ((info = r_bin_get_info (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
if (rad) {
|
||||
printf ("e file.type=%s\n"
|
||||
"e cfg.bigendian=%s\n"
|
||||
"e asm.os=%s\n"
|
||||
"e asm.arch=%s\n"
|
||||
"e asm.bits=%i\n"
|
||||
"e asm.dwarf=%s\n",
|
||||
info->rclass, info->big_endian?"true":"false", info->os, info->arch,
|
||||
info->bits, R_BIN_DBG_STRIPPED (info->dbg_info)?"false":"true");
|
||||
} else printf ("[File info]\n"
|
||||
"File=%s\n"
|
||||
"Type=%s\n"
|
||||
"Class=%s\n"
|
||||
"Arch=%s %i\n"
|
||||
"Machine=%s\n"
|
||||
"OS=%s\n"
|
||||
"Subsystem=%s\n"
|
||||
"Big endian=%s\n"
|
||||
"Stripped=%s\n"
|
||||
"Static=%s\n"
|
||||
"Line_nums=%s\n"
|
||||
"Local_syms=%s\n"
|
||||
"Relocs=%s\n"
|
||||
"RPath=%s\n",
|
||||
info->file, info->type, info->bclass,
|
||||
info->arch, info->bits, info->machine, info->os,
|
||||
info->subsystem, info->big_endian?"True":"False",
|
||||
R_BIN_DBG_STRIPPED (info->dbg_info)?"True":"False",
|
||||
R_BIN_DBG_STATIC (info->dbg_info)?"True":"False",
|
||||
R_BIN_DBG_LINENUMS (info->dbg_info)?"True":"False",
|
||||
R_BIN_DBG_SYMS (info->dbg_info)?"True":"False",
|
||||
R_BIN_DBG_RELOCS (info->dbg_info)?"True":"False",
|
||||
info->rpath);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_fields() {
|
||||
RList *fields;
|
||||
RListIter *iter;
|
||||
RBinField *field;
|
||||
ut64 baddr;
|
||||
int i = 0;
|
||||
|
||||
baddr = r_bin_get_baddr (bin);
|
||||
|
||||
if ((fields = r_bin_get_fields (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
if (rad) printf ("fs header\n");
|
||||
else printf ("[Header fields]\n");
|
||||
|
||||
r_list_foreach (fields, iter, field) {
|
||||
if (rad) {
|
||||
r_flag_name_filter (field->name);
|
||||
printf ("f header.%s @ 0x%08"PFMT64x"\n",
|
||||
field->name, va?baddr+field->rva:field->offset);
|
||||
printf ("[%02i] address=0x%08"PFMT64x" offset=0x%08"PFMT64x" name=%s\n",
|
||||
i, baddr+field->rva, field->offset, field->name);
|
||||
} else printf ("idx=%02i address=0x%08"PFMT64x" offset=0x%08"PFMT64x" name=%s\n",
|
||||
i, baddr+field->rva, field->offset, field->name);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!rad) printf ("\n%i fields\n", i);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_dump_symbols(int len) {
|
||||
RList *symbols;
|
||||
RListIter *iter;
|
||||
RBinSymbol *symbol;
|
||||
ut8 *buf;
|
||||
char *ret;
|
||||
int olen = len;
|
||||
|
||||
if ((symbols = r_bin_get_symbols (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
r_list_foreach (symbols, iter, symbol) {
|
||||
if (symbol->size != 0 && (olen > symbol->size || olen == 0))
|
||||
len = symbol->size;
|
||||
else if (symbol->size == 0 && olen == 0)
|
||||
len = 32;
|
||||
else len = olen;
|
||||
|
||||
if (!(buf = malloc (len)) || !(ret = malloc(len*2+1)))
|
||||
return R_FALSE;
|
||||
r_buf_read_at (bin->buf, symbol->offset, buf, len);
|
||||
r_hex_bin2str (buf, len, ret);
|
||||
printf ("%s %s\n", symbol->name, ret);
|
||||
free (buf);
|
||||
free (ret);
|
||||
}
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_dump_sections(char *name) {
|
||||
RList *sections;
|
||||
RListIter *iter;
|
||||
RBinSection *section;
|
||||
ut8 *buf;
|
||||
char *ret;
|
||||
|
||||
if ((sections = r_bin_get_sections (bin)) == NULL)
|
||||
return R_FALSE;
|
||||
|
||||
r_list_foreach (sections, iter, section) {
|
||||
if (!strcmp (name, section->name)) {
|
||||
if (!(buf = malloc (section->size)) ||
|
||||
!(ret = malloc (section->size*2+1)))
|
||||
return R_FALSE;
|
||||
r_buf_read_at (bin->buf, section->offset, buf, section->size);
|
||||
r_hex_bin2str (buf, section->size, ret);
|
||||
printf ("%s\n", ret);
|
||||
free (buf);
|
||||
free (ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_do_operation(const char *op) {
|
||||
char *arg = NULL, *ptr = NULL, *ptr2 = NULL;
|
||||
|
||||
if (!strcmp (op, "help")) {
|
||||
printf ("Operation string:\n"
|
||||
" Dump symbols: d/s/1024\n"
|
||||
" Dump section: d/S/.text\n"
|
||||
" Resize section: r/.data/1024\n");
|
||||
return R_FALSE;
|
||||
}
|
||||
/* Implement alloca with fixed-size buffer? */
|
||||
if (!(arg = strdup (op)))
|
||||
return R_FALSE;
|
||||
|
||||
if ((ptr = strchr (arg, '/'))) {
|
||||
ptr[0] = '\0';
|
||||
ptr = ptr + 1;
|
||||
if ((ptr2 = strchr (ptr, '/'))) {
|
||||
ptr2[0] = '\0';
|
||||
ptr2 = ptr2 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
switch (arg[0]) {
|
||||
case 'd':
|
||||
if (!ptr)
|
||||
goto _rabin_do_operation_error;
|
||||
if (ptr[0]=='s') {
|
||||
if (ptr2) {
|
||||
if (!rabin_dump_symbols (r_num_math(NULL, ptr2)))
|
||||
return R_FALSE;
|
||||
} else
|
||||
if (!rabin_dump_symbols (0))
|
||||
return R_FALSE;
|
||||
} else if (ptr[0]=='S') {
|
||||
if (!ptr2)
|
||||
goto _rabin_do_operation_error;
|
||||
if (!rabin_dump_sections (ptr2))
|
||||
return R_FALSE;
|
||||
} else goto _rabin_do_operation_error;
|
||||
break;
|
||||
case 'r':
|
||||
r_bin_wr_scn_resize (bin, ptr, r_num_math (NULL, ptr2));
|
||||
r_bin_wr_output (bin, output);
|
||||
break;
|
||||
default:
|
||||
_rabin_do_operation_error:
|
||||
printf ("Unknown operation. use -O help\n");
|
||||
return R_FALSE;
|
||||
}
|
||||
|
||||
free (arg);
|
||||
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int rabin_show_srcline(ut64 at) {
|
||||
char *srcline;
|
||||
if ((srcline = r_bin_meta_get_source_line (bin, at))) {
|
||||
printf ("%s\n", srcline);
|
||||
free (srcline);
|
||||
return R_TRUE;
|
||||
}
|
||||
return R_FALSE;
|
||||
}
|
||||
|
||||
/* bin callback */
|
||||
static int __lib_bin_cb(struct r_lib_plugin_t *pl, void *user, void *data) {
|
||||
struct r_bin_plugin_t *hand = (struct r_bin_plugin_t *)data;
|
||||
//printf(" * Added (dis)assembly plugin\n");
|
||||
r_bin_add (bin, hand);
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int __lib_bin_dt(struct r_lib_plugin_t *pl, void *p, void *u) {
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ut64 at = 0LL;
|
||||
int c;
|
||||
int action = ACTION_UNK;
|
||||
const char *format = NULL, *op = NULL;
|
||||
const char *plugin_name = NULL;
|
||||
|
||||
bin = r_bin_new ();
|
||||
l = r_lib_new ("radare_plugin");
|
||||
r_lib_add_handler (l, R_LIB_TYPE_BIN, "bin plugins",
|
||||
&__lib_bin_cb, &__lib_bin_dt, NULL);
|
||||
|
||||
{ /* load plugins everywhere */
|
||||
char *homeplugindir = r_str_home (".radare/plugins");
|
||||
r_lib_opendir (l, getenv ("LIBR_PLUGINS"));
|
||||
r_lib_opendir (l, homeplugindir);
|
||||
r_lib_opendir (l, LIBDIR"/radare2/");
|
||||
}
|
||||
|
||||
while ((c = getopt (argc, argv, "m:@:VisSzIHelwO:o:f:rvLh")) != -1) {
|
||||
switch(c) {
|
||||
case 'm':
|
||||
at = r_num_math (NULL, optarg);
|
||||
action |= ACTION_SRCLINE;
|
||||
case 'i':
|
||||
action |= ACTION_IMPORTS;
|
||||
break;
|
||||
case 's':
|
||||
action |= ACTION_SYMBOLS;
|
||||
break;
|
||||
case 'S':
|
||||
action |= ACTION_SECTIONS;
|
||||
break;
|
||||
case 'z':
|
||||
action |= ACTION_STRINGS;
|
||||
break;
|
||||
case 'I':
|
||||
action |= ACTION_INFO;
|
||||
break;
|
||||
case 'H':
|
||||
action |= ACTION_FIELDS;
|
||||
break;
|
||||
case 'e':
|
||||
action |= ACTION_ENTRIES;
|
||||
break;
|
||||
case 'l':
|
||||
action |= ACTION_LIBS;
|
||||
break;
|
||||
case 'w':
|
||||
rw = R_TRUE;
|
||||
break;
|
||||
case 'O':
|
||||
op = optarg;
|
||||
action |= ACTION_OPERATION;
|
||||
break;
|
||||
case 'o':
|
||||
output = optarg;
|
||||
break;
|
||||
case 'f':
|
||||
format = optarg;
|
||||
break;
|
||||
case 'r':
|
||||
rad = R_TRUE;
|
||||
break;
|
||||
case 'v':
|
||||
va = R_TRUE;
|
||||
break;
|
||||
case 'L':
|
||||
r_bin_list (bin);
|
||||
exit(1);
|
||||
case '@':
|
||||
at = r_num_math (NULL, optarg);
|
||||
break;
|
||||
case 'V':
|
||||
printf ("rabin2 v"VERSION"\n");
|
||||
return 0;
|
||||
case 'h':
|
||||
default:
|
||||
action |= ACTION_HELP;
|
||||
}
|
||||
}
|
||||
|
||||
file = argv[optind];
|
||||
if (action == ACTION_HELP || action == ACTION_UNK || file == NULL)
|
||||
return rabin_show_help ();
|
||||
|
||||
if (format)
|
||||
plugin_name = format;
|
||||
|
||||
if (!r_bin_load (bin, file, plugin_name) &&
|
||||
!r_bin_load (bin, file, "dummy")) {
|
||||
eprintf ("r_bin: Cannot open '%s'\n", file);
|
||||
return R_FALSE;
|
||||
}
|
||||
|
||||
if (action&ACTION_SECTIONS)
|
||||
rabin_show_sections (at);
|
||||
if (action&ACTION_ENTRIES)
|
||||
rabin_show_entrypoints ();
|
||||
if (action&ACTION_IMPORTS)
|
||||
rabin_show_imports (at);
|
||||
if (action&ACTION_SYMBOLS)
|
||||
rabin_show_symbols (at);
|
||||
if (action&ACTION_STRINGS)
|
||||
rabin_show_strings ();
|
||||
if (action&ACTION_INFO)
|
||||
rabin_show_info ();
|
||||
if (action&ACTION_FIELDS)
|
||||
rabin_show_fields();
|
||||
if (action&ACTION_LIBS)
|
||||
rabin_show_libs();
|
||||
if (action&ACTION_SRCLINE)
|
||||
rabin_show_srcline(at);
|
||||
if (op != NULL && action&ACTION_OPERATION)
|
||||
rabin_do_operation (op);
|
||||
|
||||
r_bin_free (bin);
|
||||
|
||||
return R_FALSE;
|
||||
}
|
@ -1,29 +1,6 @@
|
||||
include ../../config.mk
|
||||
|
||||
OBJ=radare2.o
|
||||
BIN=radare2
|
||||
# this is already appended in rules.mk ${EXT_EXE}
|
||||
BINDEPS=r_core r_cons r_util r_flags r_lib r_io r_hash r_cmd r_config r_asm r_anal
|
||||
BINDEPS+=r_parse r_lang r_debug r_print r_line r_bin r_search r_meta r_reg r_bp r_util r_syscall r_sign
|
||||
|
||||
CFLAGS+=-DVERSION=\"${VERSION}\"
|
||||
LIBS+=${DL_LIBS}
|
||||
|
||||
# static
|
||||
#LIBS=../*.o \
|
||||
../../config/*.a \
|
||||
../../cons/*.a \
|
||||
../../line/*.a \
|
||||
../../io/*.a \
|
||||
../../cmd/*.a \
|
||||
../../util/*.a \
|
||||
../../print/*.a \
|
||||
../../flags/*.a \
|
||||
../../asm/*.a \
|
||||
../../lib/*.a \
|
||||
../../lang/*.a \
|
||||
../../macro/*.a \
|
||||
../../debug/*.a \
|
||||
../../hash/*.a
|
||||
all:
|
||||
@# do nothing here
|
||||
|
||||
include ../../rules.mk
|
||||
|
@ -6,15 +6,12 @@ BINDEPS+=r_parse r_lang r_debug r_print r_line r_bin r_search r_meta r_reg r_bp
|
||||
CFLAGS+=-DVERSION=\"${VERSION}\"
|
||||
CFLAGS+=-g -I../../include
|
||||
|
||||
all: test${EXT_EXE} radiff2${EXT_EXE}
|
||||
all: test${EXT_EXE}
|
||||
|
||||
test${EXT_EXE}: test.o
|
||||
${CC} ${CFLAGS} test.o ${LDFLAGS} -o test${EXT_EXE}
|
||||
|
||||
radiff2${EXT_EXE}: radiff2.o
|
||||
${CC} ${CFLAGS} radiff2.c ${LDFLAGS} -o radiff2${EXT_EXE}
|
||||
|
||||
myclean:
|
||||
rm -f test${EXT_EXE} test.o radiff2${EXT_EXE} radiff2.o
|
||||
rm -f test${EXT_EXE} test.o
|
||||
|
||||
include ../../rules.mk
|
||||
|
@ -1,12 +1,10 @@
|
||||
include ../../config.mk
|
||||
|
||||
OBJ=rahash2.o
|
||||
BIN=rahash2
|
||||
# already appended in rules.mk ${EXT_EXE}
|
||||
BINDEPS=r_io r_hash r_util
|
||||
LIBS=-lm
|
||||
|
||||
all: ${BIN} hello${EXT_EXE}
|
||||
all: hello${EXT_EXE}
|
||||
|
||||
hello${EXT_EXE}: hello.o
|
||||
@#${CC} -I../../include hello.o -Wl,-R.. -L.. -L../../io -L../../util -L../../lib -lr_util -lr_lib -lr_hash -lr_io -o hello
|
||||
|
@ -2,13 +2,10 @@ BINDEPS=r_util r_search r_print r_io r_cons r_line
|
||||
|
||||
include ../../config.mk
|
||||
|
||||
all: test${EXT_EXE} test-str${EXT_EXE} test-regexp${EXT_EXE} rafind2${EXT_EXE}
|
||||
all: test${EXT_EXE} test-str${EXT_EXE} test-regexp${EXT_EXE}
|
||||
|
||||
include ../../rules.mk
|
||||
|
||||
rafind2${EXT_EXE}: rafind2.o
|
||||
${CC} -g -I ../../include rafind2.o ${LDFLAGS} -o rafind2${EXT_EXE}
|
||||
|
||||
test${EXT_EXE}:
|
||||
${CC} -g -I ../../include test.c ${LDFLAGS} -o test${EXT_EXE}
|
||||
|
||||
@ -19,4 +16,4 @@ test-str${EXT_EXE}:
|
||||
${CC} -g -I ../../include test-str.c ${LDFLAGS} -o test-str${EXT_EXE}
|
||||
|
||||
myclean:
|
||||
rm -f test test.o test-str test-str.o test-regexp rafind2 *.o
|
||||
rm -f test test.o test-str test-str.o test-regexp *.o *.d
|
||||
|
Loading…
x
Reference in New Issue
Block a user