df8499f9324347a6baf2b1d253292fd47f9b8330
[reactos.git] / rosapps / applications / devutils / cputointel / CpuToIntel.c
1
2
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <string.h>
6 #include "misc.h"
7 #include "any_op.h"
8
9 PMYBrainAnalys pMyBrainAnalys = NULL;
10 PMYBrainAnalys pStartMyBrainAnalys = NULL;
11
12
13 int main(int argc, char * argv[])
14 {
15 //CPU_UNINT BaseAddress=0;
16 //int t=0;
17 //char *infile=NULL;
18 //char *outfile=NULL;
19 //char *cpuid=NULL;
20 //CPU_INT type=0;
21 //CPU_INT mode = 1;
22
23
24 //printf("Usage :\n");
25 //printf(" need for -inbin and autodetect if it does not found a PE header \n");
26 //printf(" -cpu m68000 : convert motorala 68000/68008 to intel asm \n");
27 //printf(" -cpu m68010 : convert motorala 68010 to intel asm \n");
28 //printf(" -cpu m68020 : convert motorala 68020 to intel asm \n");
29 //printf(" -cpu m68030 : convert motorala 68030 to intel asm \n");
30 //printf(" -cpu m68040 : convert motorala 68040 to intel asm \n");
31 //printf(" -cpu ppc : convert PowerPC to intel asm \n");
32 //printf(" -cpu ARM4 : convert ARM4 to intel asm \n");
33 //printf("------------------------------------------------------------------\n");
34 //printf(" for -inbin and autodetect if it does not found a PE header or do\n");
35 //printf(" not set at all, this options are free to use \n");
36 //printf(".......-BaseAddress adr : the start base address only accpect \n");
37 //printf("....... dec value");
38 //printf("------------------------------------------------------------------\n");
39 //printf(" -in filename : try autodetect file type for you");
40 //printf(" whant convert\n");
41 //printf(" -inBin filename : the bin file you whant convert\n");
42 //printf(" -inExe filename : the PE file you whant convert\n");
43 //printf(" -OutAsm filename : the Asm file you whant create\n");
44 //printf(" -OutDis filename : Do disambler of the source file\n");
45 //printf("------------------------------------------------------------------\n");
46 //printf("More cpu will be added with the time or options, this is \n");
47 //printf("version 0.0.1 of the cpu to intel converter writen by \n");
48 //printf("Magnus Olsen (magnus@greatlord.com), it does not do anything \n");
49 //printf("yet, more that basic desgin how it should be writen. \n");
50 //printf("Copyright 2006 by Magnus Olsen, licen under GPL 2.0 for now. \n");
51
52
53 //if (argc <4)
54 // return 110;
55
56 ///* fixme better error checking for the input param */
57 //for (t=1; t<argc;t+=2)
58 //{
59 // if (stricmp(argv[t],"-in"))
60 // {
61 // infile = argv[t+1];
62 // type=0;
63 // }
64
65 // if (stricmp(argv[t],"-inBin"))
66 // {
67 // infile = argv[t+1];
68 // type=1;
69 // }
70
71 // if (stricmp(argv[t],"-inExe"))
72 // {
73 // infile = argv[t+1];
74 // type=1;
75 // }
76
77 // if (stricmp(argv[t],"-OutAsm"))
78 // {
79 // outfile = argv[t+1];
80 // }
81 // if (stricmp(argv[t],"-OutDis"))
82 // {
83 // outfile = argv[t+1];
84 // mode = 0;
85 // }
86 // if (stricmp(argv[t],"-BaseAddress"))
87 // {
88 // BaseAddress = atol(argv[t+1]);
89 // }
90 // if (stricmp(argv[t],"-cpu"))
91 // {
92 // cpuid = argv[t+1];
93 // }
94
95 //}
96
97 // mode 0 disambler
98 // mode 1 convert to intel
99 // mode 2 convert to ppc
100 //return LoadPFileImage(infile,outfile,BaseAddress,cpuid,type, mode);
101 //LoadPFileImage("e:\\testppc.exe","e:\\cputointel.asm",0,0,0,1);
102 LoadPFileImage("e:\\testppc.exe","e:\\cputointel.asm",0,0,0,1);
103 //pMyBrainAnalys = NULL;
104 //pStartMyBrainAnalys = NULL;
105 //LoadPFileImage("e:\\testppc.exe","e:\\cputoppc.asm",0,0,0,2);
106
107 // return LoadPFileImage("e:\\testms.exe","e:\\cputointel.asm",0,0,0,1); // convert
108 return 0;
109 }
110
111
112
113
114
115
116
117