10 /* hack should be in misc.h*/
13 CPU_INT
ConvertProcess(FILE *outfp
, CPU_INT FromCpuid
, CPU_INT ToCpuid
)
17 CPU_INT HowManyRegInUse
= 0;
18 CPU_INT RegTableCount
[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
20 PMYBrainAnalys pMystart
= pStartMyBrainAnalys
;
21 PMYBrainAnalys pMyend
= pMyBrainAnalys
;
23 PMYBrainAnalys ptmpMystart
= pStartMyBrainAnalys
;
24 PMYBrainAnalys ptmpMyend
= pMyBrainAnalys
;
26 if ( (FromCpuid
== IMAGE_FILE_MACHINE_POWERPC
) ||
27 (FromCpuid
== IMAGE_FILE_MACHINE_I386
))
32 /* FIXME calc where todo first split */
34 /* count how many register we got */
35 ptmpMystart
= pMystart
;
37 while (ptmpMystart
!=NULL
)
39 if ((ptmpMystart
->type
& 2) == 2)
40 RegTableCount
[ptmpMystart
->src
]++;
42 if ((ptmpMystart
->type
& 8) == 8)
43 RegTableCount
[ptmpMystart
->dst
]++;
45 if ((ptmpMystart
->type
& 32) == 32)
46 RegTableCount
[ptmpMystart
->src
]++;
48 if ((ptmpMystart
->type
& 64) == 64)
49 RegTableCount
[ptmpMystart
->dst
]++;
51 if (ptmpMystart
== ptmpMyend
)
54 ptmpMystart
= (PMYBrainAnalys
) ptmpMystart
->ptr_next
;
59 if (RegTableCount
[t
]!=0)
67 /* switch to the acual converting now */
70 case IMAGE_FILE_MACHINE_I386
:
71 ret
= ConvertToIA32Process( outfp
, pMystart
,
77 printf("should not happen contact a devloper, x86 fail\n");
82 case IMAGE_FILE_MACHINE_POWERPC
:
83 ret
= ConvertToPPCProcess( outfp
, pMystart
,
89 printf("should not happen contact a devloper, x86 fail\n");
95 printf("should not happen contact a devloper, unknown fail\n");