* Initial import of x86im (by pluf) into 'x86/x86im/'

* Add dummy ranal plugin for x86im
* Move dislen stuff to 'x86/dislen/'
* Add "import msdn" to TODO.refactoring

--HG--
rename : libr/anal/arch/x86/dislen.c => libr/anal/arch/x86/dislen/dislen.c
rename : libr/anal/arch/x86/dislen.h => libr/anal/arch/x86/dislen/dislen.h
This commit is contained in:
Nibble 2010-05-03 12:37:51 +02:00
parent 08cfc25e85
commit 5c3c8e70c6
16 changed files with 18911 additions and 2 deletions

View File

@ -51,6 +51,7 @@ Concrete TODO points
- Fix visual cursor in ANSI (raw ascii is inneficient)
- Use r_bin with r_io to get symbols
- The offset to read will define the module to analyze and retrieve syms
- Import msdn doc as comments
* r_db
- Implement iterators r_db_next() and r_db_prev()

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
//////////////////////////////////////////////////////////////
//
// x86 Instruction Manipulator: Decoder/Generator/Encoder v1.0
//
// (x) Pluf
//
//////////////////////////////////////////////////////////////
#ifndef __X86IM_H__
#define __X86IM_H__
#if __UNIX__
# define __stdcall
# define __in
# define __out
# define __inout
# define WORD unsigned short
# define DWORD unsigned int
# define BOOL int
# define TRUE 1
# define FALSE 0
#endif
#include "x86im_io.h"
#ifdef __X86IM_USE_FMT__
#include "x86im_fmt.h"
#endif
#include "x86im_gen.h"
#define X86IM_STATUS_SUCCESS 0x0
#define X86IM_STATUS_INVALID_ARGUMENTS 0x1
#define X86IM_STATUS_INVALID_OPCODE 0x2
int __stdcall x86im_dec( __inout x86im_instr_object *io,
__in unsigned long mode,
__in unsigned char *data );
int __stdcall x86im_gen( __inout x86im_instr_object *io,
__in unsigned long options,
__in unsigned long code,
__in unsigned long reg,
__in unsigned long mem,
__in unsigned long long disp,
__in unsigned long long imm );
int __stdcall x86im_enc( __inout x86im_instr_object *io,
__out unsigned char *data );
#endif // __X86IM_H__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
//////////////////////////////////////////////////////////////
//
// x86 Instruction Manipulator: Decoder/Generator/Encoder v1.0
//
// (x) Pluf
//
//////////////////////////////////////////////////////////////
#ifndef __X86IM_FMT_H__
#define __X86IM_FMT_H__
#ifdef __X86IM_USE_FMT__
char *x86f_get_imn( __in x86im_instr_object *io );
char *x86f_get_reg( __in unsigned short reg );
unsigned int x86im_fmt( __in x86im_instr_object *io );
#endif
#endif // __X86IM_FMT_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
#include <r_asm.h>
#include <r_anal.h>
#include "x86/dislen.h"
#include "x86/dislen/dislen.h"
/* code analysis functions */

View File

@ -0,0 +1,30 @@
/* radare - LGPL - Copyright 2009 */
/* nibble<.ds@gmail.com> */
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_asm.h>
#include <r_anal.h>
#include "x86/dislen/dislen.h"
static int aop(RAnal *anal, RAnalAop *aop, ut64 addr, const ut8 *data, int len) {
return 0;
}
struct r_anal_handle_t r_anal_plugin_x86_x86im = {
.name = "x86_x86im",
.desc = "X86 x86im analysis plugin",
.init = NULL,
.fini = NULL,
.aop = &aop
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_x86_x86im
};
#endif

View File

@ -1,5 +1,5 @@
OBJ_X86=anal_x86.o
OBJ_X86+=../arch/x86/dislen.o
OBJ_X86+=../arch/x86/dislen/dislen.o
STATIC_OBJ+=${OBJ_X86}
TARGET_X86=anal_x86.${EXT_SO}

11
libr/anal/p/x86_x86im.mk Normal file
View File

@ -0,0 +1,11 @@
OBJ_X86_X86IM=anal_x86_x86im.o
#OBJ_X86_X86IM+=../arch/x86/dislen/dislen.o
STATIC_OBJ+=${OBJ_X86}
TARGET_X86_X86IM=anal_x86_x86im.${EXT_SO}
ALL_TARGETS+=${TARGET_X86}
${TARGET_X86_X86IM}: ${OBJ_X86_X86IM}
${CC} -shared ${CFLAGS} -o anal_x86_x86im.${EXT_SO} ${OBJ_X86_X86IM}
@#strip -s anal_x86_x86im.${EXT_SO}

View File

@ -281,6 +281,7 @@ R_API int r_anal_reflines_middle(RAnal *anal, RAnalRefline *list, ut64 addr, int
extern RAnalHandle r_anal_plugin_csr;
extern RAnalHandle r_anal_plugin_arm;
extern RAnalHandle r_anal_plugin_x86;
extern RAnalHandle r_anal_plugin_x86_x86im;
extern RAnalHandle r_anal_plugin_ppc;
#endif

View File

@ -8,6 +8,7 @@ asm.x86
asm.x86_nasm
asm.x86_olly
anal.x86
anal.x86_x86im
anal.arm
anal.csr
anal.ppc