* Autodetection of --with-ostype in configure.acr
- Rebuild configure script in ACR 0.8.1 * Random minor changes
This commit is contained in:
parent
9890c6e8b0
commit
14f9fe8b65
3
TODO
3
TODO
|
@ -7,6 +7,9 @@
|
||||||
|
|
||||||
<{include libr/TODO}>
|
<{include libr/TODO}>
|
||||||
|
|
||||||
|
* BUG:
|
||||||
|
rasm2 -s att -a x86.nasm 'push 0x1e(%esp)'
|
||||||
|
|
||||||
* is RCore->block and blocksize a RBuf ? refactor!11
|
* is RCore->block and blocksize a RBuf ? refactor!11
|
||||||
|
|
||||||
* r_cmd must provide a nesting char table indexing for commands
|
* r_cmd must provide a nesting char table indexing for commands
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# This script was automatically generated by ACR v0.8
|
# This script was automatically generated by ACR v0.8.1
|
||||||
# @author: pancake <youterm.com>
|
# @author: pancake <youterm.com>
|
||||||
# @url: http://news.nopcode.org/pancake/acr.html
|
# @url: http://news.nopcode.org/pancake/acr.html
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ trap control_c 2
|
||||||
DEBUGGER=1
|
DEBUGGER=1
|
||||||
HAVE_EWF=1
|
HAVE_EWF=1
|
||||||
[ -z "${USERCC}" ] && USERCC="gcc"
|
[ -z "${USERCC}" ] && USERCC="gcc"
|
||||||
[ -z "${USEROSTYPE}" ] && USEROSTYPE="gnulinux"
|
[ -z "${USEROSTYPE}" ] && USEROSTYPE="none"
|
||||||
WITHPIC=1
|
WITHPIC=1
|
||||||
WANT_VALASWIG=1
|
WANT_VALASWIG=1
|
||||||
WANT_VALA=1
|
WANT_VALA=1
|
||||||
|
@ -89,9 +89,8 @@ create_environ() {
|
||||||
: ${MANDIR:=${SPREFIX}/man}
|
: ${MANDIR:=${SPREFIX}/man}
|
||||||
: ${LOCALSTATEDIR:=${SPREFIX}/var}
|
: ${LOCALSTATEDIR:=${SPREFIX}/var}
|
||||||
for A in `echo ${PATH} | sed -e 's,:, ,g'` ; do
|
for A in `echo ${PATH} | sed -e 's,:, ,g'` ; do
|
||||||
if [ -e $A/install ]; then
|
[ -e $A/ginstall ] && : ${INSTALL:=$A/ginstall} && break
|
||||||
: ${INSTALL:=$A/install}
|
[ -e $A/install ] && : ${INSTALL:=$A/install} && break
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
: ${INSTALL_DIR:=${INSTALL} -d}
|
: ${INSTALL_DIR:=${INSTALL} -d}
|
||||||
: ${INSTALL_DATA:=${INSTALL} -m 644}
|
: ${INSTALL_DATA:=${INSTALL} -m 644}
|
||||||
|
@ -146,7 +145,7 @@ printf "\nOptional Features:
|
||||||
--without-debugger disable native debugger features
|
--without-debugger disable native debugger features
|
||||||
--without-ewf disable EWF dependency
|
--without-ewf disable EWF dependency
|
||||||
--with-compiler Define compiler to use (see mk/) (USERCC=gcc)
|
--with-compiler Define compiler to use (see mk/) (USERCC=gcc)
|
||||||
--with-ostype Choose OS type ( gnulinux windows osx ) (USEROSTYPE=gnulinux)
|
--with-ostype Choose OS type ( gnulinux windows osx ) (USEROSTYPE=none)
|
||||||
--without-pic do not build libr as a program independent location
|
--without-pic do not build libr as a program independent location
|
||||||
--without-valaswig disables the build of the valaswig bindings for python, perl, ruby
|
--without-valaswig disables the build of the valaswig bindings for python, perl, ruby
|
||||||
--without-vala disables the build of all the vala-dependant parts \n"
|
--without-vala disables the build of all the vala-dependant parts \n"
|
||||||
|
@ -171,7 +170,7 @@ take_environ() {
|
||||||
}
|
}
|
||||||
|
|
||||||
show_version() {
|
show_version() {
|
||||||
echo "radare2-0.4a configuration script done with acr v0.8.
|
echo "radare2-0.4a configuration script done with acr v0.8.1.
|
||||||
The 'Free Software Foundation' message is only for autodetection.
|
The 'Free Software Foundation' message is only for autodetection.
|
||||||
Originally written by pancake <youterm.com>."
|
Originally written by pancake <youterm.com>."
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -193,7 +192,7 @@ echo "VERSION: 0.4a"
|
||||||
echo "LANGS: c"
|
echo "LANGS: c"
|
||||||
echo "REQUIRED: libdl lib>=vala-1.0 libvala-1.0>=0.5.0"
|
echo "REQUIRED: libdl lib>=vala-1.0 libvala-1.0>=0.5.0"
|
||||||
echo "OPTIONAL: libewf"
|
echo "OPTIONAL: libewf"
|
||||||
echo "FLAGS: --without-debugger --without-ewf --with-compiler=gcc --with-ostype=gnulinux --without-pic --without-valaswig --without-vala"
|
echo "FLAGS: --without-debugger --without-ewf --with-compiler=gcc --with-ostype=none --without-pic --without-valaswig --without-vala"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
"--cache-file")
|
"--cache-file")
|
||||||
|
@ -238,7 +237,7 @@ echo "FLAGS: --without-debugger --without-ewf --with-compiler=gcc --with-ost
|
||||||
"--without-debugger") DEBUGGER="0"; ;;
|
"--without-debugger") DEBUGGER="0"; ;;
|
||||||
"--without-ewf") HAVE_EWF="0"; ;;
|
"--without-ewf") HAVE_EWF="0"; ;;
|
||||||
--with-compiler) if [ -z "${value}" ]; then USERCC="gcc"; else USERCC="${value}" ; fi ;;
|
--with-compiler) if [ -z "${value}" ]; then USERCC="gcc"; else USERCC="${value}" ; fi ;;
|
||||||
--with-ostype) if [ -z "${value}" ]; then USEROSTYPE="gnulinux"; else USEROSTYPE="${value}" ; fi ;;
|
--with-ostype) if [ -z "${value}" ]; then USEROSTYPE="none"; else USEROSTYPE="${value}" ; fi ;;
|
||||||
"--without-pic") WITHPIC="0"; ;;
|
"--without-pic") WITHPIC="0"; ;;
|
||||||
"--without-valaswig") WANT_VALASWIG="0"; ;;
|
"--without-valaswig") WANT_VALASWIG="0"; ;;
|
||||||
"--without-vala") WANT_VALA="0"; ;;
|
"--without-vala") WANT_VALA="0"; ;;
|
||||||
|
@ -347,6 +346,12 @@ if [ "$HAVE_EWF" = "1" ]; then
|
||||||
HAVE_LIB_EWF="0"; fi
|
HAVE_LIB_EWF="0"; fi
|
||||||
check_library HAVE_LIB_LUA5_1 lua5.1 0
|
check_library HAVE_LIB_LUA5_1 lua5.1 0
|
||||||
check_library HAVE_LIB_TCC tcc 0
|
check_library HAVE_LIB_TCC tcc 0
|
||||||
|
if [ "$USEROSTYPE" = "none" ]; then
|
||||||
|
if [ "$HOST_OS" = "linux" ]; then
|
||||||
|
USEROSTYPE="gnulinux"
|
||||||
|
else
|
||||||
|
if [ "$HOST_OS" = "darwin" ]; then
|
||||||
|
USEROSTYPE="darwin"; fi; fi; fi
|
||||||
printf "checking for valaswig... "
|
printf "checking for valaswig... "
|
||||||
if [ -x "${VALASWIG}" ]; then
|
if [ -x "${VALASWIG}" ]; then
|
||||||
FIND=${VALASWIG}
|
FIND=${VALASWIG}
|
||||||
|
|
|
@ -19,7 +19,18 @@ CHKLIB tcc
|
||||||
|
|
||||||
(( rules for the compiler ))
|
(( rules for the compiler ))
|
||||||
ARG_WITH USERCC=gcc compiler Define compiler to use (see mk/) ;
|
ARG_WITH USERCC=gcc compiler Define compiler to use (see mk/) ;
|
||||||
ARG_WITH USEROSTYPE=gnulinux ostype Choose OS type ( gnulinux windows osx ) ;
|
ARG_WITH USEROSTYPE=none ostype Choose OS type ( gnulinux windows osx ) ;
|
||||||
|
|
||||||
|
(( TODO: throw error if unknown ostype ))
|
||||||
|
IFEQ USEROSTYPE none ; {
|
||||||
|
IFEQ HOST_OS linux ; {
|
||||||
|
USEROSTYPE = gnulinux ;
|
||||||
|
}{
|
||||||
|
IFEQ HOST_OS darwin ; {
|
||||||
|
USEROSTYPE = darwin ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ARG_WITHOUT WITHPIC pic do not build libr as a program independent location ;
|
ARG_WITHOUT WITHPIC pic do not build libr as a program independent location ;
|
||||||
ARG_WITHOUT WANT_VALASWIG valaswig disables the build of the valaswig bindings for python, perl, ruby ;
|
ARG_WITHOUT WANT_VALASWIG valaswig disables the build of the valaswig bindings for python, perl, ruby ;
|
||||||
|
|
|
@ -6,12 +6,9 @@
|
||||||
#include <r_lib.h>
|
#include <r_lib.h>
|
||||||
#include <r_util.h>
|
#include <r_util.h>
|
||||||
#include <r_asm.h>
|
#include <r_asm.h>
|
||||||
|
|
||||||
#include "csr/csr_disasm/dis.h"
|
#include "csr/csr_disasm/dis.h"
|
||||||
|
|
||||||
|
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len) {
|
||||||
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len)
|
|
||||||
{
|
|
||||||
arch_csr_disasm(aop->buf_asm, buf, a->pc);
|
arch_csr_disasm(aop->buf_asm, buf, a->pc);
|
||||||
return (aop->inst_len=2);
|
return (aop->inst_len=2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,14 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <r_types.h>
|
#include <r_types.h>
|
||||||
#include <r_lib.h>
|
#include <r_lib.h>
|
||||||
#include <r_asm.h>
|
#include <r_asm.h>
|
||||||
|
|
||||||
#include "fastcall_x86.h"
|
#include "fastcall_x86.h"
|
||||||
|
|
||||||
#include "x86/udis86/types.h"
|
#include "x86/udis86/types.h"
|
||||||
#include "x86/udis86/extern.h"
|
#include "x86/udis86/extern.h"
|
||||||
|
|
||||||
|
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len) {
|
||||||
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len)
|
|
||||||
{
|
|
||||||
static ud_t disasm_obj;
|
static ud_t disasm_obj;
|
||||||
|
|
||||||
ud_init(&disasm_obj);
|
ud_init(&disasm_obj);
|
||||||
|
@ -34,7 +29,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6
|
||||||
|
|
||||||
struct r_asm_handle_t r_asm_plugin_x86 = {
|
struct r_asm_handle_t r_asm_plugin_x86 = {
|
||||||
.name = "x86",
|
.name = "x86",
|
||||||
.desc = "X86 disassembly plugin",
|
.desc = "udis86 disassembly plugin",
|
||||||
.arch = "x86",
|
.arch = "x86",
|
||||||
.bits = (int[]){ 16, 32, 64, 0 },
|
.bits = (int[]){ 16, 32, 64, 0 },
|
||||||
.init = NULL,
|
.init = NULL,
|
||||||
|
|
|
@ -13,8 +13,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf)
|
static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf) {
|
||||||
{
|
|
||||||
int len = 0;
|
int len = 0;
|
||||||
char cmd[R_ASM_BUFSIZE];
|
char cmd[R_ASM_BUFSIZE];
|
||||||
ut8 *out;
|
ut8 *out;
|
||||||
|
@ -48,8 +47,7 @@ struct r_lib_struct_t radare_plugin = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TEST
|
#if TEST
|
||||||
main()
|
main() {
|
||||||
{
|
|
||||||
struct r_asm_fastcall_t *f;
|
struct r_asm_fastcall_t *f;
|
||||||
//f = r_asm_plugin_x86_nasm.fastcall;
|
//f = r_asm_plugin_x86_nasm.fastcall;
|
||||||
printf("fastcall=%p\n", *r_asm_plugin_x86_nasm.fastcall);
|
printf("fastcall=%p\n", *r_asm_plugin_x86_nasm.fastcall);
|
||||||
|
|
|
@ -881,12 +881,10 @@ static int cmd_anal(void *data, const char *input)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(input[0]) {
|
switch(input[0]) {
|
||||||
case '\0':
|
|
||||||
r_anal_list (&core->anal);
|
|
||||||
break;
|
|
||||||
case 'h':
|
case 'h':
|
||||||
if (input[1] && !r_anal_use (&core->anal, input+2))
|
if (input[1] && !r_anal_use (&core->anal, input+2))
|
||||||
eprintf("Cannot use '%s' anal plugin.\n", input+2);
|
eprintf("Cannot use '%s' anal plugin.\n", input+2);
|
||||||
|
else r_anal_list (&core->anal);
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ static int config_asm_arch_callback(void *user, void *data) {
|
||||||
int ret = r_asm_use (&core->assembler, node->value);
|
int ret = r_asm_use (&core->assembler, node->value);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
// TODO: control error and restore old value (return false?) show errormsg?
|
// TODO: control error and restore old value (return false?) show errormsg?
|
||||||
eprintf ("Cannot set this arch (%s)\n", node->value);
|
eprintf ("asm.arch: Cannot set this arch (%s)\n", node->value);
|
||||||
}
|
}
|
||||||
return R_TRUE;
|
return R_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -403,6 +403,5 @@ R_API int r_core_config_init(struct r_core_t *core)
|
||||||
node->callback = &config_scrheight;
|
node->callback = &config_scrheight;
|
||||||
r_config_set("vm.realio", "false");
|
r_config_set("vm.realio", "false");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ R_API int r_debug_pid_list(struct r_debug_t *dbg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* processes */
|
/* processes */
|
||||||
R_API int r_debug_pid_add(struct r_debug_t *dbg)
|
R_API int r_debug_pid_parent(RDebugPid *pid)
|
||||||
{
|
{
|
||||||
// fork in child
|
// fork in child
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
R_API int r_debug_reg_sync(struct r_debug_t *dbg, int type, int write)
|
R_API int r_debug_reg_sync(struct r_debug_t *dbg, int type, int write)
|
||||||
{
|
{
|
||||||
|
ut8 buf[4096]; // XXX hacky!
|
||||||
int size, ret = R_FALSE;
|
int size, ret = R_FALSE;
|
||||||
if (write) {
|
if (write) {
|
||||||
if (dbg && dbg->h && dbg->h->reg_write) {
|
if (dbg && dbg->h && dbg->h->reg_write) {
|
||||||
|
@ -15,7 +16,6 @@ R_API int r_debug_reg_sync(struct r_debug_t *dbg, int type, int write)
|
||||||
} else {
|
} else {
|
||||||
/* read registers from debugger backend to dbg->regs */
|
/* read registers from debugger backend to dbg->regs */
|
||||||
if (dbg && dbg->h && dbg->h->reg_read) {
|
if (dbg && dbg->h && dbg->h->reg_read) {
|
||||||
ut8 buf[4096]; // XXX hacky!
|
|
||||||
size = dbg->h->reg_read (dbg, type, buf, sizeof (buf));
|
size = dbg->h->reg_read (dbg, type, buf, sizeof (buf));
|
||||||
if (size == R_FALSE)
|
if (size == R_FALSE)
|
||||||
eprintf ("r_debug_reg: error reading registers\n");
|
eprintf ("r_debug_reg: error reading registers\n");
|
||||||
|
@ -29,10 +29,10 @@ R_API int r_debug_reg_list(struct r_debug_t *dbg, int type, int size, int rad)
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = 0;
|
||||||
struct list_head *pos, *head = r_reg_get_list(dbg->reg, type);
|
struct list_head *pos, *head = r_reg_get_list(dbg->reg, type);
|
||||||
//printf("list type=%d size=%d\n", type, size);
|
//printf("list type=%d size=%d\n", type, size);
|
||||||
list_for_each(pos, head) {
|
list_for_each (pos, head) {
|
||||||
struct r_reg_item_t *item = list_entry(pos, struct r_reg_item_t, list);
|
struct r_reg_item_t *item = list_entry(pos, struct r_reg_item_t, list);
|
||||||
//printf("--> t=%d\n", item->type);
|
//printf("--> t=%d\n", item->type);
|
||||||
if (type != -1 && type != item->type)
|
if (type != -1 && type != item->type)
|
||||||
continue;
|
continue;
|
||||||
if (size != 0 && size != item->size)
|
if (size != 0 && size != item->size)
|
||||||
|
|
|
@ -93,10 +93,11 @@ typedef struct r_debug_pid_t {
|
||||||
int pid;
|
int pid;
|
||||||
int status; /* stopped, running, zombie, sleeping ,... */
|
int status; /* stopped, running, zombie, sleeping ,... */
|
||||||
int runnable; /* when using 'run', 'continue', .. this proc will be runnable */
|
int runnable; /* when using 'run', 'continue', .. this proc will be runnable */
|
||||||
struct list_head threads;
|
const char *path;
|
||||||
struct list_head childs;
|
//struct list_head threads;
|
||||||
struct r_debug_pid_t *parent;
|
//struct list_head childs;
|
||||||
struct list_head list;
|
//struct r_debug_pid_t *parent;
|
||||||
|
//struct list_head list;
|
||||||
} RDebugPid;
|
} RDebugPid;
|
||||||
|
|
||||||
#ifdef R_API
|
#ifdef R_API
|
||||||
|
|
|
@ -63,8 +63,7 @@
|
||||||
/* allocating */
|
/* allocating */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
static inline int ERR(char *str, ...)
|
static inline int ERR(char *str, ...) {
|
||||||
{
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, str);
|
va_start(ap, str);
|
||||||
vfprintf(stderr, str, ap);
|
vfprintf(stderr, str, ap);
|
||||||
|
|
Loading…
Reference in New Issue