5 #define OP_ANY_mov 0x00000000
6 #define OP_ANY_ret 0x00000001
8 /* We are using same abi as PPC
28 typedef struct _BrainAnalys
30 CPU_UNINT op
; /* one tranlator for any cpu type set our own opcode */
31 CPU_INT type
; /* 1 = source are memmory, 2 source are register */
32 /* 4 = dest are memmory, 8 dest are register */
33 /* 16 = source are imm */
34 /* 32 = soucre -xx(r1) or [eax-xx] */
35 /* 64 = dest -xx(r1) or [eax-xx] */
36 /* 128 = update form the src be update with dest */
38 CPU_INT src_size
; /* who many bits are src not vaild for reg*/
39 CPU_INT dst_size
; /* who many bits are dst not vaild for reg*/
44 CPU_INT src_extra
; /* if type == 32 are set */
45 CPU_INT dst_extra
; /* if type == 32 are set */
47 CPU_UNINT memAdr
; /* where are we in the current memory pos + baseaddress */
49 CPU_INT row
; /* 0 = no row,
50 * 1 = row is bcc (conditions),
51 * 2 = row is jsr (Call)
54 /* try translate the Adress to a name */
55 CPU_BYTE
* ptr_next
; /* hook next one */
56 CPU_BYTE
* ptr_prev
; /* hook previus one */
57 } MYBrainAnalys
, *PMYBrainAnalys
;
59 extern PMYBrainAnalys pMyBrainAnalys
; /* current working address */
60 extern PMYBrainAnalys pStartMyBrainAnalys
; /* start address */
62 CPU_INT
ConvertToIA32Process( FILE *outfp
,
63 PMYBrainAnalys pMystart
,
64 PMYBrainAnalys pMyend
, CPU_INT regbits
,
65 CPU_INT HowManyRegInUse
,
66 CPU_INT
*RegTableCount
);
68 CPU_INT
ConvertToPPCProcess( FILE *outfp
,
69 PMYBrainAnalys pMystart
,
70 PMYBrainAnalys pMyend
, CPU_INT regbits
,
71 CPU_INT HowManyRegInUse
,
72 CPU_INT
*RegTableCount
);