00001 #ifndef STRUCTS_H
00002 #define STRUCTS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #define OSORT_FUNCTIONS 0x01
00015 #define OSORT_CLASSES 0x02
00016 #define OSORT_OBJECTS 0x04
00017 #define OSORT_STRINGS 0x08
00018 #define OSORT_DFUNCTIONS 0x10
00019 #define OSORT_DCLASSES 0x20
00020
00021
00022 typedef enum
00023 {
00024 OBJ_TYPE_UNKNOWN,
00025 OBJ_TYPE_STRING,
00026 OBJ_TYPE_OBJECT,
00027 OBJ_TYPE_MESSAGE,
00028 OBJ_TYPE_PARAM,
00029 OBJ_TYPE_CLASS,
00030 OBJ_TYPE_FUNCTION,
00031 OBJ_TYPE_INSTRUCTION,
00032 OBJ_TYPE_REFERENCE,
00033 OBJ_TYPE_VAR_REFERENCE,
00034 OBJ_TYPE_MAX
00035 } RE_ObjectType;
00036
00037
00038 typedef enum
00039 {
00040 RESULT_TYPE_INVALID,
00041 RESULT_TYPE_DIRECT_VALUE,
00042 RESULT_TYPE_INDIRECT_VALUE,
00043 RESULT_TYPE_LOCAL,
00044 RESULT_TYPE_GLOBAL,
00045 RESULT_TYPE_PARAM,
00046 RESULT_TYPE_MESSAGE,
00047 RESULT_TYPE_JUMP,
00048 RESULT_TYPE_MAX
00049 } RE_ResultType;
00050
00051 typedef enum
00052 {
00053 REG_EAX,
00054 REG_EBX,
00055 REG_ECX,
00056 REG_EDX,
00057 REG_EBP,
00058 REG_ESP,
00059 REG_EDI,
00060 REG_ESI,
00061 REG_MAX
00062 } RE_Registers;
00063
00064 typedef enum
00065 {
00066 DIRECT_REF,
00067 INDIRECT_REF
00068 } RE_RefType;
00069
00070 typedef enum
00071 {
00072 MAP_STRINGS,
00073 MAP_SYMBOLS,
00074 MAP_DYNSYM,
00075 MAP_REFS,
00076 MAP_JUMPS,
00077 MAP_MESSAGES,
00078 MAP_PARAMS,
00079 MAP_MAX
00080 } RE_mappings;
00081
00082
00083 typedef struct _Reference Reference;
00084 struct _Reference
00085 {
00086 uint32 addr;
00087 RE_RefType type;
00088 Reference* next;
00089 } ;
00090
00091 typedef struct
00092 {
00093 Reference *list_Ref;
00094 } LIST_Reference;
00095
00096 typedef struct _Callee
00097 {
00098 struct _Mapping *mapping;
00099 struct _Callee *next;
00100 } Callee;
00101
00102 typedef struct
00103 {
00104 Callee *list_ref;
00105 } LIST_Callee;
00106
00107
00108 typedef struct _Mapping Mapping;
00109 struct _Mapping
00110 {
00111 uint8 is_printed;
00112 uint32 addr;
00113 uint32 size;
00114 uint8 label[STRING_MAX_SIZE];
00115 RE_ObjectType type;
00116 LIST_Reference references;
00117 LIST_Callee callees;
00118 Mapping *next;
00119 Mapping *prev;
00120 Mapping *next_alpha;
00121 Mapping *prev_alpha;
00122 } ;
00123
00124 typedef struct
00125 {
00126 Mapping *list_Map;
00127 Mapping *tail;
00128 Mapping *alpha;
00129 } LIST_Mapping;
00130
00131 typedef struct
00132 {
00133 uint8 name[STRING_MAX_SIZE];
00134 uint32 addr;
00135 uint32 size;
00136 } Section;
00137
00138 typedef struct
00139 {
00140 uint8 name[REG_MAX_SIZE];
00141 uint32 value;
00142 RE_ResultType type;
00143 uint8 isValid;
00144 } Register;
00145
00146 typedef struct
00147 {
00148 Register registers[REG_MAX];
00149 uint32 addr;
00150 uint8 free;
00151 } RegisterContextBase;
00152
00153 typedef struct
00154 {
00155 RegisterContextBase context[MAX_REG_CNTX];
00156 uint32 nextCntx;
00157 } RegisterContext;
00158
00159 typedef struct
00160 {
00161 uint32 addr;
00162 uint32 value;
00163 } PLT_Jump;
00164
00165
00166 typedef struct
00167 {
00168 uint8 name[STRING_MAX_SIZE];
00169 uint8 offset;
00170 } Parameter;
00171
00172 typedef struct
00173 {
00174 uint8 isValid;
00175 uint8 functionIsC;
00176 uint8 functionHasMessage;
00177 uint8 nbParams;
00178 Parameter param[MAX_PARAMS];
00179 } Function_Params;
00180
00181 typedef struct
00182 {
00183 uint8 name[STRING_MAX_SIZE];
00184 uint32 size;
00185 } Parameter_Size;
00186
00187
00188 typedef struct
00189 {
00190 uint8 exe_FileName[STRING_MAX_SIZE];
00191 uint8 dest_FileName[STRING_MAX_SIZE];
00192 uint8 asm_SrcFileName[STRING_MAX_SIZE];
00193 uint8 objdump_FileName[STRING_MAX_SIZE];
00194 uint8 sym_FileName[STRING_MAX_SIZE];
00195 Section sections[MAX_SECTIONS];
00196 uint8 splitOutput;
00197 uint8 ctags;
00198 uint8 printPlt;
00199 uint8 printDsym;
00200 char blank_line[16];
00201
00202 uint8 offsetSort;
00203 uint8 printGraph;
00204 uint8 symInject;
00205 uint8 noDupSym;
00206 } Settings ;
00207
00208
00209 #endif