* Build all pkgconfig files (fixes valaswig stuff)
* Split some install targets * Fix segfault in r_anal when not setting any handler * Rename R_ASM_SYN -> R_ASM_SYNTAX cprefix - R_ASM_*_NULL -> R_ASM_*_NONE * Added nonworking scr.html eval key in r_core/config * Add install-ruby target for swig bindings * Use @VERSION@ in libr.pc.acr * Lot of fixes for valaswig integration
This commit is contained in:
parent
e5b6d1582b
commit
7ce3232747
|
@ -436,7 +436,7 @@ for A in ${ENVWORDS} ; do
|
|||
SEDFLAGS="${SEDFLAGS}s,@${A}@,${VAR},g;"
|
||||
done
|
||||
SEDFLAGS="${SEDFLAGS}'"
|
||||
for A in ./config-user.mk libr/include/r_userconf.h pkgcfg/libr.pc pkgcfg/r_io.pc pkgcfg/r_asm.pc pkgcfg/r_bin.pc pkgcfg/r_cons.pc pkgcfg/r_diff.pc pkgcfg/r_core.pc pkgcfg/r_lang.pc pkgcfg/r_socket.pc pkgcfg/r_debug.pc pkgcfg/r_reg.pc pkgcfg/r_line.pc pkgcfg/r_syscall.pc pkgcfg/r_macro.pc pkgcfg/r_util.pc pkgcfg/r_search.pc pkgcfg/r_vm.pc pkgcfg/r_th.pc pkgcfg/r_bp.pc pkgcfg/r_db.pc ; do # SUBDIRS
|
||||
for A in ./config-user.mk libr/include/r_userconf.h pkgcfg/libr.pc pkgcfg/r_io.pc pkgcfg/r_asm.pc pkgcfg/r_bin.pc pkgcfg/r_bininfo.pc pkgcfg/r_anal.pc pkgcfg/r_hash.pc pkgcfg/r_cons.pc pkgcfg/r_diff.pc pkgcfg/r_core.pc pkgcfg/r_lang.pc pkgcfg/r_socket.pc pkgcfg/r_debug.pc pkgcfg/r_reg.pc pkgcfg/r_cmd.pc pkgcfg/r_config.pc pkgcfg/r_flags.pc pkgcfg/r_meta.pc pkgcfg/r_line.pc pkgcfg/r_syscall.pc pkgcfg/r_macro.pc pkgcfg/r_sign.pc pkgcfg/r_util.pc pkgcfg/r_trace.pc pkgcfg/r_search.pc pkgcfg/r_vm.pc pkgcfg/r_var.pc pkgcfg/r_th.pc pkgcfg/r_bp.pc pkgcfg/r_db.pc ; do # SUBDIRS
|
||||
if [ -f "${VPATH}/${A}.acr" ]; then
|
||||
SD_TARGET=${A}
|
||||
else
|
||||
|
|
|
@ -57,6 +57,9 @@ SUBDIRS ./config-user.mk libr/include/r_userconf.h
|
|||
pkgcfg/r_io.pc
|
||||
pkgcfg/r_asm.pc
|
||||
pkgcfg/r_bin.pc
|
||||
pkgcfg/r_bininfo.pc
|
||||
pkgcfg/r_anal.pc
|
||||
pkgcfg/r_hash.pc
|
||||
pkgcfg/r_cons.pc
|
||||
pkgcfg/r_diff.pc
|
||||
pkgcfg/r_core.pc
|
||||
|
@ -64,12 +67,19 @@ SUBDIRS ./config-user.mk libr/include/r_userconf.h
|
|||
pkgcfg/r_socket.pc
|
||||
pkgcfg/r_debug.pc
|
||||
pkgcfg/r_reg.pc
|
||||
pkgcfg/r_cmd.pc
|
||||
pkgcfg/r_config.pc
|
||||
pkgcfg/r_flags.pc
|
||||
pkgcfg/r_meta.pc
|
||||
pkgcfg/r_line.pc
|
||||
pkgcfg/r_syscall.pc
|
||||
pkgcfg/r_macro.pc
|
||||
pkgcfg/r_sign.pc
|
||||
pkgcfg/r_util.pc
|
||||
pkgcfg/r_trace.pc
|
||||
pkgcfg/r_search.pc
|
||||
pkgcfg/r_vm.pc
|
||||
pkgcfg/r_var.pc
|
||||
pkgcfg/r_th.pc
|
||||
pkgcfg/r_bp.pc
|
||||
pkgcfg/r_db.pc
|
||||
|
|
|
@ -52,7 +52,11 @@ install-vapi:
|
|||
@${INSTALL_DIR} ${PFX}/share/vala/vapi
|
||||
${INSTALL_DATA} vapi/*.vapi vapi/*.deps ${PFX}/share/vala/vapi
|
||||
|
||||
install: install-vapi
|
||||
install-pkgconfig:
|
||||
@${INSTALL_DIR} ${PFX}/lib/pkgconfig
|
||||
for a in ../pkgcfg/*.pc ; do ${INSTALL_DATA} $$a ${PFX}/lib/pkgconfig ; done
|
||||
|
||||
install: install-vapi install-pkgconfig
|
||||
# TODO :Use INSTALL_DATA_DIR instead of mkdir
|
||||
# libraries
|
||||
@${INSTALL_DIR} ${PFX}/lib
|
||||
|
@ -69,8 +73,6 @@ install: install-vapi
|
|||
@for a in `find */t -perm /u+x -type f | grep 2`; \
|
||||
do echo "$$a ${PFX}/bin"; ${INSTALL_PROGRAM} $$a ${PFX}/bin ; done
|
||||
# plugins
|
||||
@${INSTALL_DIR} ${PFX}/lib/pkgconfig
|
||||
for a in ../pkgcfg/*.pc ; do ${INSTALL_DATA} $$a ${PFX}/lib/pkgconfig ; done
|
||||
#${INSTALL_DATA} libr.pc ${PFX}/lib/pkgconfig
|
||||
@${INSTALL_DIR} ${PFX}/lib/radare2
|
||||
@for a in `find */p -perm /u+x -type f`; \
|
||||
|
|
|
@ -23,6 +23,7 @@ R_API int r_anal_init(struct r_anal_t *anal)
|
|||
{
|
||||
anal->user = NULL;
|
||||
anal->ctx = NULL;
|
||||
anal->cur = NULL;
|
||||
r_anal_set_bits(anal, 32);
|
||||
r_anal_set_big_endian(anal, R_FALSE);
|
||||
INIT_LIST_HEAD(&anal->anals);
|
||||
|
@ -93,7 +94,7 @@ R_API int r_anal_set_pc(struct r_anal_t *a, ut64 pc)
|
|||
|
||||
R_API int r_anal_aop(struct r_anal_t *anal, struct r_anal_aop_t *aop, void *data)
|
||||
{
|
||||
if (anal->cur && anal->cur->aop)
|
||||
if (anal && anal->cur && anal->cur->aop)
|
||||
return anal->cur->aop(anal, aop, data);
|
||||
return R_FALSE;
|
||||
}
|
||||
|
|
|
@ -370,7 +370,7 @@ static ut16 r_ntohs (ut16 foo) {
|
|||
#if BIGENDIAN
|
||||
/* do nothing */
|
||||
#else
|
||||
ut8 *p = &foo;
|
||||
ut8 *p = (ut8 *)&foo;
|
||||
foo = p[1] | p[0]<<8;
|
||||
#endif
|
||||
return foo;
|
||||
|
|
|
@ -102,7 +102,7 @@ R_API struct r_asm_t *r_asm_init(struct r_asm_t *a)
|
|||
a->cur = NULL;
|
||||
a->bits = 32;
|
||||
a->big_endian = 0;
|
||||
a->syntax = R_ASM_SYN_INTEL;
|
||||
a->syntax = R_ASM_SYNTAX_INTEL;
|
||||
a->pc = 0;
|
||||
INIT_LIST_HEAD(&a->asms);
|
||||
for(i=0;asm_static_plugins[i];i++)
|
||||
|
@ -199,8 +199,8 @@ R_API int r_asm_set_big_endian(struct r_asm_t *a, int boolean)
|
|||
R_API int r_asm_set_syntax(struct r_asm_t *a, int syntax)
|
||||
{
|
||||
switch (syntax) {
|
||||
case R_ASM_SYN_INTEL:
|
||||
case R_ASM_SYN_ATT:
|
||||
case R_ASM_SYNTAX_INTEL:
|
||||
case R_ASM_SYNTAX_ATT:
|
||||
a->syntax = syntax;
|
||||
return R_TRUE;
|
||||
default:
|
||||
|
|
|
@ -18,7 +18,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6
|
|||
static ud_t disasm_obj;
|
||||
|
||||
ud_init(&disasm_obj);
|
||||
if (a->syntax == R_ASM_SYN_ATT)
|
||||
if (a->syntax == R_ASM_SYNTAX_ATT)
|
||||
ud_set_syntax(&disasm_obj, UD_SYN_ATT);
|
||||
else
|
||||
ud_set_syntax(&disasm_obj, UD_SYN_INTEL);
|
||||
|
|
|
@ -20,7 +20,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6
|
|||
disasm_obj.VirtualAddr = a->pc;
|
||||
disasm_obj.Archi = ((a->bits == 64) ? 64 : 0);
|
||||
disasm_obj.SecurityBlock = len;
|
||||
if (a->syntax == R_ASM_SYN_ATT)
|
||||
if (a->syntax == R_ASM_SYNTAX_ATT)
|
||||
disasm_obj.Options = 0x400;
|
||||
else disasm_obj.Options = 0;
|
||||
|
||||
|
|
|
@ -137,8 +137,8 @@ int main(int argc, char *argv[])
|
|||
break;
|
||||
case 's':
|
||||
if (!strcmp(optarg, "att"))
|
||||
r_asm_set_syntax(&a, R_ASM_SYN_ATT);
|
||||
else r_asm_set_syntax(&a, R_ASM_SYN_INTEL);
|
||||
r_asm_set_syntax(&a, R_ASM_SYNTAX_ATT);
|
||||
else r_asm_set_syntax(&a, R_ASM_SYNTAX_INTEL);
|
||||
break;
|
||||
case 'd':
|
||||
dis = 1;
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
/* radare - LGPL - Copyright 2009 pancake<nopcode.org> */
|
||||
|
||||
#include <r_core.h>
|
||||
static int config_scrhtml_callback(void *user, void *data) {
|
||||
struct r_core_t *core = (struct r_core_t *) user;
|
||||
struct r_config_node_t *node = (struct r_config_node_t *) data;
|
||||
r_cons_is_html = node->i_value;
|
||||
// TODO: control error and restore old value (return false?) show errormsg?
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
static int config_asm_arch_callback(void *user, void *data)
|
||||
{
|
||||
static int config_asm_arch_callback(void *user, void *data) {
|
||||
struct r_core_t *core = (struct r_core_t *) user;
|
||||
struct r_config_node_t *node = (struct r_config_node_t *) data;
|
||||
r_asm_use (&core->assembler, node->value);
|
||||
|
@ -83,10 +89,12 @@ R_API int r_core_config_init(struct r_core_t *core)
|
|||
r_config_set(cfg, "cmd.prompt", "");
|
||||
r_config_set(cfg, "cmd.vprompt", "");
|
||||
r_config_set(cfg, "cmd.hit", "");
|
||||
r_config_set_cb(cfg, "scr.color",
|
||||
r_config_set_cb (cfg, "scr.color",
|
||||
(core->print.flags&R_PRINT_FLAGS_COLOR)?"true":"false",
|
||||
&config_color_callback);
|
||||
r_config_set (cfg, "scr.seek", "");
|
||||
r_config_set_cb (cfg, "scr.html", "false", &config_scrhtml_callback);
|
||||
r_config_set(cfg, "cfg.debug", "false");
|
||||
#if 0
|
||||
node = config_set("asm.profile", "default");
|
||||
// node->callback = &config_asm_profile;
|
||||
|
@ -153,7 +161,7 @@ R_API int r_core_config_init(struct r_core_t *core)
|
|||
config_set("cmd.visual", "");
|
||||
config_set("cmd.visualbind", "");
|
||||
config_set("cmd.touchtrace", "");
|
||||
#endif
|
||||
|
||||
r_config_set(cfg, "cmd.prompt", "");
|
||||
r_config_set(cfg, "cmd.visual", ""); //? eip && ?? s eip");
|
||||
r_config_set(cfg, "cmd.vprompt", "p%");
|
||||
|
@ -162,12 +170,10 @@ R_API int r_core_config_init(struct r_core_t *core)
|
|||
r_config_set(cfg, "cmd.bp", "");
|
||||
r_config_set(cfg, "cfg.fortunes", "true");
|
||||
|
||||
r_config_set(cfg, "cfg.debug", "false");
|
||||
|
||||
#if 0
|
||||
config_set_i("search.from", 0);
|
||||
config_set_i("search.to", 0);
|
||||
config_set_i("search.align", 0);
|
||||
r_config_set_i("search.from", 0);
|
||||
r_config_set_i("search.to", 0);
|
||||
r_config_set_i("search.align", 0);
|
||||
config_set("search.flag", "true");
|
||||
config_set("search.verbose", "true");
|
||||
|
||||
|
@ -337,8 +343,6 @@ R_API int r_core_config_init(struct r_core_t *core)
|
|||
node = config_set("zoom.byte", "head");
|
||||
node->callback = &config_zoombyte_callback;
|
||||
|
||||
node = config_set("scr.html", "false");
|
||||
node->callback = &config_scrhtml_callback;
|
||||
config_set_i("scr.accel", 0);
|
||||
|
||||
node = config_set("scr.palette", cons_palette_default);
|
||||
|
@ -348,7 +352,6 @@ R_API int r_core_config_init(struct r_core_t *core)
|
|||
node = config_set("scr.pal."x"", y); \
|
||||
node->callback = &config_palette_callback; \
|
||||
node->callback(node);
|
||||
|
||||
config_set_scr_pal("prompt","yellow")
|
||||
config_set_scr_pal("default","white")
|
||||
config_set_scr_pal("changed","green")
|
||||
|
|
|
@ -71,7 +71,6 @@ int main(int argc, char **argv)
|
|||
break;
|
||||
case 'V':
|
||||
return main_version ();
|
||||
break;
|
||||
case 'w':
|
||||
perms = R_IO_READ | R_IO_WRITE;
|
||||
break;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#define R_ASM_FASTCALL_ARGS 6
|
||||
|
||||
enum {
|
||||
R_ASM_ARCH_NULL = 0,
|
||||
R_ASM_ARCH_NONE = 0,
|
||||
R_ASM_ARCH_X86,
|
||||
R_ASM_ARCH_ARM,
|
||||
R_ASM_ARCH_PPC,
|
||||
|
@ -25,9 +25,9 @@ enum {
|
|||
};
|
||||
|
||||
enum {
|
||||
R_ASM_SYN_NULL = 0,
|
||||
R_ASM_SYN_INTEL,
|
||||
R_ASM_SYN_ATT
|
||||
R_ASM_SYNTAX_NONE = 0,
|
||||
R_ASM_SYNTAX_INTEL,
|
||||
R_ASM_SYNTAX_ATT
|
||||
};
|
||||
|
||||
typedef struct r_asm_fastcall_t {
|
||||
|
|
|
@ -34,25 +34,23 @@ typedef struct r_config_t {
|
|||
struct list_head nodes;
|
||||
} rConfig;
|
||||
|
||||
#define O struct r_config_t *obj
|
||||
|
||||
#ifdef R_API
|
||||
R_API struct r_config_t *r_config_new(void *user);
|
||||
R_API int r_config_free(struct r_config_t *cfg);
|
||||
R_API int r_config_init(struct r_config_t *core, void *user);
|
||||
R_API void r_config_lock(O, int l);
|
||||
R_API int r_config_eval(O, const char *str);
|
||||
R_API struct r_config_node_t *r_config_set_i(O, const char *name, const ut64 i);
|
||||
R_API struct r_config_node_t *r_config_set_cb(struct r_config_t *cfg, const char *name, const char *value, int (*callback)(void *user, void *data));
|
||||
R_API struct r_config_node_t *r_config_set_i_cb(struct r_config_t *cfg, const char *name, int ivalue, int (*callback)(void *user, void *data));
|
||||
R_API int r_config_rm(O, const char *name);
|
||||
R_API struct r_config_node_t *r_config_set(O, const char *name, const char *value);
|
||||
R_API ut64 r_config_get_i(O, const char *name);
|
||||
R_API const char *r_config_get(O, const char *name);
|
||||
R_API void r_config_list(O, const char *str, int rad);
|
||||
R_API struct r_config_node_t *r_config_node_get(O, const char *name);
|
||||
R_API void r_config_lock(rConfig *cfg, int l);
|
||||
R_API int r_config_eval(rConfig *cfg, const char *str);
|
||||
R_API struct r_config_node_t *r_config_set_i(rConfig *cfg, const char *name, const ut64 i);
|
||||
R_API struct r_config_node_t *r_config_set_cb(rConfig *cfg, const char *name, const char *value, int (*callback)(void *user, void *data));
|
||||
R_API struct r_config_node_t *r_config_set_i_cb(rConfig *cfg, const char *name, int ivalue, int (*callback)(void *user, void *data));
|
||||
R_API int r_config_rm(rConfig *cfg, const char *name);
|
||||
R_API struct r_config_node_t *r_config_set(rConfig *cfg, const char *name, const char *value);
|
||||
R_API ut64 r_config_get_i(rConfig *cfg, const char *name);
|
||||
R_API const char *r_config_get(rConfig *cfg, const char *name);
|
||||
R_API void r_config_list(rConfig *cfg, const char *str, int rad);
|
||||
R_API struct r_config_node_t *r_config_node_get(rConfig *cfg, const char *name);
|
||||
R_API struct r_config_node_t *r_config_node_new(const char *name, const char *value);
|
||||
R_API int r_config_swap(struct r_config_t *cfg, const char *name);
|
||||
R_API int r_config_swap(rConfig *cfg, const char *name);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -186,7 +186,7 @@ int r_macro_cmd_args(struct r_macro_t *mac, const char *ptr, const char *args, i
|
|||
{
|
||||
int i,j;
|
||||
char *cmd = alloca(strlen(ptr)+1024);
|
||||
char *arg = strdup(args);
|
||||
char *arg = args?strdup(args):strdup("");
|
||||
cmd[0]='\0';
|
||||
|
||||
// eprintf("call(%s)\n", ptr);
|
||||
|
@ -351,9 +351,8 @@ int r_macro_call(struct r_macro_t *mac, const char *name)
|
|||
}
|
||||
|
||||
/* Command execution */
|
||||
if (*ptr) {
|
||||
if (*ptr)
|
||||
r_macro_cmd_args(mac, ptr, args, nargs);
|
||||
}
|
||||
if (end) {
|
||||
*end='\n';
|
||||
ptr = end + 1;
|
||||
|
|
|
@ -7,5 +7,5 @@ Name: libr
|
|||
Description: radare framework libraries
|
||||
Version: 0.1
|
||||
Requires:
|
||||
Libs: -L${libdir} -lr_core -lr_lang -lr_search -lr_cmd -lr_meta -lr_asm -lr_util
|
||||
Libs: -L${libdir} -lr_core -lr_lang -lr_search -lr_cmd -lr_meta -lr_asm -lr_util -lr_hash
|
||||
Cflags: -I${includedir}/libr
|
||||
|
|
|
@ -1,31 +1,30 @@
|
|||
/* radare - LGPL - Copyright 2009 nibble<.ds@gmail.com> */
|
||||
/* radare - LGPL - Copyright 2009, 2010 nibble<.ds@gmail.com> */
|
||||
|
||||
namespace Radare {
|
||||
[Compact]
|
||||
[CCode (cheader_filename="r_asm.h", cname="struct r_asm_t", free_function="r_asm_free", cprefix="r_asm_")]
|
||||
public class rAsm {
|
||||
/* DEPRECATED?
|
||||
[CCode (cprefix="R_ASM_ARCH_", cname="int")]
|
||||
public enum Arch {
|
||||
NULL = 0,
|
||||
X86 = 1,
|
||||
ARM = 2,
|
||||
PPC = 3,
|
||||
M68K = 4,
|
||||
JAVA = 5,
|
||||
MIPS = 6,
|
||||
SPARC = 7,
|
||||
CSR = 8,
|
||||
MSIL = 9,
|
||||
OBJD = 10,
|
||||
BF = 11
|
||||
NONE,
|
||||
X86,
|
||||
ARM,
|
||||
PPC,
|
||||
M68K,
|
||||
JAVA,
|
||||
MIPS,
|
||||
SPARC,
|
||||
CSR,
|
||||
MSIL,
|
||||
OBJD,
|
||||
BF
|
||||
}
|
||||
*/
|
||||
|
||||
[CCode (cprefix="R_ASM_SYN_", cname="int")]
|
||||
[CCode (cprefix="R_ASM_SYNTAX_", cname="int")]
|
||||
public enum Syntax {
|
||||
NULL = 0,
|
||||
INTEL = 1,
|
||||
ATT = 2,
|
||||
NONE,
|
||||
INTEL,
|
||||
ATT
|
||||
}
|
||||
|
||||
[Compact]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/* radare - LGPL - Copyright 2009 pancake<nopcode.org> */
|
||||
|
||||
[CCode (cheader_filename="r_core.h", cprefix="r_core", lower_case_cprefix="r_core_")]
|
||||
namespace Radare {
|
||||
[Compact]
|
||||
[CCode (cname="struct r_core_t", free_function="r_core_free", cprefix="r_core_")]
|
||||
[CCode (cheader_filename="r_core.h", cname="struct r_core_t", free_function="r_core_free", cprefix="r_core_")]
|
||||
public class rCore {
|
||||
/* lifecycle */
|
||||
public rCore();
|
||||
|
|
|
@ -5,7 +5,7 @@ includedir=${prefix}/include
|
|||
|
||||
Name: libr
|
||||
Description: radare foundation libraries
|
||||
Version: 0.2
|
||||
Version: @VERSION@
|
||||
Requires:
|
||||
Libs: -L${libdir} -lr_io -lr_util -lr_lib -lr_meta -lr_lang -lr_flags -lr_bin -lr_bininfo -lr_macro -lr_hash -lr_line -lr_cons -lr_print -lr_config -lr_syscall -lr_range -lr_socket -lr_cmd -lr_asm -lr_anal -lr_parse -lr_search -lr_diff -lr_bp -lr_debug -lr_reg -lr_core -lr_var -lr_sign -lr_trace -lr_vm -lr_th -lr_db
|
||||
Cflags: -I${includedir}/libr
|
||||
|
|
|
@ -18,8 +18,7 @@ test:
|
|||
cd python && make test
|
||||
cd ruby && make test
|
||||
|
||||
install:
|
||||
# python install
|
||||
install-python:
|
||||
@if [ "`grep python supported.langs`" ]; then \
|
||||
for a in python2.5 python2.6; do \
|
||||
mkdir -p /usr/lib/$$a/r2 ; \
|
||||
|
@ -30,6 +29,26 @@ install:
|
|||
done ; \
|
||||
fi
|
||||
|
||||
install-ruby:
|
||||
@if [ "`grep ruby supported.langs`" ]; then \
|
||||
target=/usr/lib/ruby/1.9.1/ ; \
|
||||
mkdir -p $$target/r2 ; \
|
||||
echo "Installing ruby r2 modules..." ; \
|
||||
cp -rf ruby/* $$target/r2 ; \
|
||||
cp -rf ruby/*libr* $$target ; \
|
||||
fi
|
||||
|
||||
install-perl:
|
||||
@echo "Installing perl r2 modules... NOT YET IMPLEMENTED"
|
||||
@#if [ "`grep perl supported.langs`" ]; then \
|
||||
#target=/usr/lib/ruby/1.9.1/ ; \
|
||||
#mkdir -p $$target/r2 ; \
|
||||
#cp -rf ruby/* $$target/r2 ; \
|
||||
#cp -rf ruby/*libr* $$target ; \
|
||||
#fi
|
||||
|
||||
install: install-python install-ruby install-perl
|
||||
|
||||
oldtest:
|
||||
sh do-swig.sh r_bp
|
||||
python test.py
|
||||
|
|
Loading…
Reference in New Issue