mirror of
https://github.com/radareorg/radare.git
synced 2026-11-07 06:36:03 -10:00
* Huge dewarnification on x86-64 archlinux
* Build lua only when lua.h and liblua is found
This commit is contained in:
1 parent
e84f89a2c4
commit
8a12b6a04a
38 files changed
+142
-105
No files matched your search
@@ -1,2 +1,9 @@
|
||||
#!/bin/sh
|
||||
acr -p
|
||||
if [ $? = 0 ]; then
|
||||
echo "No 'acr' found. You can download it from:"
|
||||
echo " http://www.lolcathost.org/b/acr-0.7.2.tar.gz"
|
||||
exit 1
|
||||
else
|
||||
exit $?
|
||||
fi
|
||||
@@ -8,6 +8,7 @@ CFLAGS=@CFLAGS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
JAVAC=javac -source 1.5 -Xlint:unchecked
|
||||
|
||||
HAVE_LUA_H=@HAVE_LUA_H@
|
||||
HAVE_LIB_PYTHON2_5=@HAVE_LIB_PYTHON2_5@
|
||||
HAVE_LIB_PYTHON2_6=@HAVE_LIB_PYTHON2_6@
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ parse_options $1
|
||||
shift
|
||||
done
|
||||
|
||||
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS LDFLAGS HAVE_LANG_C CXX CXXFLAGS HAVE_LANG_CXX LIL_ENDIAN BIG_ENDIAN BYTEORDER HAVE_LIB_DL DL_LIBS SOLARIS DARWIN SHARED_EXT SHARED_CFLAGS WINDOWS READLINE HAVE_RL_COMPLETION_MATCHES RADARE_LIBS HAVE_LIB_READLINE HAVE_USB_H USBSNF NONFREE DEBUGGER JAVA WII W32 SYSPROXY RUBY RUBY_VERSION PYTHON HAVE_LANG_PYTHON HAVE_INSTALL VALA HAVE_VALAC VALAC HAVE_VALA_1_0_VERSION_0_5_0 _CFLAGS SIZEOF_OFF_T HAVE_LIB_EWF WANT_EWF HAVE_LIB_PYTHON2_5 HAVE_LIB_PYTHON2_6 MAEMO HAVE_GUI GTK_FLAGS GTK_LIBS HAVE_PKGCFG_GTK_2_0 VTE_FLAGS VTE_LIBS HAVE_PKGCFG_VTE HAVE_VALA LUA HAVE_LANG_LUA LUA_LIBS HAVE_LIB_LUA HAVE_LIB_LUA5_1"
|
||||
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS LDFLAGS HAVE_LANG_C CXX CXXFLAGS HAVE_LANG_CXX LIL_ENDIAN BIG_ENDIAN BYTEORDER HAVE_LIB_DL DL_LIBS SOLARIS DARWIN SHARED_EXT SHARED_CFLAGS WINDOWS READLINE HAVE_RL_COMPLETION_MATCHES RADARE_LIBS HAVE_LIB_READLINE HAVE_USB_H USBSNF NONFREE DEBUGGER JAVA WII W32 SYSPROXY RUBY RUBY_VERSION PYTHON HAVE_LANG_PYTHON HAVE_INSTALL VALA HAVE_VALAC VALAC HAVE_VALA_1_0_VERSION_0_5_0 _CFLAGS SIZEOF_OFF_T HAVE_LIB_EWF WANT_EWF HAVE_LIB_PYTHON2_5 HAVE_LIB_PYTHON2_6 MAEMO HAVE_GUI GTK_FLAGS GTK_LIBS HAVE_PKGCFG_GTK_2_0 VTE_FLAGS VTE_LIBS HAVE_PKGCFG_VTE HAVE_VALA HAVE_LUA_H LUA HAVE_LANG_LUA LUA_LIBS HAVE_LIB_LUA HAVE_LIB_LUA5_1"
|
||||
|
||||
create_environ
|
||||
|
||||
@@ -552,6 +552,8 @@ if [ "$HAVE_GUI" = "0" ]; then
|
||||
export VALAC="0"
|
||||
export HAVE_VALA="0"
|
||||
echo " Vala build disabled, no gtk-dev or libvte-dev found" >&2 ; fi
|
||||
check_include HAVE_LUA_H lua.h 0
|
||||
|
||||
printf "checking for lua... "
|
||||
HAVE_LANG_LUA=0
|
||||
${LUA} -v > /dev/null 2>&1
|
||||
|
||||
@@ -129,6 +129,7 @@ IFNOT HAVE_GUI {
|
||||
ECHO Vala build disabled, no gtk-dev or libvte-dev found ;
|
||||
}
|
||||
|
||||
CHKINC lua.h
|
||||
LANG_LUA
|
||||
|
||||
REPORT HAVE_GUI WII LUA_LIBS HAVE_LIB_LUA MAEMO VALA JAVA USBSNF SYSPROXY DEBUGGER HAVE_LIB_EWF HAVE_LIB_READLINE ;
|
||||
|
||||
@@ -111,7 +111,7 @@ usb_dev_handle *usb_open(struct usb_device *dev)
|
||||
usb_dev_handle *ret;
|
||||
fprintf(stderr, "USBSNF: usb_open(%s, %d);\n", dev->filename, dev->devnum);
|
||||
ret = __usb_open(dev);
|
||||
fprintf(stderr, "USBSNF: return = %x\n", (int)ret);
|
||||
fprintf(stderr, "USBSNF: return = %p\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ int usb_close(struct usb_dev_handle *dev)
|
||||
{
|
||||
int ret;
|
||||
fprintf(stderr, "USBSNF: usb_close()\n");
|
||||
fprintf(stderr, "USBSNF: handle = %x\n", (unsigned int)dev);
|
||||
fprintf(stderr, "USBSNF: handle = %p\n", dev);
|
||||
ret = __usb_close(dev);
|
||||
fprintf(stderr, "USBSNF: return = %d\n", ret);
|
||||
return ret;
|
||||
@@ -138,7 +138,7 @@ int usb_bulk_write(usb_dev_handle *dev, int ep, const char *bytes, int size, int
|
||||
{
|
||||
int ret;
|
||||
fprintf(stderr, "USBSNF: usb_bulk_write()\n");
|
||||
fprintf(stderr, "USBSNF: handle = %x\n", (unsigned int)dev);
|
||||
fprintf(stderr, "USBSNF: handle = %p\n", dev);
|
||||
fprintf(stderr, "USBSNF: ep = %d\n", ep);
|
||||
fprintf(stderr, "USBSNF: size = %d\n", size);
|
||||
fprintf(stderr, "USBSNF: timeout = %d\n", timeout);
|
||||
@@ -152,7 +152,7 @@ int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, int timeou
|
||||
{
|
||||
int ret;
|
||||
fprintf(stderr, "USBSNF: usb_bulk_read()\n");
|
||||
fprintf(stderr, "USBSNF: handle = %x\n", (unsigned int)dev);
|
||||
fprintf(stderr, "USBSNF: handle = %p\n", dev);
|
||||
fprintf(stderr, "USBSNF: ep = %d\n", ep);
|
||||
fprintf(stderr, "USBSNF: size = %d\n", size);
|
||||
fprintf(stderr, "USBSNF: timeout = %d\n", timeout);
|
||||
@@ -167,7 +167,7 @@ int usb_control_msg(usb_dev_handle *dev, int requesttype, int request,
|
||||
{
|
||||
int ret;
|
||||
fprintf(stderr, "USBSNF: usb_control_msg()\n");
|
||||
fprintf(stderr, "USBSNF: handle = %x\n", (unsigned int)dev);
|
||||
fprintf(stderr, "USBSNF: handle = %p\n", dev);
|
||||
fprintf(stderr, "USBSNF: request_type = %d (%s)\n", requesttype, (requesttype==64)?"read":"write");
|
||||
fprintf(stderr, "USBSNF: request = %d\n", request);
|
||||
fprintf(stderr, "USBSNF: value = %d\n", value);
|
||||
@@ -191,7 +191,7 @@ int usb_claim_interface(usb_dev_handle *dev, int interface)
|
||||
{
|
||||
int ret;
|
||||
fprintf(stderr, "USBSNF: usb_claim_interface()\n");
|
||||
fprintf(stderr, "USBSNF: handle = %x\n", (unsigned int)dev);
|
||||
fprintf(stderr, "USBSNF: handle = %p\n", dev);
|
||||
fprintf(stderr, "USBSNF: interface = %d\n", interface);
|
||||
|
||||
ret = __usb_claim_interface(dev, interface);
|
||||
@@ -203,7 +203,7 @@ int usb_set_altinterface(usb_dev_handle *dev, int alternate)
|
||||
{
|
||||
int ret;
|
||||
fprintf(stderr, "USBSNF: usb_set_altinterface()\n");
|
||||
fprintf(stderr, "USBSNF: handle = %x\n", (unsigned int)dev);
|
||||
fprintf(stderr, "USBSNF: handle = %p\n", dev);
|
||||
fprintf(stderr, "USBSNF: alternate = %d\n", alternate);
|
||||
|
||||
ret = __usb_set_altinterface(dev, alternate);
|
||||
|
||||
@@ -57,7 +57,6 @@ JAVASM_STUFF=w32utils.o -lwsock32
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
.c.o:
|
||||
@echo 'Compiling $<'
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
#udis86
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ struct reflines_t *code_lines_init(int linescall)
|
||||
{
|
||||
struct reflines_t *list = (struct reflines_t*)malloc(sizeof(struct reflines_t));
|
||||
struct reflines_t *list2;
|
||||
int bar = (int)config_get("asm.linesout");
|
||||
int bar = PTRCAST (config_get("asm.linesout"));
|
||||
unsigned char *ptr = config.block;
|
||||
unsigned char *end = config.block + config.block_size;
|
||||
struct aop_t aop;
|
||||
|
||||
@@ -3029,7 +3029,7 @@ void print_disp(dis_buffer_t *dbuf, int disp, int sz, int rel, int dd)
|
||||
disp = (int)((short)disp);
|
||||
if (rel == -1) {
|
||||
/*phx - use sval to print real destination address */
|
||||
nv = disp + (u_int)dbuf->sval + 2*(dd+1);
|
||||
nv = disp + (u_int)(size_t)dbuf->sval + 2*(dd+1);
|
||||
printu(dbuf, nv, SIZE_LONG);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -113,7 +113,7 @@ int arch_mips_aop(ut64 addr, const unsigned char *bytes, struct aop_t *aop)
|
||||
if (aop == NULL)
|
||||
return (mips_mode==16)?2:4;
|
||||
|
||||
endian_memcpy_e((ut8*)&op, bytes, 4, (int)config_get("cfg.bigendian"));
|
||||
endian_memcpy_e((ut8*)&op, bytes, 4, PTRCAST (config_get("cfg.bigendian")));
|
||||
memset(aop, '\0', sizeof(struct aop_t));
|
||||
//of &=0x3f;
|
||||
|
||||
|
||||
@@ -39,17 +39,19 @@ static void print_address(bfd_vma address, struct disassemble_info *info)
|
||||
sprintf(tmp, "0x%08llx", (ut64)address-8); /* WTF ?!?! why gnu disasm doesnt do this well? */
|
||||
strcat(buf_global, tmp);
|
||||
}
|
||||
static void buf_fprintf(FILE *stream, const char *format, ...)
|
||||
static int buf_fprintf(void *stream, const char *format, ...)
|
||||
{
|
||||
int ret = 0;
|
||||
va_list ap;
|
||||
char *tmp , *tmp2;
|
||||
if (buf_global == NULL)
|
||||
return;
|
||||
va_start(ap, format);
|
||||
tmp2 = alloca(strlen(format)+strlen(buf_global)+2);
|
||||
sprintf(tmp2, "%s%s", buf_global, format);
|
||||
vsprintf(buf_global, tmp2, ap);
|
||||
va_end(ap);
|
||||
if (buf_global != NULL) {
|
||||
va_start(ap, format);
|
||||
tmp2 = alloca(strlen(format)+strlen(buf_global)+2);
|
||||
sprintf(tmp2, "%s%s", buf_global, format);
|
||||
ret = vsprintf(buf_global, tmp2, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Disassembler entry point */
|
||||
@@ -80,7 +82,7 @@ int gnu_dismips_str(char *str, const u8 *inst, ut64 offset)
|
||||
info.buffer_vma = Offset;
|
||||
info.buffer_length = 4;
|
||||
info.endian = 0;//config_get_i("cfg.bigendian");
|
||||
info.fprintf_func = &buf_fprintf;
|
||||
info.fprintf_func = buf_fprintf;
|
||||
//info.fprintf_func = &cons_fprintf;
|
||||
info.stream = stdout;
|
||||
|
||||
|
||||
@@ -37,17 +37,19 @@ static void print_address(bfd_vma address, struct disassemble_info *info)
|
||||
sprintf(tmp, "0x%08llx", (ut64)address-8); /* WTF ?!?! why gnu disasm doesnt do this well? */
|
||||
strcat(buf_global, tmp);
|
||||
}
|
||||
static void buf_fprintf(FILE *stream, const char *format, ...)
|
||||
static int buf_fprintf(void *stream, const char *format, ...)
|
||||
{
|
||||
int ret = 0;
|
||||
va_list ap;
|
||||
char *tmp , *tmp2;
|
||||
if (buf_global == NULL)
|
||||
return;
|
||||
va_start(ap, format);
|
||||
tmp2 = alloca(strlen(format)+strlen(buf_global)+2);
|
||||
sprintf(tmp2, "%s%s", buf_global, format);
|
||||
vsprintf(buf_global, tmp2, ap);
|
||||
va_end(ap);
|
||||
if (buf_global != NULL) {
|
||||
va_start(ap, format);
|
||||
tmp2 = alloca(strlen(format)+strlen(buf_global)+2);
|
||||
sprintf(tmp2, "%s%s", buf_global, format);
|
||||
ret = vsprintf(buf_global, tmp2, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Disassembler entry point */
|
||||
|
||||
@@ -40,17 +40,19 @@ static void print_address(bfd_vma address, struct disassemble_info *info)
|
||||
sprintf(tmp, "0x%08llx", (ut64)address);
|
||||
strcat(buf_global, tmp);
|
||||
}
|
||||
static void buf_fprintf(FILE *stream, const char *format, ...)
|
||||
static int buf_fprintf(void *stream, const char *format, ...)
|
||||
{
|
||||
int ret = 0;
|
||||
va_list ap;
|
||||
char *tmp , *tmp2;
|
||||
if (buf_global == NULL)
|
||||
return;
|
||||
va_start(ap, format);
|
||||
tmp2 = alloca(strlen(format)+strlen(buf_global)+2);
|
||||
sprintf(tmp2, "%s%s", buf_global, format);
|
||||
vsprintf(buf_global, tmp2, ap);
|
||||
va_end(ap);
|
||||
if (buf_global != NULL) {
|
||||
va_start(ap, format);
|
||||
tmp2 = alloca(strlen(format)+strlen(buf_global)+2);
|
||||
sprintf(tmp2, "%s%s", buf_global, format);
|
||||
ret = vsprintf(buf_global, tmp2, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Disassembler entry point */
|
||||
|
||||
+1
-1
@@ -482,7 +482,7 @@ void radis_str(int arch, const u8 *block, int len, int rows, const char *cmd_asm
|
||||
int folder = 0; // folder level
|
||||
|
||||
// XXX
|
||||
endian = (int) config_get("cfg.bigendian");
|
||||
endian = (int)(size_t) config_get("cfg.bigendian");
|
||||
show_nbytes = (int) config_get_i("asm.nbytes");
|
||||
if (show_nbytes>16 ||show_nbytes<0)
|
||||
show_nbytes = 16;
|
||||
|
||||
+2
-2
@@ -354,7 +354,7 @@ void config_eval(char *str)
|
||||
const char * str = config_get(foo);
|
||||
if (config_get_notfound)
|
||||
config_list(name);
|
||||
else cons_printf("%s\n", (((int)str)==1)?"true":(str==0)?"false":str);
|
||||
else cons_printf("%s\n", ((PTRCAST (str))==1)?"true":(str==0)?"false":str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@ void config_init(int first)
|
||||
config_set("dbg.hwbp", "true"); // hardware breakpoints by default // ALSO BSD
|
||||
#endif
|
||||
config_set("dbg.bep", "loader"); // loader, main
|
||||
config_set("dir.home", (const char *)get_home_directory());
|
||||
config_set("dir.home", get_home_directory());
|
||||
|
||||
/* dir.monitor */
|
||||
ptr = getenv("MONITORPATH");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _INCLUDE_CONFIG_H_
|
||||
#define _INCLUDE_CONFIG_H_
|
||||
|
||||
#define PTRCAST(x) ((int)(size_t)x)
|
||||
#include "radare.h"
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#define _GNU_SOURCE
|
||||
@@ -14,6 +15,7 @@
|
||||
#define VISUAL_PROMPT ":> "
|
||||
#define DEFAULT_BLOCK_SIZE 512
|
||||
|
||||
|
||||
enum mode_t {
|
||||
MODE_SHELL = 0,
|
||||
MODE_HEXDUMP = 2,
|
||||
|
||||
+1
-1
@@ -789,7 +789,7 @@ void data_reflines_init(int lines, int linescall)
|
||||
|
||||
int data_printd(int delta)
|
||||
{
|
||||
int show_lines = (int)config_get("asm.lines");
|
||||
int show_lines = PTRCAST (config_get("asm.lines"));
|
||||
ut64 offset = (ut64)config.seek + (ut64)delta;// - config.vaddr;
|
||||
int lines = 0;
|
||||
const char *ptr;
|
||||
|
||||
+16
-6
@@ -101,15 +101,14 @@ int debug_register_list()
|
||||
|
||||
ut64 arch_syscall(int pid, int sc, ...)
|
||||
{
|
||||
long long ret = (off_t)-1;
|
||||
#if __linux__
|
||||
va_list ap;
|
||||
long long ret = (off_t)-1;
|
||||
regs_t reg, reg_saved;
|
||||
int baksz = 128;
|
||||
int status;
|
||||
char bak[128];
|
||||
long long addr;
|
||||
char *arg;
|
||||
char *file;
|
||||
|
||||
//printf("Seek pid=%d, fd=%d, addr=%08llx, whence=%d\n", pid,fd, addr, whence);
|
||||
@@ -127,8 +126,7 @@ ut64 arch_syscall(int pid, int sc, ...)
|
||||
/* set syscall */
|
||||
R_RAX(reg) = sc;
|
||||
|
||||
arg = (char*) ≻
|
||||
va_start(ap, arg);
|
||||
va_start(ap, sc);
|
||||
switch(sc) {
|
||||
case SYS_gettid:
|
||||
break;
|
||||
@@ -205,7 +203,6 @@ ut64 arch_syscall(int pid, int sc, ...)
|
||||
#else
|
||||
eprintf("not yet for this platform\n");
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1496,7 +1493,20 @@ ut64 get_reg(const char *reg)
|
||||
|
||||
void arch_view_bt(struct list_head *sf)
|
||||
{
|
||||
#warning "FIXME: code is missing"
|
||||
//#warning "FIXME: code is missing"
|
||||
char label[256];
|
||||
struct list_head *pos;
|
||||
struct sf_t *sf_e;
|
||||
int i = 0;
|
||||
|
||||
list_for_each(pos, sf) {
|
||||
sf_e = list_entry(pos, struct sf_t, next);
|
||||
label[0] = '\0';
|
||||
string_flag_offset(NULL, (char *)&label, sf_e->ret_addr, 0);
|
||||
cons_printf("%02d 0x%08llx (framesz=%03d varsz=%d) %s\n",
|
||||
i++, (ut64)sf_e->ret_addr,
|
||||
(uint)sf_e->sz, (uint)sf_e->vars_sz, label);
|
||||
}
|
||||
}
|
||||
|
||||
void free_bt(struct list_head *sf)
|
||||
|
||||
+12
-13
@@ -81,7 +81,7 @@ int debug_syms()
|
||||
// TODO : stupid helper
|
||||
int getv()
|
||||
{
|
||||
return (int)config_get("cfg.verbose");
|
||||
return PTRCAST (config_get("cfg.verbose"));
|
||||
#if 0
|
||||
char *ptr = config_get("cfg.verbose");
|
||||
if (ptr&&ptr[0]=='1')
|
||||
@@ -392,10 +392,9 @@ int debug_init()
|
||||
int debug_print_maps(char *arg)
|
||||
{
|
||||
if(debug_init_maps(1) == 0) {
|
||||
print_maps_regions((int)strchr(arg, '*'), arg[0]=='?');
|
||||
print_maps_regions(PTRCAST (strchr(arg, '*')), arg[0]=='?');
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -639,11 +638,11 @@ int debug_contum(const char *input)
|
||||
struct aop_t aop;
|
||||
ut64 pc;
|
||||
char a[32];
|
||||
int ilen, dotrace = (int)config_get("trace.log");
|
||||
ut64 base = 0, len = 0;
|
||||
u8 *buf = alloc_usercode(&base, &len);
|
||||
int ilen, dotrace = PTRCAST (config_get ("trace.log"));
|
||||
ut64 base = 0LL, len = 0LL;
|
||||
u8 *buf = alloc_usercode (&base, &len);
|
||||
if (buf == NULL) {
|
||||
eprintf("No user code?\n");
|
||||
eprintf ("No user code?\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1192,12 +1191,12 @@ int debug_trace(char *input)
|
||||
// TODO: file.trace ???
|
||||
// TODO: show stack and backtrace only when is different
|
||||
int counter = 0;
|
||||
int tbt = (int)config_get("trace.bt");
|
||||
long slip = (int)config_get_i("trace.sleep");
|
||||
int smart = (int)config_get("trace.smart");
|
||||
int tracebps = (int)config_get("trace.bps");
|
||||
int tracelibs = (int)config_get("trace.libs");
|
||||
int tracecalls = (int)config_get("trace.calls");
|
||||
int tbt = PTRCAST (config_get("trace.bt"));
|
||||
long slip = PTRCAST (config_get_i("trace.sleep"));
|
||||
int smart = PTRCAST (config_get("trace.smart"));
|
||||
int tracebps = PTRCAST (config_get("trace.bps"));
|
||||
int tracelibs = PTRCAST (config_get("trace.libs"));
|
||||
int tracecalls = PTRCAST (config_get("trace.calls"));
|
||||
const char *cmdtrace = config_get("cmd.trace");
|
||||
int level = atoi(input+1);
|
||||
unsigned long pc;
|
||||
|
||||
+8
-8
@@ -107,10 +107,10 @@ int debug_dumpall(const char *ptr)
|
||||
|
||||
int process_dump(const char *dir)
|
||||
{
|
||||
int regs = (int)config_get("dump.regs");
|
||||
int user = (int)config_get("dump.user");
|
||||
int libs = (int)config_get("dump.libs");
|
||||
int fds = (int)config_get("dump.fds");
|
||||
int regs = PTRCAST (config_get("dump.regs"));
|
||||
int user = PTRCAST (config_get("dump.user"));
|
||||
int libs = PTRCAST (config_get("dump.libs"));
|
||||
int fds = PTRCAST (config_get("dump.fds"));
|
||||
|
||||
if (strnull(dir)) {
|
||||
sprintf(dumpdir, "dump%d", dump_num);
|
||||
@@ -152,10 +152,10 @@ int process_dump(const char *dir)
|
||||
|
||||
int process_restore(const char *dir)
|
||||
{
|
||||
int regs = (int)config_get("dump.regs");
|
||||
int user = (int)config_get("dump.user");
|
||||
int libs = (int)config_get("dump.libs");
|
||||
int fds = (int)config_get("dump.fds");
|
||||
int regs = PTRCAST (config_get("dump.regs"));
|
||||
int user = PTRCAST (config_get("dump.user"));
|
||||
int libs = PTRCAST (config_get("dump.libs"));
|
||||
int fds = PTRCAST (config_get("dump.fds"));
|
||||
|
||||
if (strnull(dir)) {
|
||||
dump_num--;
|
||||
|
||||
+1
-1
@@ -277,7 +277,7 @@ int debug_system(const char *command)
|
||||
case CB_SPACE:
|
||||
return commands[i].callback(strchr(command+len,' '));
|
||||
case CB_INT:
|
||||
return commands[i].callback((char *)atoi(command+len));
|
||||
return commands[i].callback((char *)(size_t)atoi(command+len));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "main.h"
|
||||
#include "utils.h"
|
||||
#if DEBUGGER
|
||||
@@ -139,7 +140,7 @@ void env_update()
|
||||
|
||||
/* radis_update(); */
|
||||
config.verbose = config_get_i("cfg.verbose");
|
||||
config.color = (int)config_get("scr.color");
|
||||
config.color = PTRCAST (config_get("scr.color"));
|
||||
|
||||
#if 0
|
||||
ptr = getenv("COLUMNS");
|
||||
|
||||
+6
-1
@@ -28,6 +28,9 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if HAVE_LIB_READLINE
|
||||
#include <readline/readline.h>
|
||||
#endif
|
||||
|
||||
struct list_head flags;
|
||||
static int flag_ptr = -1;
|
||||
@@ -1202,13 +1205,15 @@ void flags_visual_menu()
|
||||
case ':':
|
||||
cons_set_raw(0);
|
||||
#if HAVE_LIB_READLINE
|
||||
char *ptr = (char *)readline(VISUAL_PROMPT);
|
||||
{
|
||||
char *ptr = readline(VISUAL_PROMPT);
|
||||
if (ptr) {
|
||||
strncpy(cmd, ptr, sizeof(cmd));
|
||||
radare_cmd(cmd, 1);
|
||||
//commands_parse(line);
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
#else
|
||||
cmd[0]='\0';
|
||||
dl_prompt = ":> ";
|
||||
|
||||
@@ -78,7 +78,7 @@ ssize_t io_write(int fd, const void *buf, size_t count)
|
||||
io_write_last = count;
|
||||
FIND_FD(fd)
|
||||
IF_HANDLED(fd, write)
|
||||
return plugins[i].write(fd, buf, count);
|
||||
return plugins[i].write(fd, buf, count);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ int io_close(int fd)
|
||||
{
|
||||
FIND_FD(fd)
|
||||
IF_HANDLED(fd, close)
|
||||
return plugins[i].close(fd);
|
||||
return plugins[i].close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ int io_isdbg(int fd)
|
||||
{
|
||||
FIND_FD(fd)
|
||||
IF_HANDLED(fd, open)
|
||||
return (int)(plugins[i].debug);
|
||||
return (int)(size_t)(plugins[i].debug);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,13 +64,14 @@ ruby.${SO}:
|
||||
|
||||
# Try with -llua and -llua5.1 (stupid ubuntu)
|
||||
lua.${SO}:
|
||||
-${CC} lua.c ${SHARED_CFLAGS} ${CFLAGS} ${LUA_CFLAGS} ${LUA_LIBS} -o lua.so
|
||||
@true
|
||||
ifeq ($(HAVE_LANG_LUA),1)
|
||||
ifeq ($(HAVE_LIB_PYTHON2_5),1)
|
||||
ifneq ($(LUA_LIBS),)
|
||||
-${CC} lua.c ${SHARED_CFLAGS} ${CFLAGS} ${LUA_CFLAGS} ${LUA_LIBS} -o lua.so
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@true
|
||||
|
||||
install:
|
||||
-[ -e lua.${SO} ] && ${INSTALL_LIB} lua.${SO} ${DESTDIR}/${LIBDIR}/radare
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2007, 2008
|
||||
* Copyright (C) 2007, 2008, 2009
|
||||
* pancake <@youterm.com>
|
||||
*
|
||||
* radare is free software; you can redistribute it and/or modify
|
||||
@@ -39,6 +39,8 @@
|
||||
//#include <radare.h>
|
||||
#include <EXTERN.h>
|
||||
#include <XSUB.h>
|
||||
#undef PL_madskills
|
||||
#undef PL_xmlfp
|
||||
#include <perl.h>
|
||||
|
||||
extern PerlInterpreter *my_perl;
|
||||
@@ -188,5 +190,3 @@ struct plugin_hack_t radare_plugin = {
|
||||
.desc = "perl plugin",
|
||||
.callback = &perl_hack_cmd
|
||||
};
|
||||
|
||||
//main() { printf("i'm a plugin!\n"); }
|
||||
@@ -226,11 +226,12 @@ int r_gdbwrap_system(const char *str)
|
||||
|
||||
int r_gdbwrap_init()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void r_gdbwrap_close()
|
||||
int r_gdbwrap_close()
|
||||
{
|
||||
close(config.fd);
|
||||
return close(config.fd);
|
||||
}
|
||||
|
||||
static struct debug_t im_debug;
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ static ssize_t mmap_write(int fd, const void *buf, size_t count)
|
||||
{
|
||||
if (mmap_buf != NULL) {
|
||||
mmap_buf = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED, fd, (off_t)config.seek-config.seek%4096);
|
||||
if (((int)mmap_buf)==-1) {
|
||||
if (((int)(size_t)mmap_buf)==-1) {
|
||||
perror("mmap");
|
||||
return -1;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ static ssize_t mmap_read(int fd, void *buf, size_t count)
|
||||
config.seek = config.size;
|
||||
|
||||
mmap_buf = mmap(NULL, count*2, PROT_READ, MAP_SHARED, fd, (off_t)config.seek-config.seek%4096);
|
||||
if (((int)mmap_buf)==-1) {
|
||||
if (((int)(size_t)mmap_buf)==-1) {
|
||||
perror("mmap");
|
||||
return -1;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008
|
||||
* Copyright (C) 2008, 2009
|
||||
* pancake <@youterm.com>
|
||||
*
|
||||
* radare is free software; you can redistribute it and/or modify
|
||||
@@ -93,9 +93,9 @@ static int rshm_open(const char *pathname, int flags, mode_t mode)
|
||||
// connect
|
||||
shm_buf= shmat(atoi(ptr), 0, 0);
|
||||
|
||||
if (((int)(shm_buf)) != -1) {
|
||||
if (((int)(size_t)(shm_buf)) != -1) {
|
||||
printf("Connected to shared memory 0x%08x\n", atoi(ptr));
|
||||
shm_fd = (int)&shm_buf;
|
||||
shm_fd = (int)(size_t)&shm_buf;
|
||||
} else {
|
||||
printf("Cannot connect to shared memory (%d)\n", atoi(ptr));
|
||||
shm_buf = NULL;
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2007, 2008
|
||||
* Copyright (C) 2007, 2008, 2009
|
||||
* pancake <youterm.com>
|
||||
*
|
||||
* radare is free software; you can redistribute it and/or modify
|
||||
@@ -52,9 +52,9 @@ static struct core_t core[]={
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static void *plugin_resolve(char *name)
|
||||
static void *plugin_resolve(const char *name)
|
||||
{
|
||||
int i,j = (int)name;
|
||||
int i,j = (int)(size_t)name;
|
||||
if (j>0 && j<255) {
|
||||
// get by index
|
||||
for(i=0;core[i].ptr&&i<j;i++)
|
||||
@@ -192,7 +192,7 @@ plugin_t *plugin_registry(const char *file)
|
||||
|
||||
list_add_tail(&(hack->list), &(hacks));
|
||||
|
||||
pl->resolve = (void *)&plugin_resolve;
|
||||
pl->resolve = plugin_resolve;
|
||||
pl->config = &config;
|
||||
#if DEBUGGER
|
||||
pl->ps = &ps;
|
||||
@@ -201,7 +201,7 @@ plugin_t *plugin_registry(const char *file)
|
||||
} break;
|
||||
default:
|
||||
//eprintf("Unknown plugin type '%d'\n", (int)p);
|
||||
if (((int)p) == PLUGIN_TYPE_GUI)
|
||||
if (((int)(size_t)p) == PLUGIN_TYPE_GUI)
|
||||
eprintf("You need GUI to run this plugin. Sorry\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+2
-2
@@ -769,8 +769,8 @@ void print_data(ut64 seek, char *arg, u8 *buf, int olen, print_fmt_t fmt)
|
||||
{
|
||||
int tmp, i, j, k;
|
||||
int lines = 0;
|
||||
int endian = (int)config_get("cfg.bigendian");
|
||||
int inverse = (int)config_get("cfg.inverse");
|
||||
int endian = PTRCAST (config_get("cfg.bigendian"));
|
||||
int inverse = PTRCAST (config_get("cfg.inverse"));
|
||||
const char *cstr;
|
||||
char *str;
|
||||
// code anal
|
||||
|
||||
+2
-2
@@ -1035,14 +1035,14 @@ static int ELF_(dietelf_init)(ELF_(dietelf_bin_t) *bin, int fd)
|
||||
perror("lseek");
|
||||
ehdr->e_shnum=0;
|
||||
fprintf(stderr, "Warning: Cannot read %d section headers (0x%08x->0x%08x)\n",
|
||||
ehdr->e_shnum, ehdr->e_shoff, (unsigned int)&ehdr->e_shoff-(unsigned int)&ehdr->e_ident);
|
||||
ehdr->e_shnum, ehdr->e_shoff, (unsigned int)(size_t)&ehdr->e_shoff-(unsigned int)(size_t)&ehdr->e_ident);
|
||||
// return -1;
|
||||
}
|
||||
|
||||
if (read(fd, bin->shdr, slen) != slen) {
|
||||
perror("read");
|
||||
fprintf(stderr, "Warning: Cannot read %d section headers (0x%08x->0x%08x)\n",
|
||||
ehdr->e_shnum, ehdr->e_shoff, (unsigned int)&ehdr->e_shoff-(unsigned int)&ehdr->e_ident);
|
||||
ehdr->e_shnum, ehdr->e_shoff, (unsigned int)(size_t)&ehdr->e_shoff-(unsigned int)(size_t)&ehdr->e_ident);
|
||||
ehdr->e_shnum=0;
|
||||
//return -1;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1773,7 +1773,7 @@ int radare_open(int rst)
|
||||
const char *cptr;
|
||||
char buf[4096];
|
||||
struct config_t ocfg;
|
||||
int wm = (int)config_get("file.write");
|
||||
int wm = (int)(size_t)config_get("file.write");
|
||||
int fd_mode = wm?O_RDWR:O_RDONLY;
|
||||
ut64 seek_orig = config.seek;
|
||||
|
||||
@@ -1967,7 +1967,7 @@ int radare_compare_hex(ut64 addr, unsigned char *f, unsigned char *d, int len)
|
||||
int radare_go()
|
||||
{
|
||||
ut64 bsize;
|
||||
int i, t = (int)config_get("cfg.verbose");
|
||||
int i, t = (int)(size_t)config_get("cfg.verbose");
|
||||
|
||||
radare_controlc_end();
|
||||
|
||||
|
||||
+3
-3
@@ -347,11 +347,11 @@ int search_range(char *range)
|
||||
|
||||
// init stuff
|
||||
search_cmdhit = config_get("cmd.hit");
|
||||
search_count = (int)config_get_i("cfg.count");
|
||||
search_flag = (int)config_get("search.flag");
|
||||
search_count = (int)(size_t)config_get_i("cfg.count");
|
||||
search_flag = (int)(size_t)config_get("search.flag");
|
||||
search_from = config_get_i("search.from");
|
||||
search_to = config_get_i("search.to");
|
||||
search_verbose = (int)config_get("search.verbose");
|
||||
search_verbose = (int)(size_t)config_get("search.verbose");
|
||||
|
||||
if (config_get("search.inar")) {
|
||||
if (! ranges_get_n(range_n++, &search_from, &search_to)) {
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ int stripstr_from_file(const char *filename, int min, int max, int encoding, ut6
|
||||
/* TODO: do not use mmap */
|
||||
#if __UNIX__
|
||||
buf = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, (off_t)0);
|
||||
if (((int)buf) == -1 ) {
|
||||
if (((int)(size_t)buf) == -1 ) {
|
||||
perror("mmap");
|
||||
return 1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -225,7 +225,7 @@ void drop_endian(u8 *dest, u8 *orig, unsigned int size)
|
||||
void endian_memcpy(u8 *dest, const u8 *orig, unsigned int size)
|
||||
{
|
||||
#if RADARE_CORE
|
||||
endian_memcpy_e(dest, orig, size, (int)config_get("cfg.bigendian"));
|
||||
endian_memcpy_e(dest, orig, size, PTRCAST (config_get("cfg.bigendian")));
|
||||
#else
|
||||
endian_memcpy_e(dest, orig, size, 0); // lilendian by default
|
||||
#endif
|
||||
|
||||
@@ -136,5 +136,6 @@ struct r_prof_t {
|
||||
void r_prof_start(struct r_prof_t *p);
|
||||
double r_prof_end(struct r_prof_t *p);
|
||||
char *r_sys_cmd_str(const char *cmd, const char *input, int *len);
|
||||
const char *get_home_directory();
|
||||
|
||||
#endif
|
||||
+3
-2
@@ -267,7 +267,7 @@ CMD_DECL(insert)
|
||||
|
||||
CMD_DECL(invert)
|
||||
{
|
||||
int inv = config_get_i("cfg.inverse")^1;
|
||||
int inv = (int)config_get_i("cfg.inverse")^1;
|
||||
config_set("cfg.inverse", inv?"true":"false");
|
||||
return 0;
|
||||
}
|
||||
@@ -974,7 +974,8 @@ void visual_draw_screen()
|
||||
(config.seek+config.vaddr),
|
||||
(unsigned int)config.block_size,
|
||||
mark, strget(get_print_format_name(last_print_format)),
|
||||
strget((char *)inv), strget(buf));
|
||||
strget((char *)(size_t)inv),
|
||||
strget(buf));
|
||||
/* Spaguetti monster lives here ! */
|
||||
ptr = config_get("cmd.vprompt");
|
||||
if (ptr&&ptr[0]) {
|
||||
|
||||
+1
-1
@@ -27,5 +27,5 @@ novala:
|
||||
|
||||
clean:
|
||||
-mv cmain.c ___
|
||||
-rm *.c *.h *.o a.out
|
||||
-rm -f *.c *.h *.o a.out
|
||||
-mv ___ cmain.c
|
||||
Reference in new issue
Block a user