mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
* Set library version number for plugins
- Registers for which version of core was compiled * Use tar --format=posix when GNU tar - Fixes the dependency on BSD systems * Fix in doc/fortunes * Fix this class pointer in asm_java * Re-Fix uglily the bin_elf strtab issue (needs more work) * Fix Vala regression in r_asm.vapi
This commit is contained in:
parent
28e5244064
commit
0d4faf652e
9
Makefile
9
Makefile
@ -1,6 +1,11 @@
|
||||
include config-user.mk
|
||||
include global.mk
|
||||
|
||||
ifneq ($(shell tar --help|grep gnu.org),)
|
||||
TAR=tar -czv --format=posix -f
|
||||
else
|
||||
TAR=tar -czvf
|
||||
endif
|
||||
PWD=$(shell pwd)
|
||||
REMOTE=radare.org:/srv/http/radareorg/get/beta
|
||||
|
||||
@ -112,7 +117,7 @@ dist:
|
||||
VERSION=${VERSION} ; \
|
||||
FILES=`hg st -mc .| cut -c 3-|sed -e s,^,radare2-${VERSION}/, | grep -v r2-bindings | grep -v '/\.'` ; \
|
||||
cd .. && mv radare2 radare2-${VERSION} && \
|
||||
tar czvf radare2-${VERSION}.tar.gz $${FILES} ;\
|
||||
${TAR} radare2-${VERSION}.tar.gz $${FILES} ;\
|
||||
mv radare2-${VERSION} radare2
|
||||
|
||||
pub:
|
||||
@ -122,7 +127,7 @@ shot:
|
||||
DATE=`date '+%Y%m%d'` ; \
|
||||
FILES=`hg status -mc|cut -c 3-|sed -e s,^,radare2-$${DATE}/,`; \
|
||||
cd .. && mv radare2 radare2-$${DATE} && \
|
||||
tar czvf radare2-$${DATE}.tar.gz $${FILES} ;\
|
||||
${TAR} radare2-$${DATE}.tar.gz $${FILES} ;\
|
||||
mv radare2-$${DATE} radare2 && \
|
||||
scp radare2-$${DATE}.tar.gz radare.org:/srv/http/radareorg/get/shot
|
||||
|
||||
|
1
TODO
1
TODO
@ -5,6 +5,7 @@
|
||||
|
||||
CODENAME: #DRY
|
||||
|
||||
* Move mandpage from man/ to binr/*/?
|
||||
* add support for sockets in rarun2
|
||||
|
||||
TODO
|
||||
|
@ -29,7 +29,7 @@ Command layout is: <repeat><command><bytes>@<offset>.\ For example: 3x20@0x33 w
|
||||
Press 'c' in visual mode to toggle the cursor mode
|
||||
You can "copy/paste" bytes using the cursor in visual mode 'c' and using the 'y' and 'Y' keys
|
||||
Move around the bytes with hjkl! Arrow keys are not portable and are less productive to use
|
||||
Seek at relative offsets with 'seek +<offset>' or 'seek -<offset>'
|
||||
Seek at relative offsets with 's +<offset>' or 's -<offset>'
|
||||
Invert the block bytes using the 'I' key in visual mode
|
||||
Switch between print modes using the 'p' and 'P' keys in visual mode
|
||||
In soviet russia radare debugs you!
|
||||
|
@ -6,4 +6,4 @@ TARGET_ARM=anal_arm.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_ARM}
|
||||
|
||||
${TARGET_ARM}: ${OBJ_ARM}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o anal_arm.${EXT_SO} ${OBJ_ARM}
|
||||
${CC} $(call libname,anal_asm) ${LDFLAGS} ${CFLAGS} -o anal_arm.${EXT_SO} ${OBJ_ARM}
|
||||
|
@ -6,5 +6,4 @@ TARGET_AVR=anal_avr.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_AVR}
|
||||
|
||||
${TARGET_AVR}: ${OBJ_AVR}
|
||||
${CC} ${CFLAGS} -o anal_avr.${EXT_SO} ${OBJ_AVR}
|
||||
@#strip -s anal_avr.${EXT_SO}
|
||||
${CC} $(call libname,anal_avr) ${CFLAGS} -o anal_avr.${EXT_SO} ${OBJ_AVR}
|
||||
|
@ -6,5 +6,4 @@ TARGET_CSR=anal_csr.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_CSR}
|
||||
|
||||
${TARGET_CSR}: ${OBJ_CSR}
|
||||
${CC} ${CFLAGS} -o anal_csr.${EXT_SO} ${OBJ_CSR}
|
||||
@#strip -s anal_csr.${EXT_SO}
|
||||
${CC} $(call libname,anal_csr) ${CFLAGS} -o anal_csr.${EXT_SO} ${OBJ_CSR}
|
||||
|
@ -6,4 +6,4 @@ TARGET_DALVIK=anal_dalvik.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_DALVIK}
|
||||
|
||||
${TARGET_DALVIK}: ${OBJ_DALVIK}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o anal_dalvik.${EXT_SO} ${OBJ_DALVIK}
|
||||
${CC} $(call libname,anal_dalvik) ${LDFLAGS} ${CFLAGS} -o anal_dalvik.${EXT_SO} ${OBJ_DALVIK}
|
||||
|
@ -7,4 +7,4 @@ TARGET_JAVA=anal_java.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_JAVA}
|
||||
|
||||
${TARGET_JAVA}: ${OBJ_JAVA}
|
||||
${CC} ${CFLAGS} -o anal_java.${EXT_SO} ${OBJ_JAVA}
|
||||
${CC} $(call libname,anal_java) ${CFLAGS} -o anal_java.${EXT_SO} ${OBJ_JAVA}
|
||||
|
@ -6,5 +6,4 @@ TARGET_MIPS=anal_mips.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_MIPS}
|
||||
|
||||
${TARGET_MIPS}: ${OBJ_MIPS}
|
||||
${CC} ${CFLAGS} -o anal_mips.${EXT_SO} ${OBJ_MIPS}
|
||||
@#strip -s anal_mips.${EXT_SO}
|
||||
${CC} $(call libname,anal_mips) ${CFLAGS} -o anal_mips.${EXT_SO} ${OBJ_MIPS}
|
||||
|
@ -6,5 +6,4 @@ TARGET_PPC=anal_ppc.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_PPC}
|
||||
|
||||
${TARGET_PPC}: ${OBJ_PPC}
|
||||
${CC} -shared ${CFLAGS} -o anal_ppc.${EXT_SO} ${OBJ_PPC}
|
||||
@#strip -s anal_ppc.${EXT_SO}
|
||||
${CC} $(call libname,anal_ppc) ${CFLAGS} -o anal_ppc.${EXT_SO} ${OBJ_PPC}
|
||||
|
@ -6,4 +6,4 @@ TARGET_SH=anal_sh.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_SH}
|
||||
|
||||
${TARGET_SH}: ${OBJ_SH}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o anal_sh.${EXT_SO} ${OBJ_SH}
|
||||
${CC} $(call libname,anal_sh) ${LDFLAGS} ${CFLAGS} -o anal_sh.${EXT_SO} ${OBJ_SH}
|
||||
|
@ -8,5 +8,4 @@ ALL_TARGETS+=${TARGET_X86}
|
||||
CFLAGS+=-D__X86IM_USE_FMT__
|
||||
|
||||
${TARGET_X86}: ${OBJ_X86}
|
||||
${CC} -shared ${CFLAGS} -o anal_x86.${EXT_SO} ${OBJ_X86}
|
||||
@#strip -s anal_x86.${EXT_SO}
|
||||
${CC} $(call libname,anal_x86) ${CFLAGS} -o anal_x86.${EXT_SO} ${OBJ_X86}
|
||||
|
@ -9,4 +9,4 @@ LIBS_X86_SIMPLE=r_anal r_reg r_lib r_syscall r_diff
|
||||
MYLIBS=$(subst r_,-L../../,$(LIBS_X86_SIMPLE))
|
||||
|
||||
${TARGET_X86_SIMPLE}: ${OBJ_X86_SIMPLE}
|
||||
${CC} ${MYLIBS} ${LDFLAGS} ${CFLAGS} -o anal_x86_simple.${EXT_SO} ${OBJ_X86_SIMPLE}
|
||||
${CC} $(call libname,anal_x86_simple) ${MYLIBS} ${LDFLAGS} ${CFLAGS} -o anal_x86_simple.${EXT_SO} ${OBJ_X86_SIMPLE}
|
||||
|
@ -215,7 +215,7 @@ API int armthumb_disassemble(char *buf, unsigned long pc, unsigned int ins) {
|
||||
case 4: imm *= 2; mask = 0xFFFF; break;
|
||||
default: mask = 0xFF; break;
|
||||
}
|
||||
sprintf(buf, "%s %s, [%s, #%d]", op, regname(Rd), regname(Rn), imm);
|
||||
sprintf(buf, "%s %s, [%s, #%d]", op, regname(Rd), regname(Rn), imm&mask);
|
||||
//if (op_code & 1) this->load_reference(r[Rn]+imm, Rd, mask);
|
||||
//else this->store_reference(r[Rn]+imm, r[Rd], mask);
|
||||
// Load & Store, format 2
|
||||
|
@ -367,7 +367,7 @@ int java_classdump(const char *file, int verbose) {
|
||||
check_eof(fd);
|
||||
V printf("Access flags: 0x%04x\n", cf2.access_flags);
|
||||
this_class = r_ntohs(cf2.this_class);
|
||||
V printf("This class: %d\n", cf2.this_class);
|
||||
V printf("This class: %d\n", this_class);
|
||||
check_eof(fd);
|
||||
//printf("This class: %d (%s)\n", ntohs(cf2.this_class), cp_items[ntohs(cf2.this_class)-1].value); // XXX this is a double pointer !!1
|
||||
//printf("Super class: %d (%s)\n", ntohs(cf2.super_class), cp_items[ntohs(cf2.super_class)-1].value);
|
||||
|
@ -999,6 +999,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
|
||||
if (opcode->flags & (F_UNBR|F_CONDBR|F_JSR))
|
||||
{
|
||||
/* FIXME -- check is_annulled flag. */
|
||||
if (is_annulled) { /* do nothing */ }
|
||||
if (opcode->flags & F_UNBR)
|
||||
info->insn_type = dis_branch;
|
||||
if (opcode->flags & F_CONDBR)
|
||||
|
@ -8,4 +8,4 @@ TARGET_ARM=asm_arm.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_ARM}
|
||||
|
||||
${TARGET_ARM}: ${OBJ_ARM}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o asm_arm.${EXT_SO} ${OBJ_ARM}
|
||||
${CC} $(call libname,asm_arm) ${LDFLAGS} ${CFLAGS} -o asm_arm.${EXT_SO} ${OBJ_ARM}
|
||||
|
@ -7,4 +7,5 @@ TARGET_ARMTHUMB=asm_armthumb.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_ARMTHUMB}
|
||||
|
||||
${TARGET_ARMTHUMB}: ${OBJ_ARMTHUMB}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o asm_armthumb.${EXT_SO} ${OBJ_ARMTHUMB}
|
||||
${CC} $(call libname,asm_armthumb) ${LDFLAGS} \
|
||||
${CFLAGS} -o asm_armthumb.${EXT_SO} ${OBJ_ARMTHUMB}
|
||||
|
@ -7,4 +7,5 @@ TARGET_AVR=asm_avr.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_AVR}
|
||||
|
||||
${TARGET_AVR}: ${OBJ_AVR}
|
||||
${CC} ${LDFLAGS} -I../arch/avr ${CFLAGS} -o asm_avr.${EXT_SO} ${OBJ_AVR}
|
||||
${CC} $(call libname,asm_avr) ${LDFLAGS} \
|
||||
-I../arch/avr ${CFLAGS} -o asm_avr.${EXT_SO} ${OBJ_AVR}
|
||||
|
@ -5,4 +5,4 @@ ALL_TARGETS+=${TARGET_BF}
|
||||
STATIC_OBJ+=${OBJ_BF}
|
||||
|
||||
${TARGET_BF}: ${OBJ_BF}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_BF} ${OBJ_BF}
|
||||
${CC} $(call libname,asm_bf) ${LDFLAGS} ${CFLAGS} -o ${TARGET_BF} ${OBJ_BF}
|
||||
|
@ -7,4 +7,4 @@ TARGET_CSR=asm_csr.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_CSR}
|
||||
|
||||
${TARGET_CSR}: ${OBJ_CSR}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o asm_csr.${EXT_SO} ${OBJ_CSR}
|
||||
${CC} $(call libname,asm_csr) ${LDFLAGS} ${CFLAGS} -o asm_csr.${EXT_SO} ${OBJ_CSR}
|
||||
|
@ -6,4 +6,4 @@ TARGET_DALVIK=asm_dalvik.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_DALVIK}
|
||||
|
||||
${TARGET_DALVIK}: ${OBJ_DALVIK}
|
||||
${CC} ${LDFLAGS} -I../arch/dalvik ${CFLAGS} -o asm_dalvik.${EXT_SO} ${OBJ_DALVIK}
|
||||
${CC} $(call libname,asm_dalvik) ${LDFLAGS} -I../arch/dalvik ${CFLAGS} -o asm_dalvik.${EXT_SO} ${OBJ_DALVIK}
|
||||
|
@ -6,4 +6,4 @@ TARGET_X86=asm_gas.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_X86}
|
||||
|
||||
${TARGET_X86}: ${OBJ_X86}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86} ${OBJ_X86}
|
||||
${CC} $(call libname,asm_gas) ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86} ${OBJ_X86}
|
||||
|
@ -8,4 +8,4 @@ TARGET_JAVA=asm_java.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_JAVA}
|
||||
|
||||
${TARGET_JAVA}: ${OBJ_JAVA}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o asm_java.${EXT_SO} ${OBJ_JAVA}
|
||||
${CC} $(call libname,asm_java) ${LDFLAGS} ${CFLAGS} -o asm_java.${EXT_SO} ${OBJ_JAVA}
|
||||
|
@ -9,4 +9,4 @@ ALL_TARGETS+=${TARGET_MIPS}
|
||||
STATIC_OBJ+=${OBJ_MIPS}
|
||||
|
||||
${TARGET_MIPS}: ${OBJ_MIPS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_MIPS} ${OBJ_MIPS}
|
||||
${CC} $(call libname,asm_mips) ${LDFLAGS} ${CFLAGS} -o ${TARGET_MIPS} ${OBJ_MIPS}
|
||||
|
@ -7,4 +7,4 @@ TARGET_MSIL=asm_msil.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_MSIL}
|
||||
|
||||
${TARGET_MSIL}: ${OBJ_MSIL}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o asm_msil.${EXT_SO} ${OBJ_MSIL}
|
||||
${CC} $(call libname,asm_msil) ${LDFLAGS} ${CFLAGS} -o asm_msil.${EXT_SO} ${OBJ_MSIL}
|
||||
|
@ -8,4 +8,4 @@ TARGET_PPC=asm_ppc.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_PPC}
|
||||
|
||||
${TARGET_PPC}: ${OBJ_PPC}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o asm_ppc.${EXT_SO} ${OBJ_PPC}
|
||||
${CC} $(call libname,asm_ppc) ${LDFLAGS} ${CFLAGS} -o asm_ppc.${EXT_SO} ${OBJ_PPC}
|
||||
|
@ -7,4 +7,4 @@ TARGET_PSOSVM=asm_psosvm.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_PSOSVM}
|
||||
|
||||
${TARGET_PSOSVM}: ${OBJ_PSOSVM}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o asm_psosvm.${EXT_SO} ${OBJ_PSOSVM}
|
||||
${CC} $(call libname,asm_psosvm) ${LDFLAGS} ${CFLAGS} -o asm_psosvm.${EXT_SO} ${OBJ_PSOSVM}
|
||||
|
@ -7,4 +7,4 @@ TARGET_SH=asm_sh.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_SH}
|
||||
|
||||
${TARGET_SH}: ${OBJ_SH}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_SH} ${OBJ_SH}
|
||||
${CC} $(call libname,asm_sh) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SH} ${OBJ_SH}
|
||||
|
@ -8,4 +8,4 @@ TARGET_SPARC=asm_sparc.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_SPARC}
|
||||
|
||||
${TARGET_SPARC}: ${OBJ_SPARC}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_SPARC} ${OBJ_SPARC}
|
||||
${CC} $(call libname,asm_sparc) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SPARC} ${OBJ_SPARC}
|
||||
|
@ -14,4 +14,4 @@ TARGET_X86=asm_x86.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_X86}
|
||||
|
||||
${TARGET_X86}: ${OBJ_X86}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86} ${OBJ_X86}
|
||||
${CC} $(call libname,asm_x86) ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86} ${OBJ_X86}
|
||||
|
@ -6,4 +6,4 @@ TARGET_X86_NASM=asm_x86_nasm.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_X86_NASM}
|
||||
|
||||
${TARGET_X86_NASM}: ${OBJ_X86_NASM}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86_NASM} ${OBJ_X86_NASM}
|
||||
${CC} $(call libname,asm_x86_nasm) ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86_NASM} ${OBJ_X86_NASM}
|
||||
|
@ -9,4 +9,4 @@ TARGET_X86_OLLY=asm_x86_olly.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_X86_OLLY}
|
||||
|
||||
${TARGET_X86_OLLY}: ${OBJ_X86_OLLY}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86_OLLY} ${OBJ_X86_OLLY}
|
||||
${CC} $(call libname,asm_x86_olly) ${LDFLAGS} ${CFLAGS} -o ${TARGET_X86_OLLY} ${OBJ_X86_OLLY}
|
||||
|
@ -11,6 +11,7 @@ CFLAGS+=-DCORELIB -Iformat -Imangling
|
||||
include ../config.mk
|
||||
include ${STATIC_BIN_PLUGINS}
|
||||
include ${STATIC_BIN_XTR_PLUGINS}
|
||||
|
||||
STATIC_OBJS=$(subst ..,p/..,$(subst bin_,p/bin_,$(STATIC_OBJ)))
|
||||
OBJ=bin.o bin_meta.o bin_write.o demangle.o ${STATIC_OBJS}
|
||||
OBJ+=mangling/cxx/cp-demangle.o
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <r_util.h>
|
||||
#include "elf.h"
|
||||
|
||||
static ut64 Elf_(r_bin_elf_get_section_size)(struct Elf_(r_bin_elf_obj_t) *bin, const char *section_name);
|
||||
static ut64 Elf_(r_bin_elf_get_section_offset)(struct Elf_(r_bin_elf_obj_t) *bin, const char *section_name);
|
||||
|
||||
static inline int __strnlen(const char *str, int len) {
|
||||
int l = 0;
|
||||
@ -94,31 +94,73 @@ static int Elf_(r_bin_elf_init_shdr)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
}
|
||||
|
||||
static int Elf_(r_bin_elf_init_strtab)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
ut64 size;
|
||||
if (!bin->shdr)
|
||||
return R_FALSE;
|
||||
return R_FALSE;
|
||||
bin->shstrtab_section =
|
||||
bin->strtab_section = &bin->shdr[bin->ehdr.e_shstrndx];
|
||||
bin->strtab_size = size = bin->strtab_section->sh_size;
|
||||
|
||||
if ((bin->strtab = (char *)malloc (size)) == NULL) {
|
||||
bin->shstrtab_size =
|
||||
bin->strtab_size = bin->strtab_section->sh_size;
|
||||
if ((bin->strtab = (char *)malloc (bin->strtab_section->sh_size)) == NULL) {
|
||||
perror ("malloc");
|
||||
return R_FALSE;
|
||||
}
|
||||
if (r_buf_read_at (bin->b, bin->strtab_section->sh_offset, (ut8*)bin->strtab, size) == -1) {
|
||||
bin->shstrtab = bin->strtab;
|
||||
if (r_buf_read_at (bin->b, bin->strtab_section->sh_offset, (ut8*)bin->strtab,
|
||||
bin->strtab_section->sh_size) == -1) {
|
||||
eprintf ("Error: read (strtab)\n");
|
||||
R_FREE (bin->strtab);
|
||||
return R_FALSE;
|
||||
}
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static ut64 Elf_(r_bin_elf_get_section_size)(struct Elf_(r_bin_elf_obj_t) *bin, const char *section_name) {
|
||||
int i;
|
||||
if (!bin->shdr || !bin->strtab)
|
||||
return -1;
|
||||
for (i = 0; i < bin->ehdr.e_shnum; i++) {
|
||||
if (bin->shdr[i].sh_name > bin->shstrtab_section->sh_size)
|
||||
continue;
|
||||
if (!strcmp (&bin->shstrtab[bin->shdr[i].sh_name], section_name))
|
||||
return (ut64)bin->shdr[i].sh_size;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int Elf_(r_bin_elf_init_strtab)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
ut64 size;
|
||||
if (!bin->shdr)
|
||||
return R_FALSE;
|
||||
bin->shstrtab_section = &bin->shdr[bin->ehdr.e_shstrndx];
|
||||
bin->shstrtab_size = size = 4096; //bin->shstrtab_section->sh_size;
|
||||
|
||||
if ((bin->shstrtab = (char *)malloc (size)) == NULL) {
|
||||
perror ("malloc");
|
||||
return R_FALSE;
|
||||
}
|
||||
//eprintf ("BUFBUFBUF %p\n",
|
||||
eprintf ("%p off=%x buf=%p sz=%llx\n",
|
||||
bin->b, bin->shstrtab_section->sh_offset, (ut8*)bin->shstrtab, size);
|
||||
if (r_buf_read_at (bin->b, (ut64)bin->shstrtab_section->sh_offset, (ut8*)bin->shstrtab, size) == -1) {
|
||||
eprintf ("Error: read (strtab)\n");
|
||||
R_FREE (bin->strtab);
|
||||
return R_FALSE;
|
||||
}
|
||||
write (1, "\n\n", 2);
|
||||
write (1, bin->shstrtab, size);
|
||||
write (1, "\n\n", 2);
|
||||
|
||||
size = Elf_(r_bin_elf_get_section_size)(bin, ".strtab");
|
||||
if (size != UT64_MAX) {
|
||||
ut64 off = Elf_(r_bin_elf_get_section_offset)(bin, ".strtab");
|
||||
bin->strtab_size = size;
|
||||
free (bin->strtab);
|
||||
if ((bin->strtab = (char *)malloc (size)) == NULL) {
|
||||
if ((bin->strtab = (char *)malloc (size+1)) == NULL) {
|
||||
perror ("malloc");
|
||||
return R_FALSE;
|
||||
}
|
||||
if (r_buf_read_at (bin->b, bin->strtab_section->sh_offset, (ut8*)bin->strtab, size) == -1) {
|
||||
if (r_buf_read_at (bin->b, off, (ut8*)bin->strtab, size) == -1) {
|
||||
eprintf ("Error: read (strtab)\n");
|
||||
R_FREE (bin->strtab);
|
||||
return R_FALSE;
|
||||
@ -126,6 +168,7 @@ static int Elf_(r_bin_elf_init_strtab)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
}
|
||||
return R_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int Elf_(r_bin_elf_init)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
bin->phdr = NULL;
|
||||
@ -148,27 +191,14 @@ static int Elf_(r_bin_elf_init)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static ut64 Elf_(r_bin_elf_get_section_size)(struct Elf_(r_bin_elf_obj_t) *bin, const char *section_name) {
|
||||
int i;
|
||||
if (!bin->shdr || !bin->strtab)
|
||||
return -1;
|
||||
for (i = 0; i < bin->ehdr.e_shnum; i++) {
|
||||
if (bin->shdr[i].sh_name > bin->strtab_section->sh_size)
|
||||
continue;
|
||||
if (!strcmp (&bin->strtab[bin->shdr[i].sh_name], section_name))
|
||||
return (ut64)bin->shdr[i].sh_size;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static ut64 Elf_(r_bin_elf_get_section_offset)(struct Elf_(r_bin_elf_obj_t) *bin, const char *section_name) {
|
||||
int i;
|
||||
if (!bin->shdr || !bin->strtab)
|
||||
return -1;
|
||||
for (i = 0; i < bin->ehdr.e_shnum; i++) {
|
||||
if (bin->shdr[i].sh_name > bin->strtab_section->sh_size)
|
||||
if (bin->shdr[i].sh_name > bin->shstrtab_section->sh_size)
|
||||
continue;
|
||||
if (!strcmp (&bin->strtab[bin->shdr[i].sh_name], section_name))
|
||||
if (!strcmp (&bin->shstrtab[bin->shdr[i].sh_name], section_name))
|
||||
return (ut64)bin->shdr[i].sh_offset;
|
||||
}
|
||||
return -1;
|
||||
@ -722,8 +752,8 @@ struct r_bin_elf_section_t* Elf_(r_bin_elf_get_sections)(struct Elf_(r_bin_elf_o
|
||||
ret[i].size = bin->shdr[i].sh_size;
|
||||
ret[i].align = bin->shdr[i].sh_addralign;
|
||||
ret[i].flags = bin->shdr[i].sh_flags;
|
||||
strncpy (ret[i].name, bin->strtab?
|
||||
&bin->strtab[bin->shdr[i].sh_name]: "unknown", ELF_STRING_LENGTH);
|
||||
strncpy (ret[i].name, bin->shstrtab?
|
||||
&bin->shstrtab[bin->shdr[i].sh_name]: "unknown", ELF_STRING_LENGTH);
|
||||
ret[i].last = 0;
|
||||
}
|
||||
ret[i].last = 1;
|
||||
|
@ -69,6 +69,9 @@ struct Elf_(r_bin_elf_obj_t) {
|
||||
Elf_(Shdr) *strtab_section;
|
||||
ut64 strtab_size;
|
||||
char* strtab;
|
||||
Elf_(Shdr) *shstrtab_section;
|
||||
ut64 shstrtab_size;
|
||||
char* shstrtab;
|
||||
int bss;
|
||||
int size;
|
||||
ut64 baddr;
|
||||
|
@ -1,8 +1,7 @@
|
||||
include ../../config.mk
|
||||
|
||||
#include ../../../config-user.mk
|
||||
CFLAGS=-I../../include -I../format/ -Wall -fPIC
|
||||
CFLAGS+=${LDFLAGS_LIB}
|
||||
#CFLAGS+=${LDFLAGS_LIB}
|
||||
#CFLAGS=$CCLIB_SHARED
|
||||
CFLAGS+=-L../../util -lr_util
|
||||
|
||||
|
@ -6,5 +6,4 @@ TARGET_DEX=bin_dex.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_DEX}
|
||||
|
||||
${TARGET_DEX}: ${OBJ_DEX}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_DEX} ${OBJ_DEX}
|
||||
@#strip -s ${TARGET_DEX}
|
||||
${CC} $(call libname,bin_dex) -shared ${CFLAGS} -o ${TARGET_DEX} ${OBJ_DEX}
|
||||
|
@ -6,5 +6,4 @@ TARGET_DYLDCACHE=bin_xtr_dyldcache.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_DYLDCACHE}
|
||||
|
||||
${TARGET_DYLDCACHE}: ${OBJ_DYLDCACHE}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_DYLDCACHE} ${OBJ_DYLDCACHE}
|
||||
@#strip -s ${TARGET_DYLDCACHE}
|
||||
${CC} $(call libname,bin_xtr_dyldcache) -shared ${CFLAGS} -o ${TARGET_DYLDCACHE} ${OBJ_DYLDCACHE}
|
||||
|
@ -7,5 +7,4 @@ TARGET_ELF=bin_elf.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_ELF}
|
||||
|
||||
${TARGET_ELF}: ${OBJ_ELF}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_ELF} ${OBJ_ELF}
|
||||
@#strip -s ${TARGET_ELF}
|
||||
${CC} $(call libname,bin_elf) ${CFLAGS} -o ${TARGET_ELF} ${OBJ_ELF}
|
||||
|
@ -7,5 +7,4 @@ TARGET_ELF64=bin_elf64.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_ELF64}
|
||||
|
||||
${TARGET_ELF64}: ${OBJ_ELF64}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_ELF64} ${OBJ_ELF64}
|
||||
@#strip -s ${TARGET_ELF64}
|
||||
${CC} $(call libname,bin_elf64) -shared ${CFLAGS} -o ${TARGET_ELF64} ${OBJ_ELF64}
|
||||
|
@ -6,5 +6,4 @@ TARGET_FATMACH0=bin_xtr_fatmach0.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_FATMACH0}
|
||||
|
||||
${TARGET_FATMACH0}: ${OBJ_FATMACH0}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_FATMACH0} ${OBJ_FATMACH0}
|
||||
@#strip -s ${TARGET_FATMACH0}
|
||||
${CC} $(call libname,bin_xtr_fatmach0) -shared ${CFLAGS} -o ${TARGET_FATMACH0} ${OBJ_FATMACH0}
|
||||
|
@ -6,4 +6,4 @@ TARGET_FS=bin_fs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_FS}
|
||||
|
||||
${TARGET_FS}: ${OBJ_FS}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_FS} ${OBJ_FS}
|
||||
${CC} $(call libname,bin_fs) -shared ${CFLAGS} -o ${TARGET_FS} ${OBJ_FS}
|
||||
|
@ -6,5 +6,4 @@ TARGET_JAVA=bin_java.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_JAVA}
|
||||
|
||||
${TARGET_JAVA}: ${OBJ_JAVA}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_JAVA} ${OBJ_JAVA}
|
||||
@#strip -s ${TARGET_JAVA}
|
||||
${CC} $(call libname,bin_java) ${CFLAGS} -o ${TARGET_JAVA} ${OBJ_JAVA}
|
||||
|
@ -6,5 +6,4 @@ TARGET_MACH0=bin_mach0.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_MACH0}
|
||||
|
||||
${TARGET_MACH0}: ${OBJ_MACH0}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_MACH0} ${OBJ_MACH0}
|
||||
@#strip -s ${TARGET_MACH0}
|
||||
${CC} $(call libname,bin_mach0) ${CFLAGS} -o ${TARGET_MACH0} ${OBJ_MACH0}
|
||||
|
@ -6,5 +6,4 @@ TARGET_MACH064=bin_mach064.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_MACH064}
|
||||
|
||||
${TARGET_MACH064}: ${OBJ_MACH064}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_MACH064} ${OBJ_MACH064}
|
||||
@#strip -s ${TARGET_MACH064}
|
||||
${CC} $(call libname,bin_mach064) -shared ${CFLAGS} -o ${TARGET_MACH064} ${OBJ_MACH064}
|
||||
|
@ -6,5 +6,4 @@ TARGET_PE=bin_pe.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_PE}
|
||||
|
||||
${TARGET_PE}: ${OBJ_PE}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_PE} ${OBJ_PE}
|
||||
@#strip -s ${TARGET_PE}
|
||||
${CC} $(call libname,bin_pe) ${CFLAGS} -o ${TARGET_PE} ${OBJ_PE}
|
||||
|
@ -6,5 +6,4 @@ TARGET_PE64=bin_pe64.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_PE64}
|
||||
|
||||
${TARGET_PE64}: ${OBJ_PE64}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_PE64} ${OBJ_PE64}
|
||||
@#strip -s ${TARGET_PE64}
|
||||
${CC} $(call libname,bin_pe64) ${CFLAGS} -o ${TARGET_PE64} ${OBJ_PE64}
|
||||
|
@ -6,4 +6,4 @@ TARGET_ARM=bp_arm.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_ARM}
|
||||
|
||||
${TARGET_ARM}: ${OBJ_ARM}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_ARM} ${OBJ_ARM}
|
||||
${CC} $(call libname,bp_arm) ${CFLAGS} -o ${TARGET_ARM} ${OBJ_ARM}
|
||||
|
@ -6,4 +6,4 @@ TARGET_MIPS=bp_mips.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_MIPS}
|
||||
|
||||
${TARGET_MIPS}: ${OBJ_MIPS}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_MIPS} ${OBJ_MIPS}
|
||||
${CC} $(call libname,bp_mips) ${CFLAGS} -o ${TARGET_MIPS} ${OBJ_MIPS}
|
||||
|
@ -6,4 +6,4 @@ TARGET_PPC=bp_ppc.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_PPC}
|
||||
|
||||
${TARGET_PPC}: ${OBJ_PPC}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_PPC} ${OBJ_PPC}
|
||||
${CC} $(call libname,bp_ppc) ${CFLAGS} -o ${TARGET_PPC} ${OBJ_PPC}
|
||||
|
@ -6,4 +6,4 @@ TARGET_SH=bp_sh.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_SH}
|
||||
|
||||
${TARGET_SH}: ${OBJ_SH}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_SH} ${OBJ_SH}
|
||||
${CC} $(call libname,bp_sh) ${CFLAGS} -o ${TARGET_SH} ${OBJ_SH}
|
||||
|
@ -6,4 +6,4 @@ TARGET_X86=bp_x86.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_X86}
|
||||
|
||||
${TARGET_X86}: ${OBJ_X86}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_X86} ${OBJ_X86}
|
||||
${CC} $(call libname,bp_x86) ${CFLAGS} -o ${TARGET_X86} ${OBJ_X86}
|
||||
|
@ -6,4 +6,4 @@ TARGET_DUMMY=cmd_dummy.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_DUMMY}
|
||||
|
||||
${TARGET_DUMMY}: ${OBJ_DUMMY}
|
||||
${CC} ${CFLAGS} -o ${TARGET_DUMMY} ${OBJ_DUMMY}
|
||||
${CC} $(call libname,cmd_dummy) ${CFLAGS} -o ${TARGET_DUMMY} ${OBJ_DUMMY}
|
||||
|
@ -84,3 +84,5 @@ endif
|
||||
LIB=lib${NAME}
|
||||
LIBAR=${LIB}.${EXT_AR}
|
||||
LIBSO=${LIB}.${EXT_SO}
|
||||
libname=-shared ${LDFLAGS_SONAME}$1.${EXT_SO}.${LIBVERSION}
|
||||
|
||||
|
@ -6,4 +6,4 @@ TARGET_AES=crypto_aes.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_AES}
|
||||
|
||||
${TARGET_AES}: ${OBJ_AES}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_AES} ${OBJ_AES}
|
||||
${CC} $(call libname,crypto_aes) ${LDFLAGS} ${CFLAGS} -o ${TARGET_AES} ${OBJ_AES}
|
||||
|
@ -23,4 +23,4 @@ TARGET_GDB=debug_gdb.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_GDB}
|
||||
|
||||
${TARGET_GDB}: ${OBJ_GDB}
|
||||
${CC} -shared ${OBJ_GDB} ${CFLAGS} ${LDFLAGS} -o ${TARGET_GDB}
|
||||
${CC} $(call libname,debug_gdb) ${OBJ_GDB} ${CFLAGS} ${LDFLAGS} -o ${TARGET_GDB}
|
||||
|
@ -6,7 +6,7 @@ TARGET_PTRACE=debug_native.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_PTRACE}
|
||||
|
||||
${TARGET_PTRACE}: ${OBJ_PTRACE}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_PTRACE} \
|
||||
${CC} $(call libname,debug_native) ${CFLAGS} -o ${TARGET_PTRACE} \
|
||||
${LDFLAGS_LINKPATH}.. -L.. -lr_debug \
|
||||
${LDFLAGS_LINKPATH}../../lib -L../../lib -lr_lib \
|
||||
${LDFLAGS_LINKPATH}../../io -L../../io -lr_io \
|
||||
|
@ -18,4 +18,4 @@ TARGET_RAP=debug_rap.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_RAP}
|
||||
|
||||
${TARGET_RAP}: ${OBJ_RAP}
|
||||
${CC} -shared ${OBJ_RAP} ${CFLAGS} ${LDFLAGS} -o ${TARGET_RAP}
|
||||
${CC} $(call libname,debug_rap) ${OBJ_RAP} ${CFLAGS} ${LDFLAGS} -o ${TARGET_RAP}
|
||||
|
@ -9,4 +9,4 @@ TARGET_CPIO=fs_cpio.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_CPIO}
|
||||
|
||||
${TARGET_CPIO}: ${OBJ_CPIO}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_CPIO} ${OBJ_CPIO} ${EXTRA}
|
||||
${CC} $(call libname,fs_cpio) ${LDFLAGS} ${CFLAGS} -o ${TARGET_CPIO} ${OBJ_CPIO} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_EXT2=fs_ext2.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_EXT2}
|
||||
|
||||
${TARGET_EXT2}: ${OBJ_EXT2}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_EXT2} ${OBJ_EXT2} ${EXTRA}
|
||||
${CC} $(call libname,fs_ext2) ${LDFLAGS} ${CFLAGS} -o ${TARGET_EXT2} ${OBJ_EXT2} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_FAT=fs_fat.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_FAT}
|
||||
|
||||
${TARGET_FAT}: ${OBJ_FAT}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_FAT} ${OBJ_FAT} ${EXTRA}
|
||||
${CC} $(call libname,fs_fat) ${LDFLAGS} ${CFLAGS} -o ${TARGET_FAT} ${OBJ_FAT} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_FB=fs_fb.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_FB}
|
||||
|
||||
${TARGET_FB}: ${OBJ_FB}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_FB} ${OBJ_FB} ${EXTRA}
|
||||
${CC} $(call libname,fs_fb) ${LDFLAGS} ${CFLAGS} -o ${TARGET_FB} ${OBJ_FB} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_HFS=fs_hfs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_HFS}
|
||||
|
||||
${TARGET_HFS}: ${OBJ_HFS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_HFS} ${OBJ_HFS} ${EXTRA}
|
||||
${CC} $(call libname,fs_hfs) ${LDFLAGS} ${CFLAGS} -o ${TARGET_HFS} ${OBJ_HFS} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_HFSPLUS=fs_hfsplus.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_HFSPLUS}
|
||||
|
||||
${TARGET_HFSPLUS}: ${OBJ_HFSPLUS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_HFSPLUS} ${OBJ_HFSPLUS} ${EXTRA}
|
||||
${CC} $(call libname,fs_hfsplus) ${LDFLAGS} ${CFLAGS} -o ${TARGET_HFSPLUS} ${OBJ_HFSPLUS} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_ISO9660=fs_iso9660.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_ISO9660}
|
||||
|
||||
${TARGET_ISO9660}: ${OBJ_ISO9660}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_ISO9660} ${OBJ_ISO9660} ${EXTRA}
|
||||
${CC} $(call libname,fs_iso9660) ${LDFLAGS} ${CFLAGS} -o ${TARGET_ISO9660} ${OBJ_ISO9660} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_JFS=fs_jfs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_JFS}
|
||||
|
||||
${TARGET_JFS}: ${OBJ_JFS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_JFS} ${OBJ_JFS} ${EXTRA}
|
||||
${CC} $(call libname,fs_jfs) ${LDFLAGS} ${CFLAGS} -o ${TARGET_JFS} ${OBJ_JFS} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_MINIX=fs_minix.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_MINIX}
|
||||
|
||||
${TARGET_MINIX}: ${OBJ_MINIX}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_MINIX} ${OBJ_MINIX} ${EXTRA}
|
||||
${CC} $(call libname,fs_minix) ${LDFLAGS} ${CFLAGS} -o ${TARGET_MINIX} ${OBJ_MINIX} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_NTFS=fs_ntfs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_NTFS}
|
||||
|
||||
${TARGET_NTFS}: ${OBJ_NTFS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_NTFS} ${OBJ_NTFS} ${EXTRA}
|
||||
${CC} $(call libname,fs_ntfs) ${LDFLAGS} ${CFLAGS} -o ${TARGET_NTFS} ${OBJ_NTFS} ${EXTRA}
|
||||
|
@ -6,4 +6,4 @@ TARGET_POSIX=fs_posix.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_POSIX}
|
||||
|
||||
${TARGET_POSIX}: ${OBJ_POSIX}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_POSIX} ${OBJ_POSIX} ${EXTRA}
|
||||
${CC} $(call libname,fs_posix) ${LDFLAGS} ${CFLAGS} -o ${TARGET_POSIX} ${OBJ_POSIX} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_REISERFS=fs_reiserfs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_REISERFS}
|
||||
|
||||
${TARGET_REISERFS}: ${OBJ_REISERFS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_REISERFS} ${OBJ_REISERFS} ${EXTRA}
|
||||
${CC} $(call libname,fs_reiserfs) ${LDFLAGS} ${CFLAGS} -o ${TARGET_REISERFS} ${OBJ_REISERFS} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_SFS=fs_sfs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_SFS}
|
||||
|
||||
${TARGET_SFS}: ${OBJ_SFS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_SFS} ${OBJ_SFS} ${EXTRA}
|
||||
${CC} $(call libname,fs_sfs) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SFS} ${OBJ_SFS} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_TAR=fs_tar.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_TAR}
|
||||
|
||||
${TARGET_TAR}: ${OBJ_TAR}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_TAR} ${OBJ_TAR} ${EXTRA}
|
||||
${CC} $(call libname,fs_tar) ${LDFLAGS} ${CFLAGS} -o ${TARGET_TAR} ${OBJ_TAR} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_UDF=fs_udf.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_UDF}
|
||||
|
||||
${TARGET_UDF}: ${OBJ_UDF}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_UDF} ${OBJ_UDF} ${EXTRA}
|
||||
${CC} $(call libname,fs_udf) ${LDFLAGS} ${CFLAGS} -o ${TARGET_UDF} ${OBJ_UDF} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_UFS=fs_ufs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_UFS}
|
||||
|
||||
${TARGET_UFS}: ${OBJ_UFS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_UFS} ${OBJ_UFS} ${EXTRA}
|
||||
${CC} $(call libname,fs_ufs) ${LDFLAGS} ${CFLAGS} -o ${TARGET_UFS} ${OBJ_UFS} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_UFS2=fs_ufs2.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_UFS2}
|
||||
|
||||
${TARGET_UFS2}: ${OBJ_UFS2}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_UFS2} ${OBJ_UFS2} ${EXTRA}
|
||||
${CC} $(call libname,fs_ufs2) ${LDFLAGS} ${CFLAGS} -o ${TARGET_UFS2} ${OBJ_UFS2} ${EXTRA}
|
||||
|
@ -9,4 +9,4 @@ TARGET_XFS=fs_xfs.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_XFS}
|
||||
|
||||
${TARGET_XFS}: ${OBJ_XFS}
|
||||
${CC} ${LDFLAGS} ${CFLAGS} -o ${TARGET_XFS} ${OBJ_XFS} ${EXTRA}
|
||||
${CC} $(call libname,fs_xfs) ${LDFLAGS} ${CFLAGS} -o ${TARGET_XFS} ${OBJ_XFS} ${EXTRA}
|
||||
|
@ -23,5 +23,5 @@ LINKFLAGS+=${SSL_LDFLAGS}
|
||||
endif
|
||||
|
||||
${TARGET_IODBG}: ${OBJ_IODBG}
|
||||
${CC} -shared -o ${TARGET_IODBG} ${CFLAGS} ${LDFLAGS_LIB} \
|
||||
${CC} $(call libname,io_debug) -o ${TARGET_IODBG} ${CFLAGS} ${LDFLAGS_LIB} \
|
||||
${LINKFLAGS} ${LDFLAGS_LINKPATH}.. -L.. -lr_io ${OBJ_IODBG}
|
||||
|
@ -38,5 +38,5 @@ endif
|
||||
|
||||
# TODO : link against gdbwrapper
|
||||
${TARGET_GDB}: ${OBJ_GDB}
|
||||
${CC} -shared -o ${TARGET_GDB} ${OBJ_GDB} ${CFLAGS} ${LDFLAGS} \
|
||||
${CC} $(call libname,io_gdb) -o ${TARGET_GDB} ${OBJ_GDB} ${CFLAGS} ${LDFLAGS} \
|
||||
${GDBWRAPFILES} ${LINKFLAGS} ${LDFLAGS_LIB}
|
||||
|
@ -21,4 +21,4 @@ LINKFLAGS+=${SSL_LDFLAGS}
|
||||
endif
|
||||
|
||||
${TARGET_HARET}: ${OBJ_HARET}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_HARET} ${OBJ_HARET} ${LINKFLAGS}
|
||||
${CC} $(call libname,io_haret) ${CFLAGS} -o ${TARGET_HARET} ${OBJ_HARET} ${LINKFLAGS}
|
||||
|
@ -15,4 +15,4 @@ LINKFLAGS+=-L.. -L../../lib -lr_lib -lr_io
|
||||
endif
|
||||
|
||||
${TARGET_MACH}: ${OBJ_MACH}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_MACH} ${OBJ_MACH} ${LINKFLAGS}
|
||||
${CC} $(call libname,io_mach) ${CFLAGS} -o ${TARGET_MACH} ${OBJ_MACH} ${LINKFLAGS}
|
||||
|
@ -15,4 +15,4 @@ LINKFLAGS+=-L.. -L../../lib -lr_lib -lr_io
|
||||
endif
|
||||
|
||||
${TARGET_MALLOC}: ${OBJ_MALLOC}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_MALLOC} ${OBJ_MALLOC} ${LINKFLAGS}
|
||||
${CC} $(call libname,io_malloc) ${CFLAGS} -o ${TARGET_MALLOC} ${OBJ_MALLOC} ${LINKFLAGS}
|
||||
|
@ -6,7 +6,7 @@ ALL_TARGETS+=${TARGET_PROCPID}
|
||||
|
||||
${TARGET_PROCPID}: ${OBJ_PROCPID}
|
||||
${CC} ${CFLAGS} -o ${TARGET_PROCPID} ${LDFLAGS_LIB} \
|
||||
-shared \
|
||||
$(call libname,io_procpid) \
|
||||
${LDFLAGS_LINKPATH}../../util -L../../util -lr_util \
|
||||
${LDFLAGS_LINKPATH}.. -L.. -L../../lib -lr_lib -lr_io \
|
||||
${OBJ_PROCPID}
|
||||
|
@ -6,7 +6,7 @@ ALL_TARGETS+=${TARGET_PTRACE}
|
||||
|
||||
${TARGET_PTRACE}: ${OBJ_PTRACE}
|
||||
${CC} ${CFLAGS} -o ${TARGET_PTRACE} ${LDFLAGS_LIB} \
|
||||
-shared \
|
||||
$(call libname,io_ptrace) \
|
||||
${LDFLAGS_LINKPATH}../../util -L../../util -lr_util \
|
||||
${LDFLAGS_LINKPATH}.. -L.. -L../../lib -lr_lib -lr_io \
|
||||
${OBJ_PTRACE}
|
||||
|
@ -5,7 +5,8 @@ TARGET_RAP=io_rap.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_RAP}
|
||||
|
||||
${TARGET_RAP}: ${OBJ_RAP}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_RAP} ${OBJ_RAP} \
|
||||
${CC} ${CFLAGS} -o ${TARGET_RAP} ${OBJ_RAP} \
|
||||
$(call libname,io_rap) \
|
||||
${LDFLAGS_LINKPATH}../../socket -L../../socket -lr_socket \
|
||||
${LDFLAGS_LINKPATH}../../util -L../../util -lr_util \
|
||||
${LDFLAGS_LINKPATH}../../cons -L../../cons -lr_cons \
|
||||
|
@ -15,4 +15,4 @@ LINKFLAGS+=-L.. -L../../lib -lr_lib -lr_io
|
||||
endif
|
||||
|
||||
${TARGET_SHM}: ${OBJ_SHM}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_SHM} ${OBJ_SHM} ${LINKFLAGS}
|
||||
${CC} $(call libname,io_shm) ${CFLAGS} -o ${TARGET_SHM} ${OBJ_SHM} ${LINKFLAGS}
|
||||
|
@ -5,4 +5,4 @@ TARGET_W32=io_w32.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_W32}
|
||||
|
||||
${TARGET_W32}: ${OBJ_W32}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_W32} ${OBJ_W32} -lr_io
|
||||
${CC} $(call libname,io_w32) ${CFLAGS} -o ${TARGET_W32} ${OBJ_W32} -lr_io
|
||||
|
@ -5,4 +5,4 @@ TARGET_W32DBG=io_w32dbg.${EXT_SO}
|
||||
ALL_TARGETS+=${TARGET_W32DBG}
|
||||
|
||||
${TARGET_W32DBG}: ${OBJ_W32DBG}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_W32DBG} ${OBJ_W32DBG}
|
||||
${CC} $(call libname,io_w32dbg) ${CFLAGS} -o ${TARGET_W32DBG} ${OBJ_W32DBG}
|
||||
|
@ -5,5 +5,4 @@ ALL_TARGETS+=${TARGET_MREPLACE}
|
||||
STATIC_OBJ+=${OBJ_MREPLACE}
|
||||
|
||||
${TARGET_MREPLACE}: ${OBJ_MREPLACE}
|
||||
${CC} -shared ${CFLAGS} -o ${TARGET_MREPLACE} ${OBJ_MREPLACE}
|
||||
@#strip -s asm_dummy.${EXT_SO}
|
||||
${CC} $(call libname,parse_mreplace) ${CFLAGS} -o ${TARGET_MREPLACE} ${OBJ_MREPLACE}
|
||||
|
@ -64,7 +64,6 @@ char *mreplace(char *string, char *se,char *rep) {
|
||||
regex_t re;
|
||||
size_t nmatch = 16;
|
||||
regmatch_t pm[nmatch];
|
||||
char *p;
|
||||
unsigned long offset = 0;
|
||||
char field[16];
|
||||
char *res;
|
||||
@ -78,7 +77,6 @@ char *mreplace(char *string, char *se,char *rep) {
|
||||
search = memStringReserve(se,INPUTLINE_BUFFER_REPLACE_SIZE);
|
||||
|
||||
sreplace(search->address,"\\d","[0-9]",1,INPUTLINE_BUFFER_REPLACE_SIZE);
|
||||
p=(char*)string;
|
||||
|
||||
#if MDEBUG2
|
||||
sData=strdup(string);
|
||||
@ -105,8 +103,7 @@ char *mreplace(char *string, char *se,char *rep) {
|
||||
(int)(size_t)(pm[0].rm_eo - pm[0].rm_so), &string[pm[0].rm_so]);//,&string[pm[0].rm_so]);
|
||||
#if MDEBUG3
|
||||
printf("------->> found \"%s\" length => %d offset[%d]\n",
|
||||
found->address,
|
||||
strlen(temp->address),offset);
|
||||
found->address, strlen(temp->address),offset);
|
||||
#endif
|
||||
sreplace(temp->address+offset,found->address,rep,0,INPUTLINE_BUFFER_REPLACE_SIZE-offset);
|
||||
for(i=1;i<nmatch;i++){
|
||||
|
@ -5,5 +5,4 @@ ALL_TARGETS+=${TARGET_X86PSEUDO}
|
||||
STATIC_OBJ+=${OBJ_X86PSEUDO}
|
||||
|
||||
${TARGET_X86PSEUDO}: ${OBJ_X86PSEUDO}
|
||||
${CC} -L../../util -lr_util -shared ${CFLAGS} -o ${TARGET_X86PSEUDO} ${OBJ_X86PSEUDO}
|
||||
@#strip -s asm_dummy.${EXT_SO}
|
||||
${CC} $(call libname,parse_x86_pseudo) -L../../util -lr_util -shared ${CFLAGS} -o ${TARGET_X86PSEUDO} ${OBJ_X86PSEUDO}
|
||||
|
@ -69,10 +69,8 @@ R_API int r_buf_append_bytes(RBuffer *b, const ut8 *buf, int length) {
|
||||
|
||||
static int r_buf_cpy(RBuffer *b, ut64 addr, ut8 *dst, const ut8 *src, int len, int write) {
|
||||
int end;
|
||||
if (addr == R_BUF_CUR)
|
||||
addr = b->cur;
|
||||
else addr -= b->base;
|
||||
if (addr > b->length)
|
||||
addr = (addr==R_BUF_CUR)? b->cur: addr-b->base;
|
||||
if (dst == NULL || addr > b->length)
|
||||
return -1;
|
||||
end = (int)(addr+len);
|
||||
if (end > b->length)
|
||||
|
@ -34,7 +34,7 @@ Show output in radare format
|
||||
.It Fl z
|
||||
Show strings inside .data section (like gnu strings does)
|
||||
.It Fl v
|
||||
Enable verbosity
|
||||
Display virtual addressing offsets
|
||||
.It Fl h
|
||||
Show usage help message.
|
||||
.El
|
||||
|
@ -19,7 +19,9 @@ LDFLAGS_LIB=-dynamiclib
|
||||
LDFLAGS_SONAME=-Wl,-install_name,
|
||||
else
|
||||
LDFLAGS_LIB=-shared
|
||||
LDFLAGS_LIB+=-Wl,-soname,lib${NAME}.${EXT_SO}.${VERSION}
|
||||
#ifneq (${NAME},)
|
||||
#LDFLAGS_LIB+=-Wl,-soname,lib${NAME}.${EXT_SO}.${VERSION}
|
||||
#endif
|
||||
LDFLAGS_SONAME=-Wl,-soname=
|
||||
endif
|
||||
|
||||
|
@ -1,4 +1,9 @@
|
||||
-include config.mk
|
||||
ifneq ($(shell tar --help|grep gnu.org),)
|
||||
TAR=tar -czv --format=posix -f
|
||||
else
|
||||
TAR=tar -czvf
|
||||
endif
|
||||
|
||||
LANGS=python perl ruby lua go java guile gear gir
|
||||
|
||||
@ -43,7 +48,7 @@ dist:
|
||||
CXXFILES=`cd .. ; find swig | grep -e cxx$$ -e py$$ | sed -e "s,swig/,$${PKG}/,"` ; \
|
||||
cd .. && mv swig $${PKG} && \
|
||||
echo $$FILES ; \
|
||||
tar czvf $${PKG}.tar.gz $${FILES} $${CXXFILES} ; \
|
||||
${TAR} $${PKG}.tar.gz $${FILES} $${CXXFILES} ; \
|
||||
mv $${PKG} swig
|
||||
|
||||
# TODO: valadoc
|
||||
|
@ -48,7 +48,7 @@ public class RAsm {
|
||||
}
|
||||
|
||||
[CCode (cname="RAsmOp", destroy_function="", unref_function="")]
|
||||
public class Op {
|
||||
public struct Op {
|
||||
public int inst_len;
|
||||
public uint8 *buf;
|
||||
public string buf_asm;
|
||||
|
Loading…
Reference in New Issue
Block a user