forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* More Makefile refactoring and cleanup
* Minor cleanups in r_asm.h * First work in r_anal
- Loading branch information
1 parent
fcb58f1
commit 710adba
Showing
13 changed files
with
151 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* radare - LGPL - Copyright 2009 nibble<[email protected]> */ | ||
|
||
struct r_anal_t *r_anal_new() | ||
{ | ||
struct r_anal_t *a = MALLOC_STRUCT(struct r_anal_t); | ||
r_asm_init(a); | ||
return a; | ||
} | ||
|
||
void r_anal_free(struct r_anal_t *a) | ||
{ | ||
free(a); | ||
} | ||
|
||
int r_anal_init(struct r_anal_t *a) | ||
{ | ||
return R_TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ OBJ=test.o | |
BINDEPS=r_util r_cmd | ||
|
||
include ../../rules.mk | ||
include ../../tests.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ BIN=hello | |
#LIBS=../*.o ../../line/*.a ../../util/*.a | ||
|
||
include ../../rules.mk | ||
include ../../tests.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,3 @@ LIBS+=-ldl | |
LIBS+=-ldl | ||
|
||
include ../../rules.mk | ||
include ../../tests.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ OBJ=hello.o | |
BIN=hello | ||
LIBS=../*.o ../../io/*.o -lm | ||
|
||
include ../../tests.mk | ||
include ../../rules.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* radare - LGPL - Copyright 2009 nibble<[email protected]> */ | ||
|
||
#ifndef _INCLUDE_R_ANAL_H_ | ||
#define _INCLUDE_R_ANAL_H_ | ||
|
||
#include "r_types.h" | ||
|
||
enum { | ||
R_ANAL_AOP_NULL = 0, | ||
R_ANAL_AOP_TYPE_JMP, /* mandatory jump */ | ||
R_ANAL_AOP_TYPE_UJMP, /* unknown jump (register or so) */ | ||
R_ANAL_AOP_TYPE_CJMP, /* conditional jump */ | ||
R_ANAL_AOP_TYPE_CALL, /* call to subroutine (branch+link) */ | ||
R_ANAL_AOP_TYPE_RCALL, /* call to register */ | ||
R_ANAL_AOP_TYPE_REP, /* repeats next instruction N times */ | ||
R_ANAL_AOP_TYPE_RET, /* returns from subrutine */ | ||
R_ANAL_AOP_TYPE_ILL, /* illegal instruction // trap */ | ||
R_ANAL_AOP_TYPE_UNK, /* unknown opcode type */ | ||
R_ANAL_AOP_TYPE_NOP, /* does nothing */ | ||
R_ANAL_AOP_TYPE_MOV, /* register move */ | ||
R_ANAL_AOP_TYPE_TRAP, /* it's a trap! */ | ||
R_ANAL_AOP_TYPE_SWI, /* syscall, software interrupt */ | ||
R_ANAL_AOP_TYPE_UPUSH, /* unknown push of data into stack */ | ||
R_ANAL_AOP_TYPE_PUSH, /* push value into stack */ | ||
R_ANAL_AOP_TYPE_POP, /* pop value from stack to register */ | ||
R_ANAL_AOP_TYPE_CMP, /* copmpare something */ | ||
R_ANAL_AOP_TYPE_ADD, | ||
R_ANAL_AOP_TYPE_SUB, | ||
R_ANAL_AOP_TYPE_MUL, | ||
R_ANAL_AOP_TYPE_DIV, | ||
R_ANAL_AOP_TYPE_SHR, | ||
R_ANAL_AOP_TYPE_SHL, | ||
R_ANAL_AOP_TYPE_OR, | ||
R_ANAL_AOP_TYPE_AND, | ||
R_ANAL_AOP_TYPE_XOR, | ||
R_ANAL_AOP_TYPE_NOT, | ||
R_ANAL_AOP_TYPE_STORE, /* store from register to memory */ | ||
R_ANAL_AOP_TYPE_LOAD /* load from memory to register */ | ||
}; | ||
|
||
enum { | ||
R_ANAL_DATA_NULL = 0, | ||
R_ANAL_DATA_HEX, /* hex byte pairs */ | ||
R_ANAL_DATA_STR, /* ascii string */ | ||
R_ANAL_DATA_CODE, /* plain assembly code */ | ||
R_ANAL_DATA_FUN, /* plain assembly code */ | ||
R_ANAL_DATA_STRUCT /* memory */ | ||
}; | ||
|
||
enum { | ||
R_ANAL_BLK_TYPE_NULL = 0, | ||
R_ANAL_BLK_TYPE_HEAD, /* first block */ | ||
R_ANAL_BLK_TYPE_BODY, /* conditional jump */ | ||
R_ANAL_BLK_TYPE_LAST, /* ret */ | ||
R_ANAL_BLK_TYPE_FOOT /* unknown jump */ | ||
}; | ||
|
||
enum { | ||
R_ANAL_STACK_NULL = 0, | ||
R_ANAL_STACK_NOP, /* sub $0xc, %esp */ | ||
R_ANAL_STACK_INCSTACK, /* sub $0xc, %esp */ | ||
R_ANAL_STACK_LOCAL_GET, | ||
R_ANAL_STACK_LOCAL_SET, | ||
R_ANAL_STACK_ARG_GET, | ||
R_ANAL_STACK_ARG_SET | ||
}; | ||
|
||
struct r_anal_aop_t { | ||
int type; /* type of opcode */ | ||
int stackop; /* operation on stack? */ | ||
int length; /* length in bytes of opcode */ | ||
int eob; /* end of block (boolean) */ | ||
u64 jump; /* true jmp */ | ||
u64 fail; /* false jmp */ | ||
u64 ref; /* referente to memory */ | ||
u64 value; /* referente to value */ | ||
int r_dst,r_src1,r_src2; /* register arguments */ | ||
u64 i_dst,i_src1,i_src2; /* inmediate arguments */ | ||
}; | ||
|
||
struct r_anal_t { | ||
|
||
}; | ||
|
||
/* anal.c */ | ||
struct r_anal_t *r_anal_new(); | ||
void r_anal_free(struct r_anal_t *a); | ||
int r_anal_init(struct r_anal_t *a); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ BINDEPS=r_cons r_line r_util | |
# ${CC} ${LDFLAGS} ${OBJ} -o hello | ||
|
||
include ../../rules.mk | ||
include ../../tests.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ OBJ=hex.o | |
BINDEPS=r_cons r_util r_line r_print | ||
|
||
include ../../rules.mk | ||
include ../../tests.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ OBJ=hello.o | |
BIN=hello | ||
LIBS=../*.o | ||
|
||
include ../../tests.mk | ||
include ../../rules.mk |
This file was deleted.
Oops, something went wrong.