From 81b0e18658c6daea0e372ad08074a7724ffedfcd Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Fri, 3 Apr 2009 09:16:09 +0000 Subject: [PATCH] - Delete cputointel and roswebparser as unfinished components which aren't going to be further developed. - Delete zoomin because there is a nicely working magnify application, and zoomin development stopped in 2002. svn path=/trunk/; revision=40344 --- .../devutils/cputointel/AnyalsingProcess.c | 17 - .../cputointel/ConvertToIA32Process.c | 261 --- .../devutils/cputointel/ConvertToPPCProcess.c | 180 -- .../devutils/cputointel/ConvertingProcess.c | 100 - .../devutils/cputointel/CpuToIntel.c | 117 -- .../devutils/cputointel/From/ARM/ARM.h | 17 - .../devutils/cputointel/From/ARM/ARMBrain.c | 98 - .../devutils/cputointel/From/ARM/ARMBrain.h | 12 - .../devutils/cputointel/From/ARM/ARMopcode.c | 50 - .../devutils/cputointel/From/IA32/IA32.h | 17 - .../devutils/cputointel/From/IA32/IA32Brain.c | 107 - .../devutils/cputointel/From/IA32/IA32Brain.h | 13 - .../cputointel/From/IA32/IA32opcode.c | 50 - .../devutils/cputointel/From/PPC/PPC.h | 23 - .../devutils/cputointel/From/PPC/PPCBrain.c | 143 -- .../devutils/cputointel/From/PPC/PPCBrain.h | 32 - .../devutils/cputointel/From/PPC/PPCopcode.c | 192 -- .../devutils/cputointel/From/dummycpu/Dummy.h | 17 - .../cputointel/From/dummycpu/DummyBrain.c | 95 - .../cputointel/From/dummycpu/DummyBrain.h | 12 - .../cputointel/From/dummycpu/Dummyopcode.c | 39 - .../devutils/cputointel/From/m68k/M68kBrain.c | 320 --- .../devutils/cputointel/From/m68k/M68kBrain.h | 38 - .../cputointel/From/m68k/M68kopcode.c | 287 --- .../devutils/cputointel/From/m68k/m68k.h | 41 - .../devutils/cputointel/ImageLoader.c | 563 ------ .../devutils/cputointel/OpCodePPC.txt | 77 - .../devutils/cputointel/ReadMe.txt | 76 - .../applications/devutils/cputointel/any_op.h | 74 - .../devutils/cputointel/cputointel.rbuild | 31 - .../applications/devutils/cputointel/misc.c | 199 -- .../applications/devutils/cputointel/misc.h | 35 - .../applications/devutils/directory.rbuild | 8 - .../devutils/roswebparser/Windows28591.h | 32 - .../devutils/roswebparser/Windows28592.h | 33 - .../devutils/roswebparser/oem437.h | 35 - .../devutils/roswebparser/oem850.h | 32 - .../devutils/roswebparser/roswebparser.c | 1779 ----------------- .../devutils/roswebparser/roswebparser.rbuild | 8 - .../applications/devutils/roswebparser/utf8.c | 75 - .../applications/devutils/zoomin/framewnd.c | 240 --- .../applications/devutils/zoomin/framewnd.h | 32 - .../devutils/zoomin/lang/en-US.rc | 85 - .../devutils/zoomin/lang/es-ES.rc | 85 - .../devutils/zoomin/lang/fr-FR.rc | 83 - .../devutils/zoomin/lang/no-NO.rc | 85 - .../devutils/zoomin/lang/sk-SK.rc | 87 - .../devutils/zoomin/lang/uk-UA.rc | 91 - rosapps/applications/devutils/zoomin/main.c | 119 -- rosapps/applications/devutils/zoomin/main.h | 40 - .../applications/devutils/zoomin/resource.h | 22 - .../applications/devutils/zoomin/zoomin.ico | Bin 1078 -> 0 bytes .../devutils/zoomin/zoomin.rbuild | 9 - .../applications/devutils/zoomin/zoomin.rc | 16 - 54 files changed, 6329 deletions(-) delete mode 100644 rosapps/applications/devutils/cputointel/AnyalsingProcess.c delete mode 100644 rosapps/applications/devutils/cputointel/ConvertToIA32Process.c delete mode 100644 rosapps/applications/devutils/cputointel/ConvertToPPCProcess.c delete mode 100644 rosapps/applications/devutils/cputointel/ConvertingProcess.c delete mode 100644 rosapps/applications/devutils/cputointel/CpuToIntel.c delete mode 100644 rosapps/applications/devutils/cputointel/From/ARM/ARM.h delete mode 100644 rosapps/applications/devutils/cputointel/From/ARM/ARMBrain.c delete mode 100644 rosapps/applications/devutils/cputointel/From/ARM/ARMBrain.h delete mode 100644 rosapps/applications/devutils/cputointel/From/ARM/ARMopcode.c delete mode 100644 rosapps/applications/devutils/cputointel/From/IA32/IA32.h delete mode 100644 rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.c delete mode 100644 rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.h delete mode 100644 rosapps/applications/devutils/cputointel/From/IA32/IA32opcode.c delete mode 100644 rosapps/applications/devutils/cputointel/From/PPC/PPC.h delete mode 100644 rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.c delete mode 100644 rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.h delete mode 100644 rosapps/applications/devutils/cputointel/From/PPC/PPCopcode.c delete mode 100644 rosapps/applications/devutils/cputointel/From/dummycpu/Dummy.h delete mode 100644 rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.c delete mode 100644 rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.h delete mode 100644 rosapps/applications/devutils/cputointel/From/dummycpu/Dummyopcode.c delete mode 100644 rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.c delete mode 100644 rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.h delete mode 100644 rosapps/applications/devutils/cputointel/From/m68k/M68kopcode.c delete mode 100644 rosapps/applications/devutils/cputointel/From/m68k/m68k.h delete mode 100644 rosapps/applications/devutils/cputointel/ImageLoader.c delete mode 100644 rosapps/applications/devutils/cputointel/OpCodePPC.txt delete mode 100644 rosapps/applications/devutils/cputointel/ReadMe.txt delete mode 100644 rosapps/applications/devutils/cputointel/any_op.h delete mode 100644 rosapps/applications/devutils/cputointel/cputointel.rbuild delete mode 100644 rosapps/applications/devutils/cputointel/misc.c delete mode 100644 rosapps/applications/devutils/cputointel/misc.h delete mode 100644 rosapps/applications/devutils/roswebparser/Windows28591.h delete mode 100644 rosapps/applications/devutils/roswebparser/Windows28592.h delete mode 100644 rosapps/applications/devutils/roswebparser/oem437.h delete mode 100644 rosapps/applications/devutils/roswebparser/oem850.h delete mode 100644 rosapps/applications/devutils/roswebparser/roswebparser.c delete mode 100644 rosapps/applications/devutils/roswebparser/roswebparser.rbuild delete mode 100644 rosapps/applications/devutils/roswebparser/utf8.c delete mode 100644 rosapps/applications/devutils/zoomin/framewnd.c delete mode 100644 rosapps/applications/devutils/zoomin/framewnd.h delete mode 100644 rosapps/applications/devutils/zoomin/lang/en-US.rc delete mode 100644 rosapps/applications/devutils/zoomin/lang/es-ES.rc delete mode 100644 rosapps/applications/devutils/zoomin/lang/fr-FR.rc delete mode 100644 rosapps/applications/devutils/zoomin/lang/no-NO.rc delete mode 100644 rosapps/applications/devutils/zoomin/lang/sk-SK.rc delete mode 100644 rosapps/applications/devutils/zoomin/lang/uk-UA.rc delete mode 100644 rosapps/applications/devutils/zoomin/main.c delete mode 100644 rosapps/applications/devutils/zoomin/main.h delete mode 100644 rosapps/applications/devutils/zoomin/resource.h delete mode 100644 rosapps/applications/devutils/zoomin/zoomin.ico delete mode 100644 rosapps/applications/devutils/zoomin/zoomin.rbuild delete mode 100644 rosapps/applications/devutils/zoomin/zoomin.rc diff --git a/rosapps/applications/devutils/cputointel/AnyalsingProcess.c b/rosapps/applications/devutils/cputointel/AnyalsingProcess.c deleted file mode 100644 index cf3190a9d7e..00000000000 --- a/rosapps/applications/devutils/cputointel/AnyalsingProcess.c +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include -#include "misc.h" -#include "any_op.h" - - -CPU_INT AnyalsingProcess() -{ - /* FIXME it will set a name to the memory if we got one */ - - /* FIXME build the jump table */ - - return 0; -} - - diff --git a/rosapps/applications/devutils/cputointel/ConvertToIA32Process.c b/rosapps/applications/devutils/cputointel/ConvertToIA32Process.c deleted file mode 100644 index 0398ab882c9..00000000000 --- a/rosapps/applications/devutils/cputointel/ConvertToIA32Process.c +++ /dev/null @@ -1,261 +0,0 @@ - -#include -#include - -#include -#include -#include -#include "misc.h" -#include "any_op.h" - -/* - * eax = register 3 - * edx = register 4 - * esp = register 1 - * ebp = register 31 - - * ecx = 8 - * ebx = 9 - * esi = 10 - * edi = 11 - * mmx/sse/fpu 0 = 12 - * mmx/sse/fpu 1 = 14 - * mmx/sse/fpu 2 = 16 - * mmx/sse/fpu 3 = 18 - * mmx/sse/fpu 4 = 20 - * mmx/sse/fpu 5 = 22 - * mmx/sse/fpu 6 = 24 - * mmx/sse/fpu 7 = 28 - */ - -static void standardreg(CPU_INT *RegTableCount, CPU_INT reg, CPU_INT setup_ebp, FILE *outfp) -{ - /* eax */ - if (reg == RegTableCount[3]) - { - fprintf(outfp,"eax"); - } - /* ebp */ - else if (reg == RegTableCount[31]) - { - fprintf(outfp,"ebp"); - } - /* edx */ - else if (reg == RegTableCount[4]) - { - fprintf(outfp,"edx"); - } - /* esp */ - else if (reg == RegTableCount[1]) - { - fprintf(outfp,"esp"); - } - /* ecx */ - else if (reg == RegTableCount[8]) - { - fprintf(outfp,"ecx"); - } - /* ebx */ - else if (reg == RegTableCount[9]) - { - fprintf(outfp,"ebx"); - } - /* esi */ - else if (reg == RegTableCount[10]) - { - fprintf(outfp,"esi"); - } - /* edi */ - else if (reg == RegTableCount[11]) - { - fprintf(outfp,"edi"); - } - else - { - if (setup_ebp == 1) - fprintf(outfp,"dword [ebx - %d]"); - else - fprintf(outfp,"; unsuported should not happen it happen :(\n"); - } -} - -CPU_INT ConvertToIA32Process( FILE *outfp, - PMYBrainAnalys pMystart, - PMYBrainAnalys pMyend, CPU_INT regbits, - CPU_INT HowManyRegInUse, - CPU_INT *RegTableCount) -{ - - CPU_INT stack = 0; - CPU_UNINT tmp; - CPU_INT setup_ebp = 0 ; /* 0 = no, 1 = yes */ - CPU_INT t=0; - - /* Fixme optimze the RegTableCount table */ - - //if (HowManyRegInUse > 9) - if (HowManyRegInUse > 8) - { - setup_ebp =1; /* we will use ebx as ebp */ - stack = HowManyRegInUse * regbits; - } - - if (RegTableCount[1]!=0) - t++; - if (RegTableCount[3]!=0) - t++; - if (RegTableCount[4]!=0) - t++; - if (RegTableCount[8]!=0) - t++; - if (RegTableCount[9]!=0) - t++; - if (RegTableCount[10]!=0) - t++; - if (RegTableCount[11]!=0) - t++; - if (RegTableCount[31]!=0) - t++; - - if (HowManyRegInUse != t) - { - /* fixme optimze the table or active the frame pointer */ - setup_ebp =1; /* we will use ebx as ebp */ - stack = HowManyRegInUse * regbits; - } - - fprintf(outfp,"BITS 32\n"); - fprintf(outfp,"GLOBAL _main\n"); - fprintf(outfp,"SECTION .text\n\n"); - fprintf(outfp,"; compile with nasm filename.asm -f win32, ld filename.obj -o filename.exe\n\n"); - fprintf(outfp,"_main:\n"); - - /* setup a frame pointer */ - - if (setup_ebp == 1) - { - fprintf(outfp,"\n; Setup frame pointer \n"); - fprintf(outfp,"push ebx\n"); - fprintf(outfp,"mov ebx,esp\n"); - fprintf(outfp,"sub esp, %d ; Alloc %d bytes for reg\n\n",stack,stack); - } - - - fprintf(outfp,"; Start the program \n"); - while (pMystart!=NULL) - { - /* fixme the line lookup from anaylysing process */ - - /* mov not full implement */ - if (pMystart->op == OP_ANY_mov) - { - printf("waring OP_ANY_mov are not full implement\n"); - - if ((pMystart->type & 8)== 8) - { - /* dst are register */ - tmp = stack - (pMystart->dst*regbits); - - if ((pMystart->type & 2)== 2) - { - fprintf(outfp,"mov "); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp," , "); - standardreg( RegTableCount, - pMystart->src, - setup_ebp, outfp); - fprintf(outfp,"\n"); - - } - if ((pMystart->type & 16)== 16) - { - /* source are imm */ - if ((pMystart->src == 0) && - (setup_ebp == 0)) - { - /* small optimze */ - fprintf(outfp,"xor "); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp,","); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp,"\n"); - } - else - { - fprintf(outfp,"mov "); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp,",%llu\n",pMystart->src); - } - } /* end "source are imm" */ - } /* end pMyBrainAnalys->type & 8 */ - - if ((pMystart->type & 64)== 64) - { - if ((pMystart->type & 2)== 2) - { - /* dest [eax - 0x20], source reg */ - - fprintf(outfp,"mov dword ["); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - if (pMystart->dst_extra>=0) - fprintf(outfp," +%d], ",pMystart->dst_extra); - else - fprintf(outfp," %d], ",pMystart->dst_extra); - - standardreg( RegTableCount, - pMystart->src, - setup_ebp, outfp); - fprintf(outfp,"\n"); - - if ((pMystart->type & 128)== 128) - { - fprintf(outfp,"mov "); - standardreg( RegTableCount, - pMystart->src, - setup_ebp, outfp); - fprintf(outfp," , "); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp," %d\n",pMystart->dst_extra); - } - } - } - - - - - } - - /* return */ - if (pMystart->op == OP_ANY_ret) - { - if (pMyBrainAnalys->ptr_next == NULL) - { - if (setup_ebp == 1) - { - fprintf(outfp,"\n; clean up after the frame \n"); - fprintf(outfp,"mov esp, ebx\n"); - fprintf(outfp,"pop ebx\n"); - } - } - fprintf(outfp,"ret\n"); - } - if (pMystart == pMyend) - pMystart=NULL; - else - pMystart = (PMYBrainAnalys) pMystart->ptr_next; - - } - return 0; -} diff --git a/rosapps/applications/devutils/cputointel/ConvertToPPCProcess.c b/rosapps/applications/devutils/cputointel/ConvertToPPCProcess.c deleted file mode 100644 index 4cb363f798f..00000000000 --- a/rosapps/applications/devutils/cputointel/ConvertToPPCProcess.c +++ /dev/null @@ -1,180 +0,0 @@ - -#include -#include - -#include -#include -#include -#include "misc.h" -#include "any_op.h" - -static void standardreg(CPU_INT *RegTableCount, CPU_UNINT reg, - CPU_INT setup_ebp, FILE *outfp) -{ - CPU_INT t, found = 0; - for (t=0;t<31;t++) - { - if (reg == RegTableCount[t]) - { - fprintf(outfp,"r%d",t); - found++; - break; - } - } - - if (found == 0) - { - fprintf(outfp,"r%d",reg); - } -} - -CPU_INT ConvertToPPCProcess( FILE *outfp, - PMYBrainAnalys pMystart, - PMYBrainAnalys pMyend, CPU_INT regbits, - CPU_INT HowManyRegInUse, - CPU_INT *RegTableCount) -{ - - CPU_INT stack = 0; - //CPU_UNINT tmp; - CPU_INT setup_ebp = 0 ; /* 0 = no, 1 = yes */ - CPU_INT t=0; - - if (HowManyRegInUse > 31) - { - setup_ebp =1; /* we will use ebx as ebp */ - stack = HowManyRegInUse * regbits; - } - - if (RegTableCount[1]!=0) - t++; - if (RegTableCount[3]!=0) - t++; - if (RegTableCount[4]!=0) - t++; - if (RegTableCount[8]!=0) - t++; - if (RegTableCount[9]!=0) - t++; - if (RegTableCount[10]!=0) - t++; - if (RegTableCount[11]!=0) - t++; - if (RegTableCount[31]!=0) - t++; - - if (HowManyRegInUse != t) - { - /* fixme optimze the table or active the frame pointer */ - setup_ebp =1; /* we will use ebx as ebp */ - stack = HowManyRegInUse * regbits; - } - - -/* fixme gas compatible - fprintf(outfp,"BITS 32\n"); - fprintf(outfp,"GLOBAL _main\n"); - fprintf(outfp,"SECTION .text\n\n"); - fprintf(outfp,"; compile with nasm filename.asm -f win32, ld filename.obj -o filename.exe\n\n"); - fprintf(outfp,"_main:\n"); -*/ - - /* setup a frame pointer */ - if (setup_ebp == 1) - { - /* fixme ppc frame pointer */ - // fprintf(outfp,"\n; Setup frame pointer \n"); - } - - fprintf(outfp,"; Start the program \n"); - while (pMystart!=NULL) - { - /* fixme the line lookup from anaylysing process */ - - /* mov not full implement */ - if (pMystart->op == OP_ANY_mov) - { - printf("waring OP_ANY_mov are not full implement\n"); - - if ((pMystart->type & 8)== 8) - { - /* dst are register */ - // FIXME frame pointer setup - // tmp = stack - (pMystart->dst*regbits); - - if ((pMystart->type & 2)== 2) - { - fprintf(outfp,"mr "); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp,","); - standardreg( RegTableCount, - pMystart->src, - setup_ebp, outfp); - fprintf(outfp,"\n"); - } - - if ((pMystart->type & 16)== 16) - { - /* source are imm */ - if (setup_ebp == 1) - fprintf(outfp,"not supporet\n"); - else - { - fprintf(outfp,"li "); - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp," , %llu\n",pMystart->src); - } - } - } /* end pMyBrainAnalys->type & 8 */ - - if ((pMystart->type & 64)== 64) - { - if ((pMystart->type & 2)== 2) - { - /* dest [eax - 0x20], source reg */ - if ((pMystart->type & 128)== 128) - { - fprintf(outfp,"stwu "); - } - else - { - fprintf(outfp,"stw "); - } - - standardreg( RegTableCount, - pMystart->src, - setup_ebp, outfp); - fprintf(outfp,", %d(",pMystart->dst_extra); - - standardreg( RegTableCount, - pMystart->dst, - setup_ebp, outfp); - fprintf(outfp,")\n"); - } - } /* end pMyBrainAnalys->type & 64 */ - } - - /* return */ - if (pMystart->op == OP_ANY_ret) - { - if (pMyBrainAnalys->ptr_next == NULL) - { - if (setup_ebp == 1) - { - // FIXME end our own frame pointer - fprintf(outfp,"\n; clean up after the frame \n"); - } - } - fprintf(outfp,"blr\n"); - } - if (pMystart == pMyend) - pMystart=NULL; - else - pMystart = (PMYBrainAnalys) pMystart->ptr_next; - } - return 0; -} diff --git a/rosapps/applications/devutils/cputointel/ConvertingProcess.c b/rosapps/applications/devutils/cputointel/ConvertingProcess.c deleted file mode 100644 index e8cc079375b..00000000000 --- a/rosapps/applications/devutils/cputointel/ConvertingProcess.c +++ /dev/null @@ -1,100 +0,0 @@ -#include -#include - -#include -#include -#include -#include "misc.h" -#include "any_op.h" - -/* hack should be in misc.h*/ - - -CPU_INT ConvertProcess(FILE *outfp, CPU_INT FromCpuid, CPU_INT ToCpuid) -{ - CPU_INT ret=0; - CPU_INT regbits=-1; - CPU_INT HowManyRegInUse = 0; - 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}; - CPU_INT t; - PMYBrainAnalys pMystart = pStartMyBrainAnalys; - PMYBrainAnalys pMyend = pMyBrainAnalys; - - PMYBrainAnalys ptmpMystart = pStartMyBrainAnalys; - PMYBrainAnalys ptmpMyend = pMyBrainAnalys; - - if ( (FromCpuid == IMAGE_FILE_MACHINE_POWERPC) || - (FromCpuid == IMAGE_FILE_MACHINE_I386)) - { - regbits = 32 / 8; - } - - /* FIXME calc where todo first split */ - - /* count how many register we got */ - ptmpMystart = pMystart; - ptmpMyend = pMyend; - while (ptmpMystart!=NULL) - { - if ((ptmpMystart->type & 2) == 2) - RegTableCount[ptmpMystart->src]++; - - if ((ptmpMystart->type & 8) == 8) - RegTableCount[ptmpMystart->dst]++; - - if ((ptmpMystart->type & 32) == 32) - RegTableCount[ptmpMystart->src]++; - - if ((ptmpMystart->type & 64) == 64) - RegTableCount[ptmpMystart->dst]++; - - if (ptmpMystart == ptmpMyend) - ptmpMystart=NULL; - else - ptmpMystart = (PMYBrainAnalys) ptmpMystart->ptr_next; - } - - for (t=0;t<=31;t++) - { - if (RegTableCount[t]!=0) - { - HowManyRegInUse++; - RegTableCount[t]=t; - } - } - - - /* switch to the acual converting now */ - switch (ToCpuid) - { - case IMAGE_FILE_MACHINE_I386: - ret = ConvertToIA32Process( outfp, pMystart, - pMyend, regbits, - HowManyRegInUse, - RegTableCount); - if (ret !=0) - { - printf("should not happen contact a devloper, x86 fail\n"); - return -1; - } - break; - - case IMAGE_FILE_MACHINE_POWERPC: - ret = ConvertToPPCProcess( outfp, pMystart, - pMyend, regbits, - HowManyRegInUse, - RegTableCount); - if (ret !=0) - { - printf("should not happen contact a devloper, x86 fail\n"); - return -1; - } - break; - - default: - printf("should not happen contact a devloper, unknown fail\n"); - return -1; - } - - return ret; -} diff --git a/rosapps/applications/devutils/cputointel/CpuToIntel.c b/rosapps/applications/devutils/cputointel/CpuToIntel.c deleted file mode 100644 index df8499f9324..00000000000 --- a/rosapps/applications/devutils/cputointel/CpuToIntel.c +++ /dev/null @@ -1,117 +0,0 @@ - - -#include -#include -#include -#include "misc.h" -#include "any_op.h" - -PMYBrainAnalys pMyBrainAnalys = NULL; -PMYBrainAnalys pStartMyBrainAnalys = NULL; - - -int main(int argc, char * argv[]) -{ - //CPU_UNINT BaseAddress=0; - //int t=0; - //char *infile=NULL; - //char *outfile=NULL; - //char *cpuid=NULL; - //CPU_INT type=0; - //CPU_INT mode = 1; - - - //printf("Usage :\n"); - //printf(" need for -inbin and autodetect if it does not found a PE header \n"); - //printf(" -cpu m68000 : convert motorala 68000/68008 to intel asm \n"); - //printf(" -cpu m68010 : convert motorala 68010 to intel asm \n"); - //printf(" -cpu m68020 : convert motorala 68020 to intel asm \n"); - //printf(" -cpu m68030 : convert motorala 68030 to intel asm \n"); - //printf(" -cpu m68040 : convert motorala 68040 to intel asm \n"); - //printf(" -cpu ppc : convert PowerPC to intel asm \n"); - //printf(" -cpu ARM4 : convert ARM4 to intel asm \n"); - //printf("------------------------------------------------------------------\n"); - //printf(" for -inbin and autodetect if it does not found a PE header or do\n"); - //printf(" not set at all, this options are free to use \n"); - //printf(".......-BaseAddress adr : the start base address only accpect \n"); - //printf("....... dec value"); - //printf("------------------------------------------------------------------\n"); - //printf(" -in filename : try autodetect file type for you"); - //printf(" whant convert\n"); - //printf(" -inBin filename : the bin file you whant convert\n"); - //printf(" -inExe filename : the PE file you whant convert\n"); - //printf(" -OutAsm filename : the Asm file you whant create\n"); - //printf(" -OutDis filename : Do disambler of the source file\n"); - //printf("------------------------------------------------------------------\n"); - //printf("More cpu will be added with the time or options, this is \n"); - //printf("version 0.0.1 of the cpu to intel converter writen by \n"); - //printf("Magnus Olsen (magnus@greatlord.com), it does not do anything \n"); - //printf("yet, more that basic desgin how it should be writen. \n"); - //printf("Copyright 2006 by Magnus Olsen, licen under GPL 2.0 for now. \n"); - - - //if (argc <4) - // return 110; - - ///* fixme better error checking for the input param */ - //for (t=1; t -#include -#include "ARMBrain.h" -#include "ARM.h" -#include "../../misc.h" - -/* - * DummyBrain is example how you create you own cpu brain to translate from - * cpu to intel assembler, I have not add DummyBrain to the loader it is not - * need it in our example. When you write you own brain, it must be setup in - * misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not - * need the brain you have writen so you do not need setup it there then. - * - * input param: - * cpu_buffer : the memory buffer with loaded program we whant translate - * cpu_pos : the positions in the cpu_buffer - * cpu_size : the alloced memory size of the cpu_buffer - * BaseAddress : the virtual memory address we setup to use. - * cpuarch : the sub arch for the brain, example if it exists more one - * cpu with same desgin but few other opcode or extend opcode - * outfp : the output file pointer - * - * mode : if we should run disambler of this binary or - * translate it, Disambler will not calc the - * the row name right so we simple give each - row a name. In translations mode we run a - * analys so we getting better optimzing and - * only row name there we need. - * value for mode are : - * 0 = disambler mode - * 1 = translate mode intel - * - * return value - * 0 : Ok - * 1 : unimplemt - * 2 : Unkonwn Opcode - * 3 : unimplement cpu - * 4 : unknown machine - */ - -CPU_INT ARMBrain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp) -{ - CPU_UNINT cpu_oldpos; - CPU_INT cpuint; - CPU_INT retcode = 0; - CPU_INT retsize; - - - /* now we start the process */ - while (cpu_pos=cpu_size) - { - break; - } - - /* Check if we have found a cpu opcode */ - if (cpu_oldpos == cpu_pos) - { - if (retcode == 0) - { - /* no unimplement error where found so we return a msg for unknown opcode */ - printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]); - retcode = 2; - } - } - - /* Erorro Found ? */ - if (retcode!=0) - { - /* Erorro Found break and return the error code */ - break; - } - } - return retcode; -} diff --git a/rosapps/applications/devutils/cputointel/From/ARM/ARMBrain.h b/rosapps/applications/devutils/cputointel/From/ARM/ARMBrain.h deleted file mode 100644 index 0b589fb24e2..00000000000 --- a/rosapps/applications/devutils/cputointel/From/ARM/ARMBrain.h +++ /dev/null @@ -1,12 +0,0 @@ - -#include "../../misc.h" - - -/* example how setup a opcode, this opcode is 16bit long (taken from M68K) - * 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent - * thing in the opcode, example which reg so on, it can be etither 0 or 1 in - * the opcode. but a opcode have also normal bit that is always been set to - * same. thuse bit are always 0 or 1 - */ -CPU_BYTE cpuARMInit_[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}; - diff --git a/rosapps/applications/devutils/cputointel/From/ARM/ARMopcode.c b/rosapps/applications/devutils/cputointel/From/ARM/ARMopcode.c deleted file mode 100644 index bf218088444..00000000000 --- a/rosapps/applications/devutils/cputointel/From/ARM/ARMopcode.c +++ /dev/null @@ -1,50 +0,0 @@ - -#include -#include -#include "../../misc.h" - - -/* cpuDummyInit_Add - * Input param : - * out : The file pointer that we write to (the output file to intel asm) - * cpu_buffer : The memory buffer we have our binary code that we whant convert - * cpu_pos : Current positions in the cpu_buffer - * cpu_size : The memory size of the cpu_buffer - * BaseAddress : The base address you whant the binay file should run from - * cpuarch : if it exists diffent cpu from a manufactor like pentium, - * pentinum-mmx so on, use this flag to specify which type - * of cpu you whant or do not use it if it does not exists - * other or any sub model. - * - * mode : if we should run disambler of this binary or - * translate it, Disambler will not calc the - * the row name right so we simple give each - row a name. In translations mode we run a - * analys so we getting better optimzing and - * only row name there we need. - * value for mode are : - * 0 = disambler mode - * 1 = translate mode intel - - * - * Return value : - * value -1 : unimplement - * value 0 : wrong opcode or not vaild opcode - * value +1 and higher : who many byte we should add to cpu_pos - */ - -CPU_INT ARM_( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) - -{ - /* - * ConvertBitToByte() is perfect to use to get the bit being in use from a bit array - * GetMaskByte() is perfect if u whant known which bit have been mask out - * see M68kopcode.c and how it use the ConvertBitToByte() - */ - - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Add unimplement\n"); - return -1; -} diff --git a/rosapps/applications/devutils/cputointel/From/IA32/IA32.h b/rosapps/applications/devutils/cputointel/From/IA32/IA32.h deleted file mode 100644 index 52cfcde762b..00000000000 --- a/rosapps/applications/devutils/cputointel/From/IA32/IA32.h +++ /dev/null @@ -1,17 +0,0 @@ - -#include "../../misc.h" - -CPU_INT IA32Brain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp); - -/* here we put the prototype for the opcode api that brain need we show a example for it */ -CPU_INT IA32_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); - - -/* Export comment thing see m68k for example - * in dummy we do not show it, for it is diffent for each cpu - */ diff --git a/rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.c b/rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.c deleted file mode 100644 index e97ad4123b6..00000000000 --- a/rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.c +++ /dev/null @@ -1,107 +0,0 @@ - -#include -#include -#include "IA32Brain.h" -#include "IA32.h" -#include "../../any_op.h" -#include "../../misc.h" - - - - -/* - * DummyBrain is example how you create you own cpu brain to translate from - * cpu to intel assembler, I have not add DummyBrain to the loader it is not - * need it in our example. When you write you own brain, it must be setup in - * misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not - * need the brain you have writen so you do not need setup it there then. - * - * input param: - * cpu_buffer : the memory buffer with loaded program we whant translate - * cpu_pos : the positions in the cpu_buffer - * cpu_size : the alloced memory size of the cpu_buffer - * BaseAddress : the virtual memory address we setup to use. - * cpuarch : the sub arch for the brain, example if it exists more one - * cpu with same desgin but few other opcode or extend opcode - * outfp : the output file pointer - * - * mode : if we should run disambler of this binary or - * translate it, Disambler will not calc the - * the row name right so we simple give each - row a name. In translations mode we run a - * analys so we getting better optimzing and - * only row name there we need. - * value for mode are : - * 0 = disambler mode - * 1 = translate mode intel - * - * return value - * 0 : Ok - * 1 : unimplemt - * 2 : Unkonwn Opcode - * 3 : unimplement cpu - * 4 : unknown machine - */ - -CPU_INT IA32Brain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp) -{ - CPU_UNINT cpu_oldpos; - CPU_INT cpuint; - CPU_INT retcode = 0; - CPU_INT retsize; - - /* now we start the process */ - while (cpu_pos=cpu_size) - { - break; - } - - /* Check if we have found a cpu opcode */ - if (cpu_oldpos == cpu_pos) - { - if (retcode == 0) - { - /* no unimplement error where found so we return a msg for unknown opcode */ - printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]); - retcode = 2; - } - } - - /* Erorro Found ? */ - if (retcode!=0) - { - /* Erorro Found break and return the error code */ - break; - } - } - return retcode; -} diff --git a/rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.h b/rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.h deleted file mode 100644 index e141630eeaa..00000000000 --- a/rosapps/applications/devutils/cputointel/From/IA32/IA32Brain.h +++ /dev/null @@ -1,13 +0,0 @@ - - -#include "../../misc.h" - - -/* example how setup a opcode, this opcode is 16bit long (taken from M68K) - * 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent - * thing in the opcode, example which reg so on, it can be etither 0 or 1 in - * the opcode. but a opcode have also normal bit that is always been set to - * same. thuse bit are always 0 or 1 - */ -CPU_BYTE cpuIA32Init_Add[16] = {1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2}; - diff --git a/rosapps/applications/devutils/cputointel/From/IA32/IA32opcode.c b/rosapps/applications/devutils/cputointel/From/IA32/IA32opcode.c deleted file mode 100644 index 5ed42928d76..00000000000 --- a/rosapps/applications/devutils/cputointel/From/IA32/IA32opcode.c +++ /dev/null @@ -1,50 +0,0 @@ - -#include -#include -#include "IA32.h" -#include "../../misc.h" - - -/* cpuDummyInit_Add - * Input param : - * out : The file pointer that we write to (the output file to intel asm) - * cpu_buffer : The memory buffer we have our binary code that we whant convert - * cpu_pos : Current positions in the cpu_buffer - * cpu_size : The memory size of the cpu_buffer - * BaseAddress : The base address you whant the binay file should run from - * cpuarch : if it exists diffent cpu from a manufactor like pentium, - * pentinum-mmx so on, use this flag to specify which type - * of cpu you whant or do not use it if it does not exists - * other or any sub model. - * - * mode : if we should run disambler of this binary or - * translate it, Disambler will not calc the - * the row name right so we simple give each - row a name. In translations mode we run a - * analys so we getting better optimzing and - * only row name there we need. - * value for mode are : - * 0 = disambler mode - * 1 = translate mode intel - * - * Return value : - * value -1 : unimplement - * value 0 : wrong opcode or not vaild opcode - * value +1 and higher : who many byte we should add to cpu_pos - */ - -CPU_INT IA32_Add( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) - -{ - /* - * ConvertBitToByte() is perfect to use to get the bit being in use from a bit array - * GetMaskByte() is perfect if u whant known which bit have been mask out - * see M68kopcode.c and how it use the ConvertBitToByte() - */ - - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Add unimplement\n"); - return -1; -} diff --git a/rosapps/applications/devutils/cputointel/From/PPC/PPC.h b/rosapps/applications/devutils/cputointel/From/PPC/PPC.h deleted file mode 100644 index e6c9598704f..00000000000 --- a/rosapps/applications/devutils/cputointel/From/PPC/PPC.h +++ /dev/null @@ -1,23 +0,0 @@ - -#include "../../misc.h" - -CPU_INT PPCBrain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp); - - -/* here we put the prototype for the opcode api that brain need we show a example for it */ -CPU_INT PPC_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT PPC_Li( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT PPC_mr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT PPC_Stw( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT PPC_Stwu( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); - -/* Export comment thing see m68k for example - * in dummy we do not show it, for it is diffent for each cpu - */ - - diff --git a/rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.c b/rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.c deleted file mode 100644 index ac47a61d2d0..00000000000 --- a/rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.c +++ /dev/null @@ -1,143 +0,0 @@ - -#include -#include -#include "PPCBrain.h" -#include "PPC.h" -#include "../../misc.h" - -/* - * DummyBrain is example how you create you own cpu brain to translate from - * cpu to intel assembler, I have not add DummyBrain to the loader it is not - * need it in our example. When you write you own brain, it must be setup in - * misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not - * need the brain you have writen so you do not need setup it there then. - * - * input param: - * cpu_buffer : the memory buffer with loaded program we whant translate - * cpu_pos : the positions in the cpu_buffer - * cpu_size : the alloced memory size of the cpu_buffer - * BaseAddress : the virtual memory address we setup to use. - * cpuarch : the sub arch for the brain, example if it exists more one - * cpu with same desgin but few other opcode or extend opcode - * outfp : the output file pointer - * - * mode : if we should run disambler of this binary or - * translate it, Disambler will not calc the - * the row name right so we simple give each - row a name. In translations mode we run a - * analys so we getting better optimzing and - * only row name there we need. - * value for mode are : - * 0 = disambler mode - * 1 = translate mode intel - * - * return value - * 0 : Ok - * 1 : unimplemt - * 2 : Unkonwn Opcode - * 3 : unimplement cpu - * 4 : unknown machine - */ - -CPU_INT PPCBrain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp) -{ - CPU_UNINT cpu_oldpos; - CPU_INT cpuint; - CPU_INT retcode = 0; - CPU_INT retsize; - - /* now we start the process */ - while (cpu_pos=cpu_size) - { - break; - } - - /* Check if we have found a cpu opcode */ - if (cpu_oldpos == cpu_pos) - { - if (retcode == 0) - { - /* no unimplement error where found so we return a msg for unknown opcode */ - printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]); - retcode = 2; - } - } - - /* Erorro Found ? */ - if (retcode!=0) - { - /* Erorro Found break and return the error code */ - break; - } - } - - return 0; // hack getting dismabler working or converting working - return retcode; -} diff --git a/rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.h b/rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.h deleted file mode 100644 index 2fd436d3779..00000000000 --- a/rosapps/applications/devutils/cputointel/From/PPC/PPCBrain.h +++ /dev/null @@ -1,32 +0,0 @@ - -#include "../../misc.h" - - -/* example how setup a opcode, this opcode is 16bit long (taken from M68K) - * 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent - * thing in the opcode, example which reg so on, it can be etither 0 or 1 in - * the opcode. but a opcode have also normal bit that is always been set to - * same. thuse bit are always 0 or 1 - */ - -/* FIXME RA should be 0 in stwu */ -CPU_BYTE cpuPPCInit_Blr[32] = {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,1,0,0,1,1, 1,0}; -/* addi */ -CPU_BYTE cpuPPCInit_Li[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0, 0,0,1,1,1,0, 2,2}; -CPU_BYTE cpuPPCInit_stw[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,1,0,0, 2,2}; -CPU_BYTE cpuPPCInit_stwu[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,1,0,1, 2,2}; -CPU_BYTE cpuPPCInit_mr[32] = {0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,2,2,2,2,2,2,2,2, 0,1,1,1,1,1, 2,2}; -CPU_BYTE cpuPPCInit_lwz[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,0,0,0, 2,2}; - - - -/* mask */ -/* - * no mask we implement function getting the reg right - */ - -/* bit index - 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 - 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -*/ - diff --git a/rosapps/applications/devutils/cputointel/From/PPC/PPCopcode.c b/rosapps/applications/devutils/cputointel/From/PPC/PPCopcode.c deleted file mode 100644 index 65323b2ac26..00000000000 --- a/rosapps/applications/devutils/cputointel/From/PPC/PPCopcode.c +++ /dev/null @@ -1,192 +0,0 @@ - -#include -#include -#include "PPC.h" -#include "../../misc.h" -#include "../../any_op.h" - -/* reg r0-r31 - r3 = eax - */ - -/* cpuDummyInit_Add - * Input param : - * out : The file pointer that we write to (the output file to intel asm) - * cpu_buffer : The memory buffer we have our binary code that we whant convert - * cpu_pos : Current positions in the cpu_buffer - * cpu_size : The memory size of the cpu_buffer - * BaseAddress : The base address you whant the binay file should run from - * cpuarch : if it exists diffent cpu from a manufactor like pentium, - * pentinum-mmx so on, use this flag to specify which type - * of cpu you whant or do not use it if it does not exists - * other or any sub model. - * - * Return value : - * value -1 : unimplement - * value 0 : wrong opcode or not vaild opcode - * value +1 and higher : who many byte we should add to cpu_pos - */ - -/* Get Dest register */ -#define PPC_GetBitArraySrcReg(opcode) (((opcode & 0x3) << 3) | ((opcode & 0xE000) >> 13)) - -/* Get Source register */ -CPU_UNINT PPC_GetBitArrayBto31xx(CPU_UNINT opcode) -{ - CPU_INT x1; - - /* FIXME make it to a macro - * not tested to 100% yet */ - x1 = ((opcode & 0x1F00)>>8); - return x1; -} - - -CPU_UNINT PPC_GetBitArrayBto31(CPU_UNINT opcode) -{ - CPU_INT x1; - /* FIXME make it to a macro - * not tested to 100% yet */ - x1 = ((opcode & 0xFFFF0000)>>16); - return x1; -} - - -CPU_INT PPC_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - - BaseAddress +=cpu_pos; - - /* own translatons langues */ - if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */ - { - return -1; - } - pMyBrainAnalys->op = OP_ANY_ret; - pMyBrainAnalys->memAdr=BaseAddress; - - return 4; -} - - -CPU_INT PPC_Li( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - CPU_UNINT opcode; - - opcode = GetData32Le(&cpu_buffer[cpu_pos]); - - BaseAddress +=cpu_pos; - - /* own translatons langues */ - if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */ - { - return -1; - } - pMyBrainAnalys->op = OP_ANY_mov; - pMyBrainAnalys->type= 8 + 16; /* 8 dst reg, 16 imm */ - pMyBrainAnalys->src_size = 16; - pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode); - pMyBrainAnalys->dst = PPC_GetBitArrayBto31(opcode); - pMyBrainAnalys->memAdr=BaseAddress; - - return 4; -} - - -CPU_INT PPC_mr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - CPU_UNINT opcode; - - opcode = GetData32Le(&cpu_buffer[cpu_pos]); - - BaseAddress +=cpu_pos; - - /* own translatons langues */ - if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */ - { - return -1; - } - pMyBrainAnalys->op = OP_ANY_mov; - pMyBrainAnalys->type= 2 + 8; /* 8 dst reg, 2 src reg */ - pMyBrainAnalys->src_size = 32; - pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode); - pMyBrainAnalys->dst = PPC_GetBitArrayBto31xx(opcode); - pMyBrainAnalys->memAdr=BaseAddress; - - return 4; -} - - -CPU_INT PPC_Stw( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - /* r1 store at -0x20(r1) */ - - CPU_UNINT opcode; - CPU_SHORT tmp = 0; - - opcode = GetData32Le(&cpu_buffer[cpu_pos]); - - BaseAddress +=cpu_pos; - - /* own translatons langues */ - if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */ - { - return -1; - } - - tmp = _byteswap_ushort( ((CPU_SHORT)((opcode >> 16) & 0xffff))); - - pMyBrainAnalys->op = OP_ANY_mov; - pMyBrainAnalys->type= 2 + 64; - pMyBrainAnalys->src_size = 32; - pMyBrainAnalys->dst_size = 32; - pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode); - pMyBrainAnalys->dst = PPC_GetBitArrayBto31xx(opcode); - pMyBrainAnalys-> dst_extra = tmp; - pMyBrainAnalys->memAdr=BaseAddress; - - return 4; -} - -CPU_INT PPC_Stwu( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - /* r1 store at -0x20(r1) */ - - CPU_UNINT opcode; - CPU_INT DstReg; - CPU_SHORT tmp = 0; - - opcode = GetData32Le(&cpu_buffer[cpu_pos]); - - DstReg = PPC_GetBitArrayBto31xx(opcode); - if (DstReg == 0) - { - return 0; - } - - BaseAddress +=cpu_pos; - - /* own translatons langues */ - if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */ - { - return -1; - } - - tmp = _byteswap_ushort( ((CPU_SHORT)((opcode >> 16) & 0xffff))); - - pMyBrainAnalys->op = OP_ANY_mov; - pMyBrainAnalys->type= 2 + 64 + 128; - pMyBrainAnalys->src_size = 32; - pMyBrainAnalys->dst_size = 32; - pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode); - pMyBrainAnalys->dst = DstReg; - pMyBrainAnalys-> dst_extra = tmp; - pMyBrainAnalys->memAdr=BaseAddress; - - return 4; -} diff --git a/rosapps/applications/devutils/cputointel/From/dummycpu/Dummy.h b/rosapps/applications/devutils/cputointel/From/dummycpu/Dummy.h deleted file mode 100644 index 4e044e263db..00000000000 --- a/rosapps/applications/devutils/cputointel/From/dummycpu/Dummy.h +++ /dev/null @@ -1,17 +0,0 @@ - -#include "../../misc.h" - -CPU_INT DummyBrain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp); - -/* here we put the prototype for the opcode api that brain need we show a example for it */ -CPU_INT DUMMY_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); - - -/* Export comment thing see m68k for example - * in dummy we do not show it, for it is diffent for each cpu - */ diff --git a/rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.c b/rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.c deleted file mode 100644 index 67d20e2b936..00000000000 --- a/rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.c +++ /dev/null @@ -1,95 +0,0 @@ - -#include -#include -#include "DummyBrain.h" -#include "Dummy.h" -#include "../../misc.h" - - - -/* - * DummyBrain is example how you create you own cpu brain to translate from - * cpu to intel assembler, I have not add DummyBrain to the loader it is not - * need it in our example. When you write you own brain, it must be setup in - * misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not - * need the brain you have writen so you do not need setup it there then. - * - * input param: - * cpu_buffer : the memory buffer with loaded program we whant translate - * cpu_pos : the positions in the cpu_buffer - * cpu_size : the alloced memory size of the cpu_buffer - * BaseAddress : the virtual memory address we setup to use. - * cpuarch : the sub arch for the brain, example if it exists more one - * cpu with same desgin but few other opcode or extend opcode - * outfp : the output file pointer - * - * return value - * 0 : Ok - * 1 : unimplemt - * 2 : Unkonwn Opcode - * 3 : unimplement cpu - * 4 : unknown machine - */ - -CPU_INT DummyBrain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp) -{ - CPU_UNINT cpu_oldpos; - CPU_INT cpuint; - CPU_INT retcode = 0; - CPU_INT retsize; - - /* now we start the process */ - while (cpu_pos=cpu_size) - { - break; - } - - /* Check if we have found a cpu opcode */ - if (cpu_oldpos == cpu_pos) - { - if (retcode == 0) - { - /* no unimplement error where found so we return a msg for unknown opcode */ - printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]); - retcode = 2; - } - } - - /* Erorro Found ? */ - if (retcode!=0) - { - /* Erorro Found break and return the error code */ - break; - } - } - return retcode; -} diff --git a/rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.h b/rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.h deleted file mode 100644 index 02355bc9b91..00000000000 --- a/rosapps/applications/devutils/cputointel/From/dummycpu/DummyBrain.h +++ /dev/null @@ -1,12 +0,0 @@ - -#include "../../misc.h" - - -/* example how setup a opcode, this opcode is 16bit long (taken from M68K) - * 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent - * thing in the opcode, example which reg so on, it can be etither 0 or 1 in - * the opcode. but a opcode have also normal bit that is always been set to - * same. thuse bit are always 0 or 1 - */ -CPU_BYTE cpuDummyInit_Add[16] = {1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2}; - diff --git a/rosapps/applications/devutils/cputointel/From/dummycpu/Dummyopcode.c b/rosapps/applications/devutils/cputointel/From/dummycpu/Dummyopcode.c deleted file mode 100644 index 2dda611dfc0..00000000000 --- a/rosapps/applications/devutils/cputointel/From/dummycpu/Dummyopcode.c +++ /dev/null @@ -1,39 +0,0 @@ - -#include -#include -#include "Dummy.h" -#include "../../misc.h" - - -/* cpuDummyInit_Add - * Input param : - * out : The file pointer that we write to (the output file to intel asm) - * cpu_buffer : The memory buffer we have our binary code that we whant convert - * cpu_pos : Current positions in the cpu_buffer - * cpu_size : The memory size of the cpu_buffer - * BaseAddress : The base address you whant the binay file should run from - * cpuarch : if it exists diffent cpu from a manufactor like pentium, - * pentinum-mmx so on, use this flag to specify which type - * of cpu you whant or do not use it if it does not exists - * other or any sub model. - * Return value : - * value -1 : unimplement - * value 0 : wrong opcode or not vaild opcode - * value +1 and higher : who many byte we should add to cpu_pos - */ - -CPU_INT DUMMY_Add( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) - -{ - /* - * ConvertBitToByte() is perfect to use to get the bit being in use from a bit array - * GetMaskByte() is perfect if u whant known which bit have been mask out - * see M68kopcode.c and how it use the ConvertBitToByte() - */ - - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Add unimplement\n"); - return -1; -} diff --git a/rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.c b/rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.c deleted file mode 100644 index f33098b5c87..00000000000 --- a/rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.c +++ /dev/null @@ -1,320 +0,0 @@ - -#include -#include -#include "M68kBrain.h" -#include "m68k.h" -#include "../../misc.h" - -/* - * DummyBrain is example how you create you own cpu brain to translate from - * cpu to intel assembler, I have not add DummyBrain to the loader it is not - * need it in our example. When you write you own brain, it must be setup in - * misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not - * need the brain you have writen so you do not need setup it there then. - * - * input param: - * cpu_buffer : the memory buffer with loaded program we whant translate - * cpu_pos : the positions in the cpu_buffer - * cpu_size : the alloced memory size of the cpu_buffer - * BaseAddress : the virtual memory address we setup to use. - * cpuarch : the sub arch for the brain, example if it exists more one - * cpu with same desgin but few other opcode or extend opcode - * outfp : the output file pointer - * - * return value - * 0 : Ok - * 1 : unimplemt - * 2 : Unkonwn Opcode - * 3 : unimplement cpu - * 4 : unknown machine - */ - -CPU_INT M68KBrain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp) -{ - CPU_UNINT cpu_oldpos; - CPU_INT cpuint; - CPU_INT retcode = 0; - CPU_INT retsize; - - /* now we start the process */ - while (cpu_pos=cpu_size) - { - break; - } - - /* Check if we have found a cpu opcode */ - if (cpu_oldpos == cpu_pos) - { - if (retcode == 0) - { - /* no unimplement error where found so we return a msg for unknown opcode */ - printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]); - retcode = 2; - } - } - - /* Erorro Found ? */ - if (retcode!=0) - { - /* Erorro Found break and return the error code */ - break; - } - } - return retcode; -} diff --git a/rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.h b/rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.h deleted file mode 100644 index f140b1ef615..00000000000 --- a/rosapps/applications/devutils/cputointel/From/m68k/M68kBrain.h +++ /dev/null @@ -1,38 +0,0 @@ - -#include "../../misc.h" - -CPU_BYTE cpuM68kInit_Abcd[16] = {1,1,1,1,2,2,2,1,0,0,0,0,2,2,2,2}; -CPU_BYTE cpuM68kInit_Add[16] = {1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Addi[16] = {0,0,0,0,0,1,1,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Addq[16] = {0,1,0,1,2,2,2,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Addx[16] = {1,1,0,1,2,2,2,1,2,2,0,0,2,2,2,2}; -CPU_BYTE cpuM68kInit_And[16] = {1,1,0,0,2,2,2,2,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Andi[16] = {0,0,0,0,0,0,1,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_AndToCCRF[16] = {0,0,0,0,0,0,1,0,0,0,1,1,1,1,0,0}; -CPU_BYTE cpuM68kInit_AndToCCRS[16] = {0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Asl[16] = {1,1,1,0,2,2,2,0,2,2,2,0,0,2,2,2}; -CPU_BYTE cpuM68kInit_Asr[16] = {1,1,1,0,2,2,2,1,2,2,2,0,0,2,2,2}; - -CPU_BYTE cpuM68kInit_Bhi[16] = {0,1,1,0,0,0,1,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bls[16] = {0,1,1,0,0,0,1,1,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bcc[16] = {0,1,1,0,0,1,0,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bcs[16] = {0,1,1,0,0,1,0,1,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bne[16] = {0,1,1,0,0,1,1,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Beq[16] = {0,1,1,0,0,1,1,1,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bvc[16] = {0,1,1,0,1,0,0,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bvs[16] = {0,1,1,0,1,0,0,1,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bpl[16] = {0,1,1,0,1,0,1,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bmi[16] = {0,1,1,0,1,0,1,1,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bge[16] = {0,1,1,0,1,1,0,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Blt[16] = {0,1,1,0,1,1,0,1,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Bgt[16] = {0,1,1,0,1,1,1,0,2,2,2,2,2,2,2,2}; -CPU_BYTE cpuM68kInit_Ble[16] = {0,1,1,0,1,1,1,1,2,2,2,2,2,2,2,2}; - - -CPU_BYTE M68k_Rx[16] = {0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0}; -CPU_BYTE M68k_RM[16] = {0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}; -CPU_BYTE M68k_Ry[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1}; -CPU_BYTE M68k_Opmode[16] = {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0}; -CPU_BYTE M68k_Mode[16] = {0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0}; -CPU_BYTE M68k_Size[16] = {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0}; - diff --git a/rosapps/applications/devutils/cputointel/From/m68k/M68kopcode.c b/rosapps/applications/devutils/cputointel/From/m68k/M68kopcode.c deleted file mode 100644 index 0071681508c..00000000000 --- a/rosapps/applications/devutils/cputointel/From/m68k/M68kopcode.c +++ /dev/null @@ -1,287 +0,0 @@ - -#include -#include -#include "m68k.h" -#include "misc.h" - - -CPU_INT M68k_Abcd( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Abcd unimplement\n"); - return -1; -} - -CPU_INT M68k_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - CPU_INT opmode; - CPU_INT mode; - CPU_INT Rx; - CPU_INT Ry; - //CPU_INT cpuint; - - opmode = ConvertBitToByte(M68k_Opmode); - mode = ConvertBitToByte(M68k_Mode); - Rx = ConvertBitToByte(M68k_Rx); - Ry = ConvertBitToByte(M68k_Ry); - - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - if (opmode == 0x00) - { - /* + Dn -> Dn */ - printf(";Add unimplement of \" + Dn -> Dn\" \n"); - - } - - if (opmode == 0x01) - { - /* + Dn -> Dn */ - printf(";Add unimplement of \" + Dn -> Dn\" \n"); - } - - if (opmode == 0x02) - { - /* + Dn -> Dn */ - printf(";Add unimplement of \" + Dn -> Dn\" \n"); - } - - if (opmode == 0x03) - { - /* + An -> An */ - printf(";Add unimplement of \" + An -> An\" \n"); - } - - if (opmode == 0x04) - { - /* Dn + -> */ - printf(";Add unimplement of \"Dn + -> \" \n"); - } - - if (opmode == 0x05) - { - /* Dn + -> */ - printf(";Add unimplement of \"Dn + -> \" \n"); - } - - if (opmode == 0x06) - { - /* Dn + -> */ - printf(";Add unimplement of \"Dn + -> \" \n"); - } - - if (opmode == 0x07) - { - /* + An -> An */ - printf(";Add unimplement of \" + An -> An\" \n"); - } - - - - - - return -1; -} - -CPU_INT M68k_Addi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Addi unimplement\n"); - return -1; -} - -CPU_INT M68k_Addq( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Addq unimplement\n"); - return -1; -} - -CPU_INT M68k_Addx( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Addx unimplement\n"); - return -1; -} - -CPU_INT M68k_And( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";And unimplement\n"); - return -1; -} - -CPU_INT M68k_Andi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Andi unimplement\n"); - return -1; -} - -CPU_INT M68k_AndToCCR( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";AndToCCR unimplement\n"); - return -1; -} - -CPU_INT M68k_Asl( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Asl unimplement\n"); - return -1; -} - -CPU_INT M68k_Asr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Asr unimplement\n"); - return -1; -} - -CPU_INT M68k_Bhi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bhi unimplement\n"); - return -1; -} - -CPU_INT M68k_Bls( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bls unimplement\n"); - return -1; -} - -CPU_INT M68k_Bcc( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bcc unimplement\n"); - return -1; -} - -CPU_INT M68k_Bcs( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bcs unimplement\n"); - return -1; -} - -CPU_INT M68k_Bne( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bne unimplement\n"); - return -1; -} - -CPU_INT M68k_Beq( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Beq unimplement\n"); - return -1; -} - -CPU_INT M68k_Bvc( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bvc unimplement\n"); - return -1; -} - -CPU_INT M68k_Bvs( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bvs unimplement\n"); - return -1; -} - -CPU_INT M68k_Bpl( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bpl unimplement\n"); - return -1; -} - -CPU_INT M68k_Bmi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bmi unimplement\n"); - return -1; -} - -CPU_INT M68k_Bge( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bge unimplement\n"); - return -1; -} - -CPU_INT M68k_Blt( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Blt unimplement\n"); - return -1; -} - -CPU_INT M68k_Bgt( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Bgt unimplement\n"); - return -1; -} - -CPU_INT M68k_Ble( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch) -{ - fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos); - - printf(";Ble unimplement\n"); - return -1; -} - - diff --git a/rosapps/applications/devutils/cputointel/From/m68k/m68k.h b/rosapps/applications/devutils/cputointel/From/m68k/m68k.h deleted file mode 100644 index 124e7a4349e..00000000000 --- a/rosapps/applications/devutils/cputointel/From/m68k/m68k.h +++ /dev/null @@ -1,41 +0,0 @@ - -#include "../../misc.h" -CPU_INT M68KBrain( CPU_BYTE *cpu_buffer, - CPU_UNINT cpu_pos, - CPU_UNINT cpu_size, - CPU_UNINT BaseAddress, - CPU_UNINT cpuarch, - FILE *outfp); - - -CPU_INT M68k_Abcd(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Addi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Addq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Addx(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_And(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Andi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_AndToCCR(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Asl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Asr(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bhi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bls(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bcc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bcs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bne(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Beq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bvc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bvs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bpl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bmi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bge(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Blt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Bgt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); -CPU_INT M68k_Ble(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch); - -extern CPU_BYTE M68k_Rx[16]; -extern CPU_BYTE M68k_RM[16]; -extern CPU_BYTE M68k_Ry[16]; -extern CPU_BYTE M68k_Opmode[16]; -extern CPU_BYTE M68k_Mode[16]; -extern CPU_BYTE M68k_Size[16]; diff --git a/rosapps/applications/devutils/cputointel/ImageLoader.c b/rosapps/applications/devutils/cputointel/ImageLoader.c deleted file mode 100644 index 0e8c67c2ca0..00000000000 --- a/rosapps/applications/devutils/cputointel/ImageLoader.c +++ /dev/null @@ -1,563 +0,0 @@ -#include -#include - -#include -#include -#include -#include "misc.h" -#include "From/ARM/ARM.h" -#include "From/m68k/m68k.h" -#include "From/PPC/PPC.h" - -static CPU_INT machine_type = 0; -//static CPU_INT ToMachine_type = IMAGE_FILE_MACHINE_I386; -static CPU_INT ToMachine_type = IMAGE_FILE_MACHINE_POWERPC; -/* - * infileName file name to convert or disambler - * outputfileName file name to save to - * BaseAddress the address we should emulate - * cpuid the cpu we choice not vaild for pe loader - * type the loading mode Auto, PE, bin - * mode disambler mode : 0 the arch cpu. - * translate mode : 1 intel - * translate mode : 2 ppc - * - */ - -static void SetCPU(CPU_INT FromCpu, CPU_INT mode) -{ - machine_type = FromCpu; - switch(mode) - { - case 0: - ToMachine_type = machine_type; - break; - - case 1: - ToMachine_type = IMAGE_FILE_MACHINE_I386; - break; - - case 2: - ToMachine_type = IMAGE_FILE_MACHINE_POWERPC; - break; - - default: - printf("Not supported mode\n"); - break; - - } -} - -static void Convert(FILE *outfp, CPU_INT FromCpu, CPU_INT mode) -{ - SetCPU(machine_type,mode); - AnyalsingProcess(); - ConvertProcess(outfp, machine_type, ToMachine_type); - FreeAny(); -} - - -CPU_INT LoadPFileImage( char *infileName, char *outputfileName, - CPU_UNINT BaseAddress, char *cpuid, - CPU_UNINT type, CPU_INT mode) -{ - FILE *infp; - FILE *outfp; - CPU_BYTE *cpu_buffer; - CPU_UNINT cpu_pos = 0; - CPU_UNINT cpu_size=0; - CPU_INT ret; - //fopen("testms.exe","RB"); - - - /* Open file for read */ - - if (!(infp = fopen(infileName, "rb"))) - { - printf("Can not open file %s\n",infileName); - return 3; - } - - /* Open file for write */ - if (!(outfp = fopen(outputfileName,"wb"))) - { - printf("Can not open file %s\n",outputfileName); - return 4; - } - - /* Load the binary file to a memory buffer */ - fseek(infp,0,SEEK_END); - if (ferror(infp)) - { - printf("error can not seek in the read file"); - fclose(infp); - fclose(outfp); - return 5; - } - - /* get the memory size buffer */ - cpu_size = ftell(infp); - if (ferror(infp)) - { - printf("error can not get file size of the read file"); - fclose(infp); - fclose(outfp); - return 6; - } - - /* Load the binary file to a memory buffer */ - fseek(infp,0,SEEK_SET); - if (ferror(infp)) - { - printf("error can not seek in the read file"); - fclose(infp); - fclose(outfp); - return 5; - } - - if (cpu_size==0) - { - printf("error file size is Zero lenght of the read file"); - fclose(infp); - fclose(outfp); - return 7; - } - - /* alloc memory now */ - ; - if (!(cpu_buffer = (unsigned char *) malloc(cpu_size+1))) - { - printf("error can not alloc %uld size for memory buffer",cpu_size); - fclose(infp); - fclose(outfp); - return 8; - } - ZeroMemory(cpu_buffer,cpu_size); - - /* read from the file now in one sweep */ - fread((void *)cpu_buffer,1,cpu_size,infp); - if (ferror(infp)) - { - printf("error can not read file "); - fclose(infp); - fclose(outfp); - return 9; - } - fclose(infp); - - if (type==0) - { - if ( PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp, mode) !=0) - { - type=1; - } - else - { - if (mode > 0) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return 0; - } - - /* fixme */ - return -1; - } - - if (type== 1) - { - if (stricmp(cpuid,"m68000")) - { - ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68000,outfp); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - } - else if (stricmp(cpuid,"m68010")) - { - ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68010,outfp); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return ret; - } - else if (stricmp(cpuid,"m68020")) - { - ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68020,outfp); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return ret; - } - else if (stricmp(cpuid,"m68030")) - { - ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68030,outfp); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return ret; - } - else if (stricmp(cpuid,"m68040")) - { - ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68040,outfp); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return ret; - } - else if (stricmp(cpuid,"ppc")) - { - ret = PPCBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,0,outfp); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return ret; - } - else if (stricmp(cpuid,"arm4")) - { - ret = ARMBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,4,outfp); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return ret; - } - } - - if (type==2) - { - - ret = PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp, mode); - if (mode > 1) - { - Convert(outfp,machine_type,mode); - } - fclose(outfp); - return ret; - } - - return 0; -} - -#define MAXSECTIONNUMBER 16 - -CPU_INT PEFileStart( CPU_BYTE *memory, CPU_UNINT pos, - CPU_UNINT base, CPU_UNINT size, - FILE *outfp, CPU_INT mode) -{ - PIMAGE_DOS_HEADER DosHeader; - PIMAGE_NT_HEADERS NtHeader; - IMAGE_SECTION_HEADER SectionHeader[MAXSECTIONNUMBER] = {NULL}; - PIMAGE_SECTION_HEADER pSectionHeader; - PIMAGE_EXPORT_DIRECTORY ExportEntry; - INT NumberOfSections; - INT NumberOfSectionsCount=0; - INT i; - - DosHeader = (PIMAGE_DOS_HEADER)memory; - if ( (DosHeader->e_magic != IMAGE_DOS_SIGNATURE) || - (size < 0x3c+2) ) - { - printf("No MZ file \n"); - return -1; - } - - NtHeader = (PIMAGE_NT_HEADERS) (((ULONG)memory) + ((ULONG)DosHeader->e_lfanew)); - if (NtHeader->Signature != IMAGE_NT_SIGNATURE) - { - printf("No PE header found \n"); - } - - if (!(NtHeader->FileHeader.Characteristics & IMAGE_FILE_EXECUTABLE_IMAGE)) - { - printf("No execute image found \n"); - return -1; - } - - switch(NtHeader->OptionalHeader.Subsystem) - { - case IMAGE_SUBSYSTEM_EFI_APPLICATION: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_APPLICATION\n"); - printf("This exe file is desgin run in EFI bios as applactions\n"); - break; - case IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER\n"); - printf("This exe file is desgin run in EFI bios as service driver\n"); - break; - case IMAGE_SUBSYSTEM_EFI_ROM: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_ROM\n"); - printf("This exe file is EFI ROM\n"); - break; - case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER\n"); - printf("This exe file is desgin run in EFI bios as driver\n"); - break; - case IMAGE_SUBSYSTEM_NATIVE: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_NATIVE\n"); - printf("This exe file does not need any subsystem\n"); - break; - case IMAGE_SUBSYSTEM_NATIVE_WINDOWS: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_NATIVE_WINDOWS\n"); - printf("This exe file is desgin run on Windows 9x as driver \n"); - break; - case IMAGE_SUBSYSTEM_OS2_CUI: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_OS2_CUI\n"); - printf("This exe file is desgin run on OS2 as CUI\n"); - break; - case IMAGE_SUBSYSTEM_POSIX_CUI: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_POSIX_CUI\n"); - printf("This exe file is desgin run on POSIX as CUI\n"); - break; - case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_WINDOWS_CE_GUI\n"); - printf("This exe file is desgin run on Windows CE as GUI\n"); - break; - case IMAGE_SUBSYSTEM_WINDOWS_CUI: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_WINDOWS_CUI\n"); - printf("This exe file is desgin run on Windows as CUI\n"); - break; - case IMAGE_SUBSYSTEM_WINDOWS_GUI: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_WINDOWS_GUI\n"); - printf("This exe file is desgin run on Windows as GUI\n"); - break; - case IMAGE_SUBSYSTEM_XBOX: - fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_XBOX\n"); - printf("This exe file is desgin run on X-Box\n"); - break; - default: - fprintf(outfp,"; OS type : Unknown\n"); - printf("Unknown OS : SubID : %d\n",NtHeader->OptionalHeader.Subsystem); - break; - } - - - printf("Number of object : %d\n",NtHeader->FileHeader.NumberOfSections); - printf("Base Address : %8x\n\n",NtHeader->OptionalHeader.ImageBase); - - pSectionHeader = IMAGE_FIRST_SECTION(NtHeader); - - NumberOfSections = NtHeader->FileHeader.NumberOfSections; - - for (i = 0; i < NumberOfSections; i++) - { - SectionHeader[i] = *pSectionHeader++; - printf("Found Sector : %s \n ",SectionHeader[i].Name); - printf("RVA: %08lX ",SectionHeader[i].VirtualAddress); - printf("Offset: %08lX ",SectionHeader[i].PointerToRawData); - printf("Size: %08lX ",SectionHeader[i].SizeOfRawData); - printf("Flags: %08lX \n\n",SectionHeader[i].Characteristics); - } - - /* Get export data */ - if (NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size != 0) - { - for (i = 0; i < NumberOfSections; i++) - { - if ( SectionHeader[i].VirtualAddress <= (ULONG) NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress && - SectionHeader[i].VirtualAddress + SectionHeader[i].SizeOfRawData > (ULONG)NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress) - { - ExportEntry = (PIMAGE_NT_HEADERS) (((ULONG)memory) + - (ULONG)(NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress - - SectionHeader[i].VirtualAddress + - SectionHeader[i].PointerToRawData)); - } - } - } - - -/* start decoding */ - -for (i=0;i < NumberOfSections; i++) -{ - if (strnicmp((PCHAR) SectionHeader[i].Name,".text\0",6)==0) - { - switch (NtHeader->FileHeader.Machine) - { - case IMAGE_FILE_MACHINE_ALPHA: - printf("CPU ALPHA Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found Alpha\n"); - machine_type = IMAGE_FILE_MACHINE_ALPHA; - return 3; - - case IMAGE_FILE_MACHINE_ALPHA64: - printf("CPU ALPHA64/AXP64 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found Alpha64/AXP64\n"); - machine_type = IMAGE_FILE_MACHINE_ALPHA64; - return 3; - - case IMAGE_FILE_MACHINE_AM33: - printf("CPU AM33 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found AM33\n"); - machine_type = IMAGE_FILE_MACHINE_AM33; - return 3; - - case IMAGE_FILE_MACHINE_AMD64: - printf("CPU AMD64 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found AMD64\n"); - machine_type = IMAGE_FILE_MACHINE_AMD64; - return 3; - - case IMAGE_FILE_MACHINE_ARM: - printf("CPU ARM Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found ARM\n"); - machine_type = IMAGE_FILE_MACHINE_ARM; - return 3; - - case IMAGE_FILE_MACHINE_CEE: - printf("CPU CEE Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found CEE\n"); - machine_type = IMAGE_FILE_MACHINE_CEE; - return 3; - - case IMAGE_FILE_MACHINE_CEF: - printf("CPU CEF Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found CEF\n"); - machine_type = IMAGE_FILE_MACHINE_CEF; - return 3; - - case IMAGE_FILE_MACHINE_EBC: - printf("CPU EBC Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found EBC\n"); - machine_type = IMAGE_FILE_MACHINE_EBC; - return 3; - - case IMAGE_FILE_MACHINE_I386: - printf("CPU I386 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found I386\n"); - machine_type = IMAGE_FILE_MACHINE_I386; - return 3; - - case IMAGE_FILE_MACHINE_IA64: - printf("CPU IA64 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found IA64\n"); - machine_type = IMAGE_FILE_MACHINE_IA64; - return 3; - - case IMAGE_FILE_MACHINE_M32R: - printf("CPU M32R Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found M32R\n"); - machine_type = IMAGE_FILE_MACHINE_M32R; - return 3; - - case IMAGE_FILE_MACHINE_MIPS16: - printf("CPU MIPS16 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found MIPS16\n"); - machine_type = IMAGE_FILE_MACHINE_MIPS16; - return 3; - - case IMAGE_FILE_MACHINE_MIPSFPU: - printf("CPU MIPSFPU Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found MIPSFPU\n"); - machine_type = IMAGE_FILE_MACHINE_MIPSFPU; - return 3; - - case IMAGE_FILE_MACHINE_MIPSFPU16: - printf("CPU MIPSFPU16 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found MIPSFPU16\n"); - machine_type = IMAGE_FILE_MACHINE_MIPSFPU16; - return 3; - - case IMAGE_FILE_MACHINE_POWERPC: - printf("CPU POWERPC Detected partily CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found POWERPC\n"); - //PPCBrain(memory, pos, cpu_size, base, 0, outfp); - machine_type = IMAGE_FILE_MACHINE_POWERPC; - PPCBrain(memory+SectionHeader[i].PointerToRawData, 0, SectionHeader[i].SizeOfRawData, NtHeader->OptionalHeader.ImageBase, 0, outfp); - break; - - - case IMAGE_FILE_MACHINE_POWERPCFP: - printf("CPU POWERPCFP Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found POWERPCFP\n"); - machine_type = IMAGE_FILE_MACHINE_POWERPCFP; - return 3; - - case IMAGE_FILE_MACHINE_R10000: - printf("CPU R10000 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found R10000\n"); - machine_type = IMAGE_FILE_MACHINE_R10000; - return 3; - - case IMAGE_FILE_MACHINE_R3000: - printf("CPU R3000 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found R3000\n"); - machine_type = IMAGE_FILE_MACHINE_R3000; - return 3; - - case IMAGE_FILE_MACHINE_R4000: - printf("CPU R4000 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found R4000\n"); - machine_type = IMAGE_FILE_MACHINE_R4000; - return 3; - - case IMAGE_FILE_MACHINE_SH3: - printf("CPU SH3 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found SH3\n"); - machine_type = IMAGE_FILE_MACHINE_SH3; - return 3; - - case IMAGE_FILE_MACHINE_SH3DSP: - printf("CPU SH3DSP Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found SH3DSP\n"); - machine_type = IMAGE_FILE_MACHINE_SH3DSP; - return 3; - - case IMAGE_FILE_MACHINE_SH3E: - printf("CPU SH3E Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found SH3E\n"); - machine_type = IMAGE_FILE_MACHINE_SH3E; - return 3; - - case IMAGE_FILE_MACHINE_SH4: - printf("CPU SH4 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found SH4\n"); - machine_type = IMAGE_FILE_MACHINE_SH4; - return 3; - - case IMAGE_FILE_MACHINE_SH5: - printf("CPU SH5 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found SH5\n"); - machine_type = IMAGE_FILE_MACHINE_SH5; - return 3; - - case IMAGE_FILE_MACHINE_THUMB: - printf("CPU THUMB Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found THUMB\n"); - machine_type = IMAGE_FILE_MACHINE_THUMB; - return 3; - - case IMAGE_FILE_MACHINE_TRICORE: - printf("CPU TRICORE Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found TRICORE\n"); - machine_type = IMAGE_FILE_MACHINE_TRICORE; - return 3; - - case IMAGE_FILE_MACHINE_WCEMIPSV2: - printf("CPU WCEMIPSV2 Detected no CPUBrain implement for it\n"); - fprintf(outfp,"; CPU found WCEMIPSV2\n"); - machine_type = IMAGE_FILE_MACHINE_WCEMIPSV2; - return 3; - - default: - printf("Unknown Machine : %d",NtHeader->FileHeader.Machine); - return 4; - } /* end case switch*/ - } /* end if text sector */ -} /* end for */ - - return 0; -} diff --git a/rosapps/applications/devutils/cputointel/OpCodePPC.txt b/rosapps/applications/devutils/cputointel/OpCodePPC.txt deleted file mode 100644 index 9593bf592c8..00000000000 --- a/rosapps/applications/devutils/cputointel/OpCodePPC.txt +++ /dev/null @@ -1,77 +0,0 @@ - -PowerPC 32bits - -reg = R0-R31 -#imm = a value you set - -Bit expain -0 = mean bit is zero -1 = mean bit is set -2 = mean this bit can be 0 or 1 - -opcode Name Desciptions -0010 0000 0000 0000 1000 0000 0100 1110 blr return from a functions - -0222 2222 2222 2222 2222 2222 0011 1000 Li reg,#imm move a value to a register - -2222 2222 2222 2222 2222 2222 1001 0022 stw reg,mem store a value into memory - -2222 2222 2222 2222 2222 2222 1001 0122 stwu reg,mem store contain of reg to memory and - move reg to that memory position - - - -Here how the primary opcode work -xxxx xxxx xxxx xxxx DDDS SSSS 3333 33DD - - -3 = it is the primary opcode -D = Destions register -S = Source reigters - opcode - ------------------------- - |bit order: 5432 10 67 | - ------- ------- ----------- ---- -34: | 0c 00 | | e1 93 | stw r31,12(r1) 0000 1100 0000 0000 1110 0001 | 1001 00 | 00 -38: | 14 00 | | 01 90 | stw r0,20(r1) 0001 0100 0000 0000 0000 0001 | 1001 00 | 11 - ------- ------- --------- - | | - | |--> Get source register R0-R31 (0xE1 & 0x1F) = 1 - | | - | |--> Get Dest register R0-R31 ((0xE1 & 0xE0)>>5) | ((0x90 & 0x3)<<3) = 31 or 0 - | | (The adding the two last bit on the end is maybe wrong need examine it) - | | - | --> Get the opcpde (0x90 & 0xFC) - \ / - - The address offset 12 or 20 - -opcode - --------------------------------------------------------- -|bit order: pos 1111 1111 1111 1111 0000 0000 0000 0000 | -| 5432 10 | -|---------------------------------------------------------| -| bits 0000 1100 0000 0000 1110 0001 1001 0000 | - --------------------------------------------------------- -| math (opcode>>2) & 0x3F | - --------------------------------------------------------- - -Dest Register - --------------------------------------------------------- -|bit order: pos 1111 1111 1111 1111 0000 0000 0000 0000 | -| 210 43 | -|---------------------------------------------------------| -| bits 0000 1100 0000 0000 1110 0001 1001 0000 | - --------------------------------------------------------- -| math (((opcode & 0x3) << 3) | ((opcode & 0xE000) >> 13))| - --------------------------------------------------------- - -source Register - --------------------------------------------------------- -|bit order: pos 1111 1111 1111 1111 0000 0000 0000 0000 | -| x xxxx | -|---------------------------------------------------------| -| bits 0000 1100 0000 0000 1110 0001 1001 0000 | - --------------------------------------------------------- -| math | - --------------------------------------------------------- diff --git a/rosapps/applications/devutils/cputointel/ReadMe.txt b/rosapps/applications/devutils/cputointel/ReadMe.txt deleted file mode 100644 index 50ff74b71a5..00000000000 --- a/rosapps/applications/devutils/cputointel/ReadMe.txt +++ /dev/null @@ -1,76 +0,0 @@ -CpuToIntel is a experment tools and is strict under havy devloping - - -The Idea -The idea is to converting binary files or win pe files -from one cpu to another cpu, But it does not exists -plan to port over diffent hardware architect like -how diffent hw comucate, example x86 DMA controller -to PPC like that stuff. It is only to convert the -binary or pe files to another cpu. it mean a user -mode apps will always be ported, but if it self -modify code it will not work. But it exists idea how -to deal with self modify code. - - -The idea to handling self modify code -The idea is to add a small emulator or adding -anaylysing process to dectect self modify code -and extract it. This is very hard part todo, some say -imposible, some other say almost imposble. and I say -it is posible todo but extream hard todo. for it is -very diffcul to dectect self modify code with a -analysing process. - - -Why the name are CpuToIntel -When I start write on it it was only ment to convert -from ARM, PPC, m68k to X86 but then I come think of -ReactOS PPC port that is going on. for or later we -will need something that doing convert from x86 to -PPC apps. It exists two way todo it. One is to use -dymatic translation a jit, like UAE or QEMU doing -converting. But it will lose of allot of speed if -it is a game or a havy apps to much. So the idea -is to convert the whole file in one sweep. will give - one other problem it will be a slow process todo it, -and hard dectect self modify program. so not all program -can be really convert with this process. - - -Who will it work -we take it step for step and I will describe the -binary translations how it works. The PE file -work simluare way. - -step 1 : it will disambler the program frist - -step 2 : translate everthing to a middle asm dialect, - it is own asm dialect it is not suite for a real - -step 3 : (not implement) send it to ananalysing processs - to get any name or mark out which row is a new functions - -step 3.5 (not implement) split the code into functions here - -step 4 : Now it start the convert process. - -step 4.5 (not implement) maybe a optimzer. - -step 5 : now it is finish. - - -The arch that are plan -PPC to IA32, PPC (work in progress) -m68k to IA32, PPC (stubed) -ARM to IA32, PPC (stubed) -IA32 to IA32, PPC (work in progress) - - -The Winodws NT PPC and x85 diffrent -R1 The stack pointer equal with x86 esp -R3 The return reg equal with x86 eax -R4 The return reg equal with x86 edx -R31 The base pointer equal with x86 ebp - - \ No newline at end of file diff --git a/rosapps/applications/devutils/cputointel/any_op.h b/rosapps/applications/devutils/cputointel/any_op.h deleted file mode 100644 index 47770c51e5d..00000000000 --- a/rosapps/applications/devutils/cputointel/any_op.h +++ /dev/null @@ -1,74 +0,0 @@ - -#ifndef __ANY_OP_H__ -#define __ANY_OP_H__ - -#define OP_ANY_mov 0x00000000 -#define OP_ANY_ret 0x00000001 - -/* We are using same abi as PPC - * eax = register 3 - * edx = register 4 - * esp = register 1 - * ebp = register 31 - - * ecx = 8 - * ebx = 9 - * esi = 10 - * edi = 11 - * mmx/sse/fpu 0 = 12 - * mmx/sse/fpu 1 = 14 - * mmx/sse/fpu 2 = 16 - * mmx/sse/fpu 3 = 18 - * mmx/sse/fpu 4 = 20 - * mmx/sse/fpu 5 = 22 - * mmx/sse/fpu 6 = 24 - * mmx/sse/fpu 7 = 28 - */ - -typedef struct _BrainAnalys -{ - CPU_UNINT op; /* one tranlator for any cpu type set our own opcode */ - CPU_INT type; /* 1 = source are memmory, 2 source are register */ - /* 4 = dest are memmory, 8 dest are register */ - /* 16 = source are imm */ - /* 32 = soucre -xx(r1) or [eax-xx] */ - /* 64 = dest -xx(r1) or [eax-xx] */ - /* 128 = update form the src be update with dest */ - - CPU_INT src_size; /* who many bits are src not vaild for reg*/ - CPU_INT dst_size; /* who many bits are dst not vaild for reg*/ - - CPU_UNINT64 src; - CPU_UNINT64 dst; - - CPU_INT src_extra; /* if type == 32 are set */ - CPU_INT dst_extra; /* if type == 32 are set */ - - CPU_UNINT memAdr; /* where are we in the current memory pos + baseaddress */ - - CPU_INT row; /* 0 = no row, - * 1 = row is bcc (conditions), - * 2 = row is jsr (Call) - */ - - /* try translate the Adress to a name */ - CPU_BYTE* ptr_next; /* hook next one */ - CPU_BYTE* ptr_prev; /* hook previus one */ -} MYBrainAnalys, *PMYBrainAnalys; - -extern PMYBrainAnalys pMyBrainAnalys; /* current working address */ -extern PMYBrainAnalys pStartMyBrainAnalys; /* start address */ - -CPU_INT ConvertToIA32Process( FILE *outfp, - PMYBrainAnalys pMystart, - PMYBrainAnalys pMyend, CPU_INT regbits, - CPU_INT HowManyRegInUse, - CPU_INT *RegTableCount); - -CPU_INT ConvertToPPCProcess( FILE *outfp, - PMYBrainAnalys pMystart, - PMYBrainAnalys pMyend, CPU_INT regbits, - CPU_INT HowManyRegInUse, - CPU_INT *RegTableCount); - -#endif diff --git a/rosapps/applications/devutils/cputointel/cputointel.rbuild b/rosapps/applications/devutils/cputointel/cputointel.rbuild deleted file mode 100644 index 62f872636b5..00000000000 --- a/rosapps/applications/devutils/cputointel/cputointel.rbuild +++ /dev/null @@ -1,31 +0,0 @@ - - . - kernel32 - user32 - - CpuToIntel.c - misc.c - - From/ARM/ARMBrain.c - From/ARM/ARMopcode.c - - From/IA32/IA32Brain.c - From/IA32/IA32opcode.c - - From/m68k/M68kBrain.c - From/m68k/M68kopcode.c - - From/PPC/PPCBrain.c - From/PPC/PPCopcode.c - - From/dummycpu/DummyBrain.c - From/dummycpu/Dummyopcode.c - - ImageLoader.c - AnyalsingProcess.c - ConvertingProcess.c - ConvertToIA32Process.c - ConvertToPPCProcess.c - - - \ No newline at end of file diff --git a/rosapps/applications/devutils/cputointel/misc.c b/rosapps/applications/devutils/cputointel/misc.c deleted file mode 100644 index 0a3c86d4ec0..00000000000 --- a/rosapps/applications/devutils/cputointel/misc.c +++ /dev/null @@ -1,199 +0,0 @@ - -/* only for getting the pe struct */ -#include -#include - -#include -#include -#include -#include "misc.h" -#include "any_op.h" -#include "From/ARM/ARM.h" -#include "From/m68k/m68k.h" -#include "From/PPC/PPC.h" - - -/* retun - * 0 = Ok - * 1 = unimplemt - * 2 = Unkonwn Opcode - * 3 = can not open read file - * 4 = can not open write file - * 5 = can not seek to end of read file - * 6 = can not get the file size of the read file - * 7 = read file size is Zero - * 8 = can not alloc memory - * 9 = can not read file - *------------------------- - * type 0 : auto - * type 1 : bin - * type 2 : exe/dll/sys - */ - - - -/* Conveting bit array to a int byte */ -CPU_UNINT ConvertBitToByte(CPU_BYTE *bit) -{ - CPU_UNINT Byte = 0; - CPU_INT t; - CPU_UNINT size = 15; - - for(t=size;t>=0;t--) - { - if (bit[size-t] != 2) - Byte = Byte + (bit[size-t]<=0;t--) - { - if (bit[size-t] == 2) - { - MaskByte = MaskByte + ( (bit[size-t]-1) <=0;t--) - { - if (bit[size-t] != 2) - Byte = Byte + (bit[size-t]<=0;t--) - { - if (bit[size-t] == 2) - { - MaskByte = MaskByte + ( (bit[size-t]-1) <ptr_next = (CPU_BYTE*)tmp; - tmp->ptr_prev= (CPU_BYTE*)pMyBrainAnalys; - - pMyBrainAnalys = tmp; - } -return 0; -} - -CPU_INT FreeAny() -{ - PMYBrainAnalys tmp = NULL; - - if (pMyBrainAnalys == NULL) - { - return -1; - } - - tmp = (PMYBrainAnalys)pMyBrainAnalys->ptr_prev; - - while (pMyBrainAnalys != NULL) - { - if (pMyBrainAnalys == NULL) - { - break; - } - - free(pMyBrainAnalys); - - if (pMyBrainAnalys != NULL) - { - printf("fail to free memory"); - return -1; - } - - pMyBrainAnalys = tmp; - } - - return 0; -} - - - - - - diff --git a/rosapps/applications/devutils/cputointel/misc.h b/rosapps/applications/devutils/cputointel/misc.h deleted file mode 100644 index 48999b233f6..00000000000 --- a/rosapps/applications/devutils/cputointel/misc.h +++ /dev/null @@ -1,35 +0,0 @@ - - -/* 64bits unsigned */ -#define CPU_UNINT64 unsigned long long - -/* 32bits */ -#define CPU_UNINT unsigned int -#define CPU_INT int - -/* 16 bits signed */ -#define CPU_SHORT short - -/* 8bits unsigned */ -#define CPU_BYTE unsigned char - -/* Prototypes for misc stuff */ -CPU_INT LoadPFileImage(char *infileName, char *outputfileName, CPU_UNINT BaseAddress, char *cpuid, CPU_UNINT type, CPU_INT mode); -CPU_INT PEFileStart( CPU_BYTE *memory, CPU_UNINT pos, CPU_UNINT base, CPU_UNINT size, FILE *outfp, CPU_INT mode); - -CPU_UNINT ConvertBitToByte(CPU_BYTE *bit); -CPU_UNINT GetMaskByte(CPU_BYTE *bit); - -CPU_UNINT ConvertBitToByte32(CPU_BYTE *bit); -CPU_UNINT GetMaskByte32(CPU_BYTE *bit); - -CPU_UNINT GetData32Le(CPU_BYTE *cpu_buffer); -CPU_UNINT GetData32Be(CPU_BYTE *cpu_buffer); - -CPU_INT AllocAny(); -CPU_INT FreeAny(); -CPU_INT AnyalsingProcess(); - -CPU_INT ConvertProcess(FILE *outfp, CPU_INT FromCpuid, CPU_INT ToCpuid); - - diff --git a/rosapps/applications/devutils/directory.rbuild b/rosapps/applications/devutils/directory.rbuild index 1f981be4285..4d2722309da 100644 --- a/rosapps/applications/devutils/directory.rbuild +++ b/rosapps/applications/devutils/directory.rbuild @@ -12,10 +12,6 @@ - - - - @@ -27,9 +23,5 @@ - - - - diff --git a/rosapps/applications/devutils/roswebparser/Windows28591.h b/rosapps/applications/devutils/roswebparser/Windows28591.h deleted file mode 100644 index 34344e8de20..00000000000 --- a/rosapps/applications/devutils/roswebparser/Windows28591.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Windows OEM 457 code page table. need by english rc files, area 0x80 to 0x9f should be blank - */ - -unsigned short table_Windows28591[256] = -{ - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, - 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, - 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, - 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, - 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, - 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, - 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, - 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, - 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, - 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, - 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, - 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, - 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, - 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, - 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, - 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, - 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, - 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, - 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF}; diff --git a/rosapps/applications/devutils/roswebparser/Windows28592.h b/rosapps/applications/devutils/roswebparser/Windows28592.h deleted file mode 100644 index e9a3216af3a..00000000000 --- a/rosapps/applications/devutils/roswebparser/Windows28592.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Windows OEM 457 code page table. need by english rc files, area 0x80 to 0x9f should be blank - */ - -unsigned short table_Windows28592[256] = -{ - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, - 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, - 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, - 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, - 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, - 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, - 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, - 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, - 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, - 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, - 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, - 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8, 0x0160, - 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, 0x00B0, 0x0105, 0x02DB, 0x0142, - 0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, - 0x017E, 0x017C, 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, 0x0110, 0x0143, - 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, - 0x00DC, 0x00DD, 0x0162, 0x00DF, 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, - 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, - 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159, 0x016F, - 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9}; - diff --git a/rosapps/applications/devutils/roswebparser/oem437.h b/rosapps/applications/devutils/roswebparser/oem437.h deleted file mode 100644 index 4d44611ec9e..00000000000 --- a/rosapps/applications/devutils/roswebparser/oem437.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Windows OEM 457 code page table. need by english rc files - */ - -unsigned short table_OEM437[256] = -{ - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, - 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, - 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, - 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, - 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, - 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, - 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, - 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, - 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x00C7, 0x00FC, - 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, - 0x00EE, 0x00EC, 0x00C4, 0x00C5, 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, - 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, - 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, - 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502, - 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, - 0x255B, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, - 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, 0x2568, 0x2564, - 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, - 0x2584, 0x258C, 0x2590, 0x2580, 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, - 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, - 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, - 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0}; - - - diff --git a/rosapps/applications/devutils/roswebparser/oem850.h b/rosapps/applications/devutils/roswebparser/oem850.h deleted file mode 100644 index cb4461464d3..00000000000 --- a/rosapps/applications/devutils/roswebparser/oem850.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Windows OEM 850 code page table. need by english rc files - */ - -unsigned short table_OEM850[256] = -{ - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, - 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, - 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, - 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, - 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, - 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, - 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, - 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, - 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x00C7, 0x00FC, - 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, - 0x00EE, 0x00EC, 0x00C4, 0x00C5, 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, - 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192, - 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00AE, - 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502, - 0x2524, 0x00C1, 0x00C2, 0x00C0, 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, - 0x00A5, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, - 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, 0x00F0, 0x00D0, - 0x00CA, 0x00CB, 0x00C8, 0x0131, 0x00CD, 0x00CE, 0x00CF, 0x2518, 0x250C, 0x2588, - 0x2584, 0x00A6, 0x00CC, 0x2580, 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, - 0x00B5, 0x00FE, 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4, - 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, 0x00B0, 0x00A8, - 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0}; diff --git a/rosapps/applications/devutils/roswebparser/roswebparser.c b/rosapps/applications/devutils/roswebparser/roswebparser.c deleted file mode 100644 index 7e633e6b889..00000000000 --- a/rosapps/applications/devutils/roswebparser/roswebparser.c +++ /dev/null @@ -1,1779 +0,0 @@ -/* - * This is a standalone rc langues to xml parser - * do not use windows or linux specfiy syntax or functions - * use only pure ansi C, this program is also runing on - * linux apachie webserver and being use in ReactOS website - * - * CopyRight 20/9-2006 by Magnus Olsen (magnus@greatlord.com) - * Licen GPL version 2.0 - */ - - -#include -#include -#include -#include - -#define true 1 -#define false 0 - - -int ansiCodePage(int codepage, unsigned char *inBuffer, unsigned char *outBuffer, int Lenght); - -int paraser1(unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format, unsigned char *iso_type); - -void find_str(unsigned char asc, unsigned char *buf, long *foundPos); -void find_str2(unsigned char *asc, unsigned char *buf, long *foundPos, unsigned char * output_resid, unsigned char *output_text ); -void trim(unsigned char* buf); -void stringbugs(unsigned char *buf, int shift2); -void stringbugs2(unsigned char *buf, int shift2); - -void ParserCMD1(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format); -void ParserCMD2(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format); -void ParserCMD3(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format); - -void ParserComment(long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format); -void ParserLang(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format); -void ParserString(long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format); -void ParserDialog(unsigned char *text, long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format); -void DialogCMDBuild1(unsigned char *output_resid, unsigned char *output_format, long pos, unsigned char * text); -void DialogCMDBuild2(unsigned char *output_resid, unsigned char *output_format, long pos, unsigned char * text); -void DialogCMDBuild3(unsigned char *output_resid, unsigned char *output_format, long pos, unsigned char * text); -void ParserAccelerators(long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format); -void ParserMenu(unsigned char *text, long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format); - -/* - return -1 : No file found - return -2 : Fail open file - return -3 : Fail seek - return -4 : Fail get size - return -5 : Fail size of the file is 0 bytes - return -6 : Fail malloc memory - return -7 : Fail to read the file - return -8 : Fail to write to the file - return -9 : Fail to open write file -*/ - -int main(int argc, char * argv[]) -{ - FILE * fp; - FILE * Outfp; - unsigned char * buffer; - unsigned char * output_text; - unsigned char * output_resid; - unsigned char * output_format; - - long buf_size; - long buf_size_calc = 0; - - if (argc!=4) - { - printf("Help\n"); - printf("%s inputfile iso-type\n\n",argv[0]); - printf("example %s sv.rc 28591 sv.xml\n\n",argv[0]); - printf("Contry table\n"); - printf("se (Swedish = Windows-28591 (Latin1 ISO-8859-1)\n"); - - return -1; - } - - - if ((fp = fopen(argv[1],"rb"))==NULL) - { - printf("Fail open file %s by %s\n",argv[1],argv[0]); - return -2; - } - - - - fseek(fp,0,SEEK_END); - if (ferror(fp) !=0) - { - fclose(fp); - printf("Fail seek\n"); - return -3; - } - buf_size = ftell(fp); - if (ferror(fp) !=0) - { - fclose(fp); - printf("Fail get size\n"); - return -4; - } - - - /* - We make sure it is least 4 times + 2K biger - for we can grow around 2-3 times biger - so it better to make safe assume how - much memory we need - */ - - buf_size_calc = (buf_size*4) + 2048; - - fseek(fp,0,SEEK_SET); - if (ferror(fp) !=0) - { - fclose(fp); - printf("Fail seek\n"); - return -3; - } - - if (buf_size==0) - { - fclose(fp); - printf("Fail size of the file is 0 bytes\n"); - return -5; - } - - buffer =(char *)malloc(buf_size_calc); - if (buffer == NULL) - { - fclose(fp); - printf("Fail malloc memory\n"); - return -6; - } - - output_text =(char *)malloc(buf_size_calc); - if (output_text == NULL) - { - free(buffer); - fclose(fp); - printf("Fail malloc memory\n"); - return -6; - } - - output_resid =(char *)malloc(buf_size_calc); - if (output_resid == NULL) - { - free(buffer); - free(output_text); - fclose(fp); - printf("Fail malloc memory\n"); - return -6; - } - - output_format =(char *)malloc(buf_size_calc); - if (output_format == NULL) - { - free(buffer); - free(output_text); - free(output_resid); - fclose(fp); - printf("Fail malloc memory\n"); - return -6; - } - - //fread(buffer,1,buf_size,fp); - fread(buffer,buf_size,1,fp); - if (ferror(fp) !=0) - { - fclose(fp); - printf("Fail to read the file\n"); - return -7; - } - fclose(fp); - - /* Now we can write our parser */ - - paraser1(buffer, buf_size, output_text, output_resid, output_format,"UTF-8"); - // printf ("%s",output_format); - - /* Now we convert to utf-8 */ - memset(output_resid,0,buf_size_calc); - buf_size_calc = ansiCodePage(atoi(argv[2]), output_format, output_resid, strlen(output_format)); - - if ((Outfp = fopen(argv[3],"wb")) != NULL ) - { - fwrite(output_resid,1,buf_size_calc,Outfp); - fclose(Outfp); - } - - - - - if(buffer!=NULL) - free(buffer); - if(output_text!=NULL) - free(output_text); - if(output_resid!=NULL) - free(output_resid); - if(output_format!=NULL) - free(output_format); - - - return 0; -} - -int paraser1(unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format, unsigned char *iso_type) -{ - unsigned char *row; - long foundPos=0; - long foundNextPos=0; - long row_size=0; - long pos=0; - - memset(output_text,0,buf_size); - memset(output_resid,0,buf_size); - memset(output_format,0,buf_size); - - sprintf(output_format,"\n\n",iso_type); - - row = output_text; - while(pos < buf_size) - { - foundPos=0; - foundNextPos=0; - row_size=0; - - /* create a row string so we can easy scan it */ - find_str('\n',&buf[pos],&foundPos); - - if (foundPos !=0) - { - row_size = foundPos - 1; - - /* found a new row */ - strncpy(row, &buf[pos], row_size); - pos+=foundPos; - if (foundPos >=2) - row[row_size -1]=0; - - } - else - { - row_size = buf_size - pos; - - /* no new row found in the buffer */ - strncpy(row, &buf[pos], buf_size - pos); - pos= buf_size; - } - - trim(row); - foundPos=0; - - /* Detect Basic command and send it to own paraser */ - if (*row==0) - continue; - - if (strncmp("/*",row,2)==0) - { - ParserComment(&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - - if (strncmp("//",row,2)==0) - { - ParserComment(&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - if (strncmp("#",row,1)==0) - { - ParserComment(&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - - stringbugs(row,true); - - if (foundPos == 0) - { - find_str2 ("LANGUAGE ",row,&foundPos,output_resid,output_text); - if (foundPos != 0) - { - ParserLang("LANGUAGE", output_resid, output_text, output_format); - continue; - } - } - - if (foundPos == 0) - { - find_str2 ("STRINGTABLE ",row,&foundPos,output_resid,output_text); - if (foundPos != 0) - { - ParserCMD3("STRINGTABLE", output_resid, output_text, output_format); - ParserString(&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - } - - if (foundPos == 0) - { - find_str2 (" DIALOGEX ",row,&foundPos,output_resid,output_text); - if (foundPos != 0) - { - ParserCMD2("DIALOGEX", output_resid, output_text, output_format); - ParserDialog("DIALOGEX",&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - } - - if (foundPos == 0) - { - find_str2 (" DIALOG ",row,&foundPos,output_resid,output_text); - if (foundPos != 0) - { - ParserCMD2("DIALOG", output_resid, output_text, output_format); - ParserDialog("DIALOG",&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - } - - if (foundPos == 0) - { - find_str2 (" ACCELERATORS\0",row,&foundPos,output_resid,output_text); - if (foundPos != 0) - { - ParserCMD1("ACCELERATORS", output_resid, output_text, output_format); - ParserAccelerators(&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - } - - if (foundPos == 0) - { - find_str2 (" MENU\0",row,&foundPos,output_resid,output_text); - if (foundPos != 0) - { - ParserCMD1("MENU", output_resid, output_text, output_format); - ParserMenu("MENU",&pos, buf, buf_size, output_text, output_resid, output_format); - continue; - } - } - - - } // end while - sprintf(output_format,"%s\n",output_format); - return false; -} - -/* - ParserCMD - data - input : IDM_MDIFRAME MENU DISCARDABLE LANG LANG_TAG LANG_TAG - input : IDM_MDIFRAME MENU DISCARDABLE - input : IDM_MDIFRAME MENU - input : IDM_MDIFRAME ACCELERATORS DISCARDABLE LANG LANG_TAG LANG_TAG - input : IDM_MDIFRAME ACCELERATORS DISCARDABLE - input : IDM_MDIFRAME ACCELERATORS - - - output : DISCARDABLE - output : DISCARDABLE - output : - output : DISCARDABLE - output : DISCARDABLE - output : - - param : output_resid = rc_name ID - param : output_text = MENU DISCARDABLE LANG LANG_TAG LANG_TAG - param : text = type example MENU - param : output_format = xml data store buffer -*/ - -void ParserCMD1(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format) -{ - long le; - - stringbugs(output_resid,false); - stringbugs(output_text,false); - - le = strlen(text); - - if (strlen(output_text) == le) - { - sprintf(output_format,"%s\n \n",output_format,text,text,output_resid); - } - else if (output_text[le]==' ') - { - sprintf(output_format,"%s\n DISCARDABLE\n",output_format,text,text,output_resid); - } - -} - -/* - ParserCMD2 - data - input : IDM_MDIFRAME DIALOG DISCARDABLE 15, 13, 210, 63 LANG LANG_TAG LANG_TAG - input : IDM_MDIFRAME DIALOG DISCARDABLE 15, 13, 210, 63 - input : IDM_MDIFRAME DIALOGEX DISCARDABLE 15, 13, 210, 63 LANG LANG_TAG LANG_TAG - input : IDM_MDIFRAME DIALOGEX DISCARDABLE 15, 13, 210, 63 - - - output : DISCARDABLE - output : - output : DISCARDABLE - output : - - - param : output_resid = rc_name ID - param : output_text = DIALOG DISCARDABLE 15, 13, 210, 63 LANG LANG_TAG LANG_TAG - param : text = type example DIALOG - param : output_format = xml data store buffer - -*/ - -void ParserCMD2(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format) -{ - long le; - long flag = 0; - - stringbugs(output_resid,false); - stringbugs(output_text,false); - - le=strlen(text); - - sprintf(output_format,"%s\n \n",output_format,output_resid,output_text); - else - sprintf(output_format,"%swidth=\"%s\" height=\"%s\">DISCARDABLE\n",output_format,output_resid,output_text); -} - -/* - ParserCMD3 - data - input : STRINGTABLE DISCARDABLE LANG LANG_TAG LANG_TAG - input : STRINGTABLE DISCARDABLE LANG - input : STRINGTABLE LANG LANG_TAG LANG_TAG - input : STRINGTABLE - - - output : DISCARDABLE - output : DISCARDABLE - output : - output : - - - param : output_resid = empty - param : output_text = DIALOG DISCARDABLE 15, 13, 210, 63 LANG LANG_TAG LANG_TAG - param : text = type example DIALOG - param : output_format = xml data store buffer - -*/ -void ParserCMD3(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format) -{ - long foundPos=0; - - stringbugs(output_resid,false); - stringbugs(output_text,false); - - find_str2 (" ",output_text,&foundPos,output_resid,output_text); - trim(output_resid); - trim(output_text); - - if(strncmp("STRINGTABLE",output_text,11)) - sprintf(output_format,"%s\n DISCARDABLE\n",output_format,output_text,output_resid); - else - sprintf(output_format,"%s\n \n",output_format,output_resid,output_text); - -} -/* - ParserLang - data - input : LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - input : LANGUAGE LANG_ENGLISH SUBLANG_ENGLISH_US - output : lang - output : lang - - param : output_resid = not in use - param : output_text = LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - param : text = type example LANGUAGE - param : output_format = xml data store buffer -*/ - -void ParserLang(unsigned char *text, unsigned char *output_resid, unsigned char *output_text, unsigned char *output_format) -{ - long foundPos=0; - - stringbugs(output_resid,false); - stringbugs(output_text,false); - - sprintf(output_text,"%s",&output_text[strlen(text)+1]); - - /* split the lang into two string */ - find_str2 (" ",output_text,&foundPos,output_resid,output_text); - trim(output_resid); - trim(output_text); - sprintf(output_format,"%s\n %s\n\n",output_format,text,text,output_text,output_resid); -} - - -/* - ParserComment - data - input : / * sadasdas asdasd asdas ... * / - output : - - input : / * sadasdas asdasd asdas ... * / - output : - - input : #if x - output : - - input : // hi - output : - - param : pos = current buf position - param : buf = read in buffer from file rc - param : buf_size = buf max size - param : output_text = using internal instead alloc more memory - param : output_resid = using internal instead alloc more memory - param : output_format = xml data store buffer -*/ - -void ParserComment(long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format) -{ - long foundPos=0; - long foundNextPos=0; - long row_size=0; - unsigned char *row = output_text; - - - row_size = strlen(row); - if (strncmp("//",&row[0],2)==0) - { - sprintf(output_format,"%s\n \n\n",output_format,row); - return; - } - if (strncmp("#",&row[0],1)==0) - { - sprintf(output_format,"%s\n \n\n",output_format,row); - return; - } - - for (foundNextPos=0;foundNextPos\n \n\n",output_format,row); - return; - } - - } - - - sprintf(output_format,"%s\n =2) - { - row[row_size -1]=0; - } - - } - else - { - row_size = buf_size - *pos; - - /* no new row found in the buffer */ - strncpy(row, &buf[*pos], buf_size - *pos); - *pos= buf_size; - } - - /* Search now after end of comment */ - row_size=strlen(row); - for (foundNextPos=0;foundNextPos\n\n",output_format,row); - return; - } - } - sprintf(output_format,"%s%s\n",output_format,row); - } - -} - -/* - ParserAccelerators - data - input : BEGIN - input : "^A", CMD_SELECT_ALL - input : END - - output : - output : - output : - - param : pos = current buf position - param : buf = read in buffer from file rc - param : buf_size = buf max size - param : output_text = using internal instead alloc more memory - param : output_resid = using internal instead alloc more memory - param : output_format = xml data store buffer -*/ -void ParserAccelerators(long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format) -{ - long foundPos=0; - long foundNextPos=0; - long row_size=0; - char *row = output_text; - int start=false; - long le; - - while(*pos < buf_size) - { - foundPos=0; - row_size=0; - - /* create a row string so we can easy scan it */ - find_str('\n',&buf[*pos],&foundPos); - if (foundPos !=0) - { - row_size = foundPos - 1; - - /* found a new row */ - strncpy(row, &buf[*pos], foundPos); - *pos+=foundPos; - if (foundPos >=2) - { - row[row_size -1]=0; - } - - } - else - { - row_size = buf_size - *pos; - - /* no new row found in the buffer */ - strncpy(row, &buf[*pos], buf_size - *pos); - *pos= buf_size; - } - - stringbugs(row,true); - if (start == false) - { - if ((strcmp(row,"BEGIN")==0) || (strcmp(row,"{")==0)) - { - start=true; - sprintf(output_format,"%s \n",output_format); - - } - continue; - } - - if ((strcmp(row,"END")==0) || (strcmp(row,"}")==0)) - { - sprintf(output_format,"%s \n\n",output_format); - - *output_resid = '\0'; - break; - } - - foundPos=0; - foundNextPos=0; - find_str('"',row,&foundPos); - find_str('"',&row[foundPos],&foundNextPos); - - if ((foundPos!=0) && (foundNextPos!=0)) - { - - sprintf(output_format,"%s \n",output_format,row); - } - } -} - -/* - ParserString - data - input : BEGIN - input : IDS_HINT_BLANK "text" - input : END - - output : - output : text - output : - - param : pos = current buf position - param : buf = read in buffer from file rc - param : buf_size = buf max size - param : output_text = using internal instead alloc more memory - param : output_resid = using internal instead alloc more memory - param : output_format = xml data store buffer -*/ -void ParserString(long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format) -{ - long foundPos=0; - long row_size=0; - unsigned char *row = output_text; - int start=false; - - while(*pos < buf_size) - { - foundPos=0; - row_size=0; - - /* create a row string so we can easy scan it */ - find_str('\n',&buf[*pos],&foundPos); - - if (foundPos !=0) - { - row_size = foundPos - 1; - - /* found a new row */ - strncpy(row, &buf[*pos], foundPos); - *pos+=foundPos; - if (foundPos >=2) - { - row[row_size -1]=0; - } - - } - else - { - row_size = buf_size - *pos; - - /* no new row found in the buffer */ - strncpy(row, &buf[*pos], buf_size - *pos); - *pos= buf_size; - } - - stringbugs(row,true); - - - if (start == false) - { - if ((strcmp(row,"BEGIN")==0) || (strcmp(row,"{")==0)) - { - - start=true; - sprintf(output_format,"%s \n",output_format); - } - continue; - } - - if ((strcmp(row,"END")==0) || (strcmp(row,"}")==0)) - { - sprintf(output_format,"%s \n\n",output_format); - - *output_resid = '\0'; - break; - } - - - - /* the split code here */ - foundPos=0; - find_str2 (" ",row,&foundPos,output_resid,output_text); - - if (foundPos != 0) - { - trim(output_text); - trim(output_resid); - - if (*output_resid!='\0') - sprintf(output_format,"%s \n",output_format,output_resid,output_text); - else - sprintf(output_format,"%s \n",output_format,output_resid); - } - - } -} - -/* - ParserDialog - data - - input : BEGIN - output : - output : - - input : END - output : - output : - - input : { - output : - output : - - input : } - output : - output : - - input : FONT 8, "MS Shell Dlg" - output : - - input : FONT 8, "MS Shell Dlg", 0, 0, 0x1 - output : 0 0 0x1 - - input : CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,150,10 - output : - - - Builder1 - input : DEFPUSHBUTTON "&OK",1,158,6,47,14 xx - input : PUSHBUTTON "&Cancel",2,158,23,47,14 xx - input : LTEXT "&Tooltip Text:",IDC_LABEL1,7,44,40,8 xx - input : GROUPBOX "&Display Mode",IDC_LABEL4,7,96,157,28 xx - input : ICON "",IDC_PICTURE,173,101,21,20 xx - - input : EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL - input : LISTBOX IDC_LIST, 4, 16, 104, 46, WS_TABSTOP - input : COMBOBOX ID_EOLN,54,18,156,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - - output : - output : - - output : - output : - - builder2 - input : CAPTION "Execute" - input : EXSTYLE WS_EX_APPWINDOW - input : STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU - - output : DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU - - param : pos = current buf position - param : buf = read in buffer from file rc - param : buf_size = buf max size - param : output_text = using internal instead alloc more memory - param : output_resid = using internal instead alloc more memory - param : output_format = xml data store buffer -*/ -void ParserDialog(unsigned char *text, long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format) -{ - long foundPos=0; - long foundNextPos=0; - long row_size=0; - unsigned char *row = output_text; - long commandfound=0; - long le; - - *output_resid='\0'; - le=0; - - while(*pos < buf_size) - { - foundPos=0; - row_size=0; - - /* create a row string so we can easy scan it */ - find_str('\n',&buf[*pos],&foundPos); - if (foundPos !=0) - { - row_size = foundPos - 1; - - /* found a new row */ - strncpy(row, &buf[*pos], foundPos); - *pos+=foundPos; - if (foundPos >=2) - { - row[row_size -1]=0; - } - - } - else - { - row_size = buf_size - *pos; - - /* no new row found in the buffer */ - strncpy(row, &buf[*pos], buf_size - *pos); - *pos= buf_size; - } - - //stringbugs(row,true); - trim(row); - - if ((strcmp(row,"BEGIN")==0) || (strcmp(row,"{")==0)) - commandfound=1; - if ((strcmp(row,"END")==0) || (strcmp(row,"}")==0)) - commandfound=2; - - if (strncmp("STYLE ",row,6)==0) - commandfound=3; - if (strncmp("CAPTION ",row,8)==0) - commandfound=3; - if (strncmp("FONT ",row,5)==0) - commandfound=3; - if (strncmp("CONTROL ",row,8)==0) - commandfound=3; - if (strncmp("EDITTEXT ",row,9)==0) - commandfound=3; - if (strncmp("DEFPUSHBUTTON ",row,14)==0) - commandfound=3; - if (strncmp("PUSHBUTTON ",row,11)==0) - commandfound=3; - if (strncmp("LTEXT ",row,6)==0) - commandfound=3; - if (strncmp("GROUPBOX ",row,9)==0) - commandfound=3; - if (strncmp("ICON ",row,5)==0) - commandfound=3; - if (strncmp("EXSTYLE ",row,8)==0) - commandfound=3; - if (strncmp(row,"LISTBOX ",8)==0) - commandfound=3; - if (strncmp(row,"COMBOBOX ",9)==0) - commandfound=3; - - if ((*output_resid!=0) && (commandfound!=0)) - { - /* Builder 1*/ - if (strncmp(output_resid,"LTEXT ",6)==0) - DialogCMDBuild1(output_resid, output_format, 5, "LTEXT"); - if (strncmp(output_resid,"GROUPBOX ",9)==0) - DialogCMDBuild1(output_resid, output_format, 8, "GROUPBOX"); - if (strncmp(output_resid,"DEFPUSHBUTTON ",14)==0) - DialogCMDBuild1(output_resid, output_format, 13, "DEFPUSHBUTTON"); - if (strncmp(output_resid,"PUSHBUTTON ",11)==0) - DialogCMDBuild1(output_resid, output_format, 10, "PUSHBUTTON"); - if (strncmp("ICON ",output_resid,5)==0) - DialogCMDBuild1(output_resid, output_format, 4, "ICON"); - if (strncmp("EDITTEXT ",output_resid,9)==0) - DialogCMDBuild1(output_resid, output_format, 8, "EDITTEXT"); - if (strncmp("LISTBOX ",output_resid,8)==0) - DialogCMDBuild1(output_resid, output_format, 7, "LISTBOX"); - if (strncmp("COMBOBOX ",output_resid,9)==0) - DialogCMDBuild1(output_resid, output_format, 8, "COMBOBOX"); - - /* Builder 2*/ - if (strncmp("STYLE ",output_resid,6)==0) - DialogCMDBuild2(output_resid, output_format, 5, "STYLE"); - if (strncmp("EXSTYLE ",output_resid,8)==0) - DialogCMDBuild2(output_resid, output_format, 7, "EXSTYLE"); - if (strncmp("CAPTION ",output_resid,8)==0) - DialogCMDBuild2(output_resid, output_format, 7, "CAPTION"); - if (strncmp("CONTROL ",output_resid,8)==0) - DialogCMDBuild3(output_resid, output_format, 7, "CONTROL"); - - /* no builder */ - if (strncmp(output_resid,"FONT ",5)==0) - { - stringbugs(output_resid,true); - /* FONT */ - sprintf(output_resid,"%s",&output_resid[5]); - trim(output_resid); - sprintf(output_format,"%s \n",output_format); - } - else - { - sprintf(output_format,"%s\">%s\n",output_format,&output_resid[foundPos]); - } - - *output_resid=0; - } - - *output_resid='\0'; - } - - if (commandfound==1) - { - sprintf(output_format,"%s \n",output_format,text); - } - if (commandfound==2) - { - sprintf(output_format,"%s \n\n",output_format,text); - break; - } - - sprintf(output_resid,"%s%s",output_resid,row); - commandfound=0; - } - -} -////////////////////////// -/* - ParserDialog - data - - input : BEGIN - output : - output : - - input : END - output : - output : - - input : { - output : - output : - - input : } - output : - output : - - param : pos = current buf position - param : buf = read in buffer from file rc - param : buf_size = buf max size - param : output_text = using internal instead alloc more memory - param : output_resid = using internal instead alloc more memory - param : output_format = xml data store buffer -*/ -void ParserMenu(unsigned char *text, long *pos, unsigned char *buf, long buf_size, unsigned char * output_text, unsigned char * output_resid, unsigned char * output_format) -{ - long foundPos=0; - long foundNextPos=0; - long row_size=0; - unsigned char *row = output_text; - long commandfound=0; - long le; - long count=0; - - *output_resid='\0'; - le=0; - - while(*pos < buf_size) - { - foundPos=0; - row_size=0; - - /* create a row string so we can easy scan it */ - find_str('\n',&buf[*pos],&foundPos); - if (foundPos !=0) - { - row_size = foundPos - 1; - - /* found a new row */ - strncpy(row, &buf[*pos], foundPos); - *pos+=foundPos; - if (foundPos >=2) - { - row[row_size -1]=0; - } - - } - else - { - row_size = buf_size - *pos; - - /* no new row found in the buffer */ - strncpy(row, &buf[*pos], buf_size - *pos); - *pos= buf_size; - } - - //stringbugs(row,true); - stringbugs2(row,true); - - if ((strcmp(row,"BEGIN")==0) || (strcmp(row,"{")==0)) - commandfound=1; - if ((strcmp(row,"END")==0) || (strcmp(row,"}")==0)) - commandfound=2; - - if (strncmp("POPUP ",row,6)==0) - commandfound=3; - if (strncmp("MENUITEM ",row,8)==0) - commandfound=3; - - - if ((*output_resid!=0) && (commandfound!=0)) - { - if (strncmp(output_resid,"POPUP ",6)==0) - { - sprintf(output_resid,"%s",&output_resid[5]); - trim(output_resid); - sprintf(output_format,"%s\n",output_format,output_resid); - *output_resid='\0'; - } - - if (strncmp(output_resid,"MENUITEM ",9)==0) - { - sprintf(output_resid,"%s",&output_resid[8]); - trim(output_resid); - if (strcmp(output_resid,"SEPARATOR")==0) - { - sprintf(output_format,"%s\n",output_format); - *output_resid='\0'; - } - else - { - foundPos=0; - foundNextPos=0; - find_str('"',output_resid,&foundPos); - find_str('"',&output_resid[foundPos],&foundNextPos); - - stringbugs(&output_resid[foundPos+foundNextPos],true); - - if ((foundPos+foundNextPos)==0) - { - sprintf(output_format,"%s\n",output_format,&output_resid[foundPos+foundNextPos]); - } - else - { - sprintf(output_format,"%s",output_format,&output_resid[foundPos+foundNextPos]); - - output_resid[foundPos+foundNextPos]='\0'; - trim(output_resid); - - sprintf(output_format,"%s\n",output_format,output_resid); - } - - - - *output_resid='\0'; - } - } - - - - *output_resid='\0'; - } - - if (commandfound==1) - { - count++; - if (count==1) - sprintf(output_format,"%s\n",output_format,text); - else - sprintf(output_format,"%s\n",output_format); - - *output_resid='\0'; - } - if (commandfound==2) - { - count--; - *output_resid='\0'; - - if (count<1) - sprintf(output_format,"%s\n",output_format,text); - else - sprintf(output_format,"%s\n",output_format); - - if (count<1) - { - sprintf(output_format,"%s\n",output_format); - break; - } - } - - sprintf(output_resid,"%s%s",output_resid,row); - commandfound=0; - } - -} - -void stringbugs(unsigned char *buf, int shift2) -{ - long foundPos=0; - long foundNextPos=0; - long t=0; - - /* remove , */ - if (shift2== false) - { - for (t=0;t0) - { - - if (isspace(buf[le-1])!=0) - { - buf[le-1]=0; - le=strlen(buf); - } - else - { - break; - } - } - - le=strlen(buf); - while(le>0) - { - if (isspace(buf[0])!=0) - { - strncpy(&buf[0],&buf[1],le-1); - buf[le-1]=0; - le=strlen(buf); - } - else - { - break; - } - } -} -void find_str(unsigned char asc,unsigned char *buf, long *foundPos) -{ - int t; - size_t le; - - le=strlen(buf); - - for (t=0;t\n",output_format,output_resid); - } - else - { - sprintf(output_format,"%s\">\n",output_format); - } - } - else - { - if (*output_resid!='\0') - sprintf(output_format,"%s\" style=\"\">\n",output_format,output_resid); - else - sprintf(output_format,"%s\" style=\"\">\n",output_format); - } - - *output_resid='\0'; -} - - -void DialogCMDBuild2(unsigned char *output_resid, unsigned char *output_format, long pos, unsigned char * text) -{ - long le; - - stringbugs(output_resid,true); - sprintf(output_resid,"%s",&output_resid[pos]); - trim(output_resid); - - le = strlen(output_resid); - if (*output_resid=='"') - *output_resid=' '; - if (output_resid[le-1]=='"') - output_resid[le-1]=' '; - - trim(output_resid); - sprintf(output_format,"%s \n",output_format,text,output_resid); - *output_resid='\0'; -} - -// input : CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,150,10 -void DialogCMDBuild3(unsigned char *output_resid, unsigned char *output_format, long pos, unsigned char * text) -{ - long foundPos=0; - long foundNextPos=0; - long le; - long count=0; - long save1; - long save2; - - sprintf(output_resid,"%s",&output_resid[pos]); - trim(output_resid); - - find_str('"',output_resid,&foundPos); - find_str('"',&output_resid[foundPos],&foundNextPos); - - save1=foundPos; - save2=foundNextPos; - - sprintf(output_format,"%s \n",output_format,output_resid); - else - sprintf(output_format,"%s\">\n",output_format); - - *output_resid='\0'; -} - diff --git a/rosapps/applications/devutils/roswebparser/roswebparser.rbuild b/rosapps/applications/devutils/roswebparser/roswebparser.rbuild deleted file mode 100644 index d88bea8d0e7..00000000000 --- a/rosapps/applications/devutils/roswebparser/roswebparser.rbuild +++ /dev/null @@ -1,8 +0,0 @@ - - . - - kernel32 - - roswebparser.c - utf8.c - diff --git a/rosapps/applications/devutils/roswebparser/utf8.c b/rosapps/applications/devutils/roswebparser/utf8.c deleted file mode 100644 index 74b625dcdbc..00000000000 --- a/rosapps/applications/devutils/roswebparser/utf8.c +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * Convert ansi to utf-8 - * it does not support more that utf-16 - * the table we are using is base on utf-16 then we convert the table to utf-8 - * - * All table lookup the ansi char to utf-16 then we calc the utf-8 format. - */ - -#include "oem437.h" /* windows oem 437 */ -#include "oem850.h" /* windows oem 850 */ -#include "Windows28591.h" /* windows 28591 aka ISO-2859-1 (Latin 1) */ -#include "Windows28592.h" /* windows 28592 aka ISO-2859-2 (Latin 2) */ - -int ansiCodePage(int codepage, unsigned char *inBuffer, unsigned char *outBuffer, int Lenght) -{ - int t; - int ch; - int pos=0; - - for (t=0;t> 6)); // 110x xxxx - outBuffer[pos+1]= 0x80 | (0x3f & ch); // 11xx xxxx - pos+=2; - } - - else if (ch <=0xFFFF) // 11 11 11 11 11 11 11 11 - { - outBuffer[pos]= 0xC2 | (0xf & (ch >> 12)); // 1110xxxx - outBuffer[pos+1]= 0x80 | (0x3f & (ch >> 6)); // 10xxxxxx - outBuffer[pos+1]= 0x80 | (0x3f & ch); // 10xxxxxx - pos+=3; - } - - } - - return pos; -} - diff --git a/rosapps/applications/devutils/zoomin/framewnd.c b/rosapps/applications/devutils/zoomin/framewnd.c deleted file mode 100644 index 2718aa4354c..00000000000 --- a/rosapps/applications/devutils/zoomin/framewnd.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * ReactOS zoomin - * - * framewnd.c - * - * Copyright (C) 2002 Robert Dickenson - * Copyright (C) 2005 Martin Fuchs - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#include -#include -#include - -#include "main.h" -#include "framewnd.h" - -extern void ExitInstance(); - -//////////////////////////////////////////////////////////////////////////////// -// Global Variables: -// - -static int s_factor = 2; // zoom factor - -static POINT s_srcPos = {0, 0}; // source rectangle position -static RECT s_lastSrc = {-1,-1,-1,-1}; // last cursor position - -BOOL s_dragging = FALSE; - - - // zoom range - -#define MIN_ZOOM 1 -#define MAX_ZOOM 16 - - -//////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION: SetZoom() -// -// PURPOSE: Change zoom level -// - -static void SetZoom(HWND hWnd, int factor) -{ - TCHAR buffer[MAX_LOADSTRING]; - - if (factor>=MIN_ZOOM && factor<=MAX_ZOOM) { - s_factor = factor; - - SetScrollPos(hWnd, SB_VERT, s_factor, TRUE); - - wsprintf(buffer, TEXT("%s %dx"), szTitle, s_factor); - SetWindowText(hWnd, buffer); - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG) -// -// PURPOSE: Processes WM_COMMAND messages for the main frame window. -// -// - -static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (LOWORD(wParam)) { - // Parse the menu selections: - case ID_EDIT_EXIT: - DestroyWindow(hWnd); - break; - - case ID_EDIT_COPY: - case ID_EDIT_REFRESH: - case ID_OPTIONS_REFRESH_RATE: - case ID_HELP_ABOUT: - // TODO: - break; - - case ID_REFRESH: - InvalidateRect(hWnd, NULL, FALSE); - break; - - default: - return FALSE; - } - - return TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG) -// -// PURPOSE: Processes messages for the main window. -// - -LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) { - case WM_CREATE: - SetTimer(hWnd, 0, 200, NULL); // refresh display all 200 ms - SetScrollRange(hWnd, SB_VERT, 1, MAX_ZOOM, FALSE); - SetZoom(hWnd, s_factor); - break; - - case WM_COMMAND: - if (!_CmdWndProc(hWnd, message, wParam, lParam)) { - return DefWindowProc(hWnd, message, wParam, lParam); - } - break; - - case WM_PAINT: { - PAINTSTRUCT ps; - HDC hdcMem; - RECT clnt; - SIZE size; - - BeginPaint(hWnd, &ps); - hdcMem = GetDC(GetDesktopWindow()); - - GetClientRect(hWnd, &clnt); - size.cx = (clnt.right + s_factor-1) / s_factor; - size.cy = (clnt.bottom + s_factor-1) / s_factor; - - StretchBlt(ps.hdc, 0, 0, size.cx*s_factor, size.cy*s_factor, - hdcMem, s_srcPos.x, s_srcPos.y, size.cx, size.cy, SRCCOPY); - - ReleaseDC(GetDesktopWindow(), hdcMem); - EndPaint(hWnd, &ps); - break;} - - case WM_TIMER: - if (s_dragging && GetCapture()==hWnd) { - RECT clnt, rect; - - int width = GetSystemMetrics(SM_CXSCREEN); - int height = GetSystemMetrics(SM_CYSCREEN); - - GetCursorPos(&s_srcPos); - - GetClientRect(hWnd, &clnt); - - s_srcPos.x -= clnt.right / s_factor / 2; - s_srcPos.y -= clnt.bottom / s_factor / 2; - - if (s_srcPos.x < 0) - s_srcPos.x = 0; - else if (s_srcPos.x+clnt.right/s_factor > width) - s_srcPos.x = width - clnt.right/s_factor; - - if (s_srcPos.y < 0) - s_srcPos.y = 0; - else if (s_srcPos.y+clnt.bottom/s_factor > height) - s_srcPos.y = height - clnt.bottom/s_factor; - - if (memcmp(&rect, &s_lastSrc, sizeof(RECT))) { - HDC hdc = GetDC(0); - - if (s_lastSrc.bottom != -1) - DrawFocusRect(hdc, &s_lastSrc); - - rect.left = s_srcPos.x - 1; - rect.top = s_srcPos.y - 1; - rect.right = rect.left + clnt.right/s_factor + 2; - rect.bottom = rect.top + clnt.bottom/s_factor + 2; - DrawFocusRect(hdc, &rect); - - ReleaseDC(0, hdc); - - s_lastSrc = rect; - } - } - - InvalidateRect(hWnd, NULL, FALSE); - UpdateWindow(hWnd); - break; - - case WM_LBUTTONDOWN: - s_dragging = TRUE; - SetCapture(hWnd); - break; - - case WM_LBUTTONUP: - case WM_CANCELMODE: - if (s_dragging) { - HDC hdc = GetDC(0); - DrawFocusRect(hdc, &s_lastSrc); - ReleaseDC(0, hdc); - - s_lastSrc.bottom = -1; - - s_dragging = FALSE; - ReleaseCapture(); - } - break; - - case WM_VSCROLL: - switch(wParam) { - case SB_LINEUP: - case SB_PAGEUP: - SetZoom(hWnd, s_factor-1); - break; - - case SB_LINEDOWN: - case SB_PAGEDOWN: - SetZoom(hWnd, s_factor+1); - break; - } - break; - - case WM_DESTROY: - KillTimer(hWnd, 0); - PostQuitMessage(0); - ExitInstance(); - break; - - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; -} diff --git a/rosapps/applications/devutils/zoomin/framewnd.h b/rosapps/applications/devutils/zoomin/framewnd.h deleted file mode 100644 index 735891b1f08..00000000000 --- a/rosapps/applications/devutils/zoomin/framewnd.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * ReactOS zoomin - * - * framewnd.h - * - * Copyright (C) 2002 Robert Dickenson - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __FRAMEWND_H__ -#define __FRAMEWND_H__ - -LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM); - - -#define WNDCLASS_ZOOMIN TEXT("ZOOMIN") - - -#endif // __FRAMEWND_H__ diff --git a/rosapps/applications/devutils/zoomin/lang/en-US.rc b/rosapps/applications/devutils/zoomin/lang/en-US.rc deleted file mode 100644 index 689705917a7..00000000000 --- a/rosapps/applications/devutils/zoomin/lang/en-US.rc +++ /dev/null @@ -1,85 +0,0 @@ -/* $Id: zoomin.rc 31932 2008-01-21 21:29:59Z dreimer $ */ - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ZOOMIN ICON DISCARDABLE "zoomin.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_ZOOMIN_MENU MENU DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "E&xit\tAlt-F4", ID_EDIT_EXIT - END - POPUP "&Edit" - BEGIN - MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY, GRAYED - MENUITEM "&Refresh\tF5", ID_EDIT_REFRESH - END - POPUP "&Options" - BEGIN - MENUITEM "&Refresh Rate...", ID_OPTIONS_REFRESH_RATE, GRAYED - END - POPUP "&Help" - BEGIN - MENUITEM "&About ...", ID_HELP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX DISCARDABLE 22, 17, 230, 75 -STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "About" -FONT 8, "System" -BEGIN - ICON IDI_ZOOMIN,IDI_ZOOMIN,14,9,16,16 - LTEXT "ReactOS zoomin Version 1.0",IDC_STATIC,49,10,119,8, - SS_NOPREFIX - LTEXT "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8 - DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_APP_TITLE "ReactOS Zoomin" -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_ZOOMIN ACCELERATORS DISCARDABLE -BEGIN - VK_F5, ID_REFRESH, VIRTKEY, NOINVERT -END diff --git a/rosapps/applications/devutils/zoomin/lang/es-ES.rc b/rosapps/applications/devutils/zoomin/lang/es-ES.rc deleted file mode 100644 index 2b81775a2b2..00000000000 --- a/rosapps/applications/devutils/zoomin/lang/es-ES.rc +++ /dev/null @@ -1,85 +0,0 @@ -/* $Id: zoomin.rc 31932 2008-01-21 21:29:59Z dreimer $ */ - -LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ZOOMIN ICON DISCARDABLE "zoomin.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_ZOOMIN_MENU MENU DISCARDABLE -BEGIN - POPUP "&Archivo" - BEGIN - MENUITEM "Sa&lir\tAlt-F4", ID_EDIT_EXIT - END - POPUP "&Edición" - BEGIN - MENUITEM "&Copiar\tCtrl+C", ID_EDIT_COPY, GRAYED - MENUITEM "&Actualizar\tF5", ID_EDIT_REFRESH - END - POPUP "&Opciones" - BEGIN - MENUITEM "&Velocidad de actualización...", ID_OPTIONS_REFRESH_RATE, GRAYED - END - POPUP "Ay&uda" - BEGIN - MENUITEM "&Acerca de ...", ID_HELP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX DISCARDABLE 22, 17, 230, 75 -STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "Acerca de" -FONT 8, "System" -BEGIN - ICON IDI_ZOOMIN,IDI_ZOOMIN,14,9,16,16 - LTEXT "ReactOS zoomin Version 1.0",IDC_STATIC,49,10,119,8, - SS_NOPREFIX - LTEXT "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8 - DEFPUSHBUTTON "Aceptar",IDOK,195,6,30,11,WS_GROUP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_APP_TITLE "ReactOS Zoomin" -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_ZOOMIN ACCELERATORS DISCARDABLE -BEGIN - VK_F5, ID_REFRESH, VIRTKEY, NOINVERT -END diff --git a/rosapps/applications/devutils/zoomin/lang/fr-FR.rc b/rosapps/applications/devutils/zoomin/lang/fr-FR.rc deleted file mode 100644 index 5194031bed5..00000000000 --- a/rosapps/applications/devutils/zoomin/lang/fr-FR.rc +++ /dev/null @@ -1,83 +0,0 @@ -LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ZOOMIN ICON DISCARDABLE "zoomin.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_ZOOMIN_MENU MENU DISCARDABLE -BEGIN - POPUP "&Fichier" - BEGIN - MENUITEM "Quitter\tAlt-F4", ID_EDIT_EXIT - END - POPUP "&Édition" - BEGIN - MENUITEM "&Copier\tCtrl+C", ID_EDIT_COPY, GRAYED - MENUITEM "&Rafraîchir\tF5", ID_EDIT_REFRESH - END - POPUP "&Options" - BEGIN - MENUITEM "Taux de &rafraîchissement...", ID_OPTIONS_REFRESH_RATE, GRAYED - END - POPUP "Aide" - BEGIN - MENUITEM "&A propos de...", ID_HELP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX DISCARDABLE 22, 17, 230, 75 -STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "A propos de" -FONT 8, "System" -BEGIN - ICON IDI_ZOOMIN,IDI_ZOOMIN,14,9,16,16 - LTEXT "ReactOS zoomin Version 1.0",IDC_STATIC,49,10,119,8, - SS_NOPREFIX - LTEXT "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8 - DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_APP_TITLE "ReactOS Zoomin" -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_ZOOMIN ACCELERATORS DISCARDABLE -BEGIN - VK_F5, ID_REFRESH, VIRTKEY, NOINVERT -END diff --git a/rosapps/applications/devutils/zoomin/lang/no-NO.rc b/rosapps/applications/devutils/zoomin/lang/no-NO.rc deleted file mode 100644 index 2a0155aec3c..00000000000 --- a/rosapps/applications/devutils/zoomin/lang/no-NO.rc +++ /dev/null @@ -1,85 +0,0 @@ -/* $Id: zoomin.rc 31932 2008-01-21 21:29:59Z dreimer $ */ - -LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ZOOMIN ICON DISCARDABLE "zoomin.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_ZOOMIN_MENU MENU DISCARDABLE -BEGIN - POPUP "&Fil" - BEGIN - MENUITEM "A&vslutt\tAlt-F4", ID_EDIT_EXIT - END - POPUP "&Rediger" - BEGIN - MENUITEM "&Kopier\tCtrl+C", ID_EDIT_COPY, GRAYED - MENUITEM "&Oppdater\tF5", ID_EDIT_REFRESH - END - POPUP "&Valg" - BEGIN - MENUITEM "&Oppdatering hastighet...", ID_OPTIONS_REFRESH_RATE, GRAYED - END - POPUP "&Hjelp" - BEGIN - MENUITEM "&Om ...", ID_HELP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX DISCARDABLE 22, 17, 230, 75 -STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "Om" -FONT 8, "System" -BEGIN - ICON IDI_ZOOMIN,IDI_ZOOMIN,14,9,16,16 - LTEXT "ReactOS zoomin versjon 1.0",IDC_STATIC,49,10,119,8, - SS_NOPREFIX - LTEXT "Enerett (C) 2002 ReactOS gruppen",IDC_STATIC,49,20,119,8 - DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_APP_TITLE "ReactOS Zoomin" -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_ZOOMIN ACCELERATORS DISCARDABLE -BEGIN - VK_F5, ID_REFRESH, VIRTKEY, NOINVERT -END diff --git a/rosapps/applications/devutils/zoomin/lang/sk-SK.rc b/rosapps/applications/devutils/zoomin/lang/sk-SK.rc deleted file mode 100644 index 9ecaa354709..00000000000 --- a/rosapps/applications/devutils/zoomin/lang/sk-SK.rc +++ /dev/null @@ -1,87 +0,0 @@ -/* TRANSLATOR : Mário Kaèmár /Mario Kacmar/ aka Kario (kario@szm.sk) - * DATE OF TR.: 04-09-2008 - */ - -LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ZOOMIN ICON DISCARDABLE "zoomin.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_ZOOMIN_MENU MENU DISCARDABLE -BEGIN - POPUP "&Súbor" - BEGIN - MENUITEM "&Skonèi\tAlt-F4", ID_EDIT_EXIT - END - POPUP "&Upravi" - BEGIN - MENUITEM "&Kopírova\tCtrl+C", ID_EDIT_COPY, GRAYED - MENUITEM "&Obnovi\tF5", ID_EDIT_REFRESH - END - POPUP "&Možnosi" - BEGIN - MENUITEM "&Obnovovací kmitoèet...", ID_OPTIONS_REFRESH_RATE, GRAYED - END - POPUP "&Pomocník" - BEGIN - MENUITEM "È&o je ...", ID_HELP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX DISCARDABLE 22, 17, 230, 75 -STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "Èo je Zoomin" -FONT 8, "System" -BEGIN - ICON IDI_ZOOMIN,IDI_ZOOMIN,14,9,16,16 - LTEXT "ReactOS zoomin verzia 1.0",IDC_STATIC,49,10,119,8, - SS_NOPREFIX - LTEXT "Autorské práva (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8 - DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_APP_TITLE "ReactOS Zoomin" -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_ZOOMIN ACCELERATORS DISCARDABLE -BEGIN - VK_F5, ID_REFRESH, VIRTKEY, NOINVERT -END diff --git a/rosapps/applications/devutils/zoomin/lang/uk-UA.rc b/rosapps/applications/devutils/zoomin/lang/uk-UA.rc deleted file mode 100644 index 400a7f145d2..00000000000 --- a/rosapps/applications/devutils/zoomin/lang/uk-UA.rc +++ /dev/null @@ -1,91 +0,0 @@ -/* - * PROJECT: ReactOS zoomin - * LICENSE: GPL - See COPYING in the top level directory - * FILE: devutils/zoomin/lang/uk-UA.rc - * PURPOSE: Ukraianian resource file - * TRANSLATOR: Artem Reznikov - */ - -LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ZOOMIN ICON DISCARDABLE "zoomin.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_ZOOMIN_MENU MENU DISCARDABLE -BEGIN - POPUP "&Ôàéë" - BEGIN - MENUITEM "Â&èõ³ä\tAlt-F4", ID_EDIT_EXIT - END - POPUP "&Edit" - BEGIN - MENUITEM "&Êîï³þâàòè\tCtrl+C", ID_EDIT_COPY, GRAYED - MENUITEM "&Îíîâèòè\tF5", ID_EDIT_REFRESH - END - POPUP "&Options" - BEGIN - MENUITEM "&×àñòîòà îíîâëåííÿ...", ID_OPTIONS_REFRESH_RATE, GRAYED - END - POPUP "&Äîâ³äêà" - BEGIN - MENUITEM "&Ïðî ïðîãðàìó", ID_HELP_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOGEX DISCARDABLE 22, 17, 230, 75 -STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "Ïðî ïðîãðàìó" -FONT 8, "System" -BEGIN - ICON IDI_ZOOMIN,IDI_ZOOMIN,14,9,16,16 - LTEXT "ReactOS zoomin âåðñ³ÿ 1.0",IDC_STATIC,49,10,119,8, - SS_NOPREFIX - LTEXT "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8 - DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_APP_TITLE "ReactOS Zoomin" -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_ZOOMIN ACCELERATORS DISCARDABLE -BEGIN - VK_F5, ID_REFRESH, VIRTKEY, NOINVERT -END diff --git a/rosapps/applications/devutils/zoomin/main.c b/rosapps/applications/devutils/zoomin/main.c deleted file mode 100644 index 85b496cdc18..00000000000 --- a/rosapps/applications/devutils/zoomin/main.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * ReactOS zoomin - * - * main.c - * - * Copyright (C) 2002 Robert Dickenson - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#include -#include -#include -#include - -#include "main.h" -#include "framewnd.h" - - -//////////////////////////////////////////////////////////////////////////////// -// Global Variables: -// - -HWND hFrameWnd; -HMENU hMenuFrame; - -TCHAR szTitle[MAX_LOADSTRING]; - - -//////////////////////////////////////////////////////////////////////////////// -// -// FUNCTION: InitInstance(HANDLE, int) -// -// PURPOSE: creates main window -// - -BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) -{ - WNDCLASSEX wcFrame = { - sizeof(WNDCLASSEX), - CS_HREDRAW | CS_VREDRAW/*style*/, - FrameWndProc, - 0/*cbClsExtra*/, - 0/*cbWndExtra*/, - hInstance, - LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ZOOMIN)), - LoadCursor(0, IDC_ARROW), - 0,//(HBRUSH)(COLOR_BTNFACE+1), - 0/*lpszMenuName*/, - WNDCLASS_ZOOMIN, - (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_ZOOMIN), IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED) - }; - ATOM hFrameWndClass = RegisterClassEx(&wcFrame); // register frame window class - - hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_ZOOMIN_MENU)); - - hFrameWnd = CreateWindowEx(0, (LPCTSTR)UlongToPtr(hFrameWndClass), szTitle, - WS_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE | WS_VSCROLL, - CW_USEDEFAULT, CW_USEDEFAULT, 250, 250, - NULL, hMenuFrame, hInstance, NULL/*lpParam*/); - - if (!hFrameWnd) { - return FALSE; - } - - ShowWindow(hFrameWnd, nCmdShow); - UpdateWindow(hFrameWnd); - - return TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// - -void ExitInstance(void) -{ - DestroyMenu(hMenuFrame); -} - -int APIENTRY WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpCmdLine, - int nCmdShow) -{ - MSG msg; - HACCEL hAccel; - - // Initialize global strings - LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); - - // Perform application initialization: - if (!InitInstance(hInstance, nCmdShow)) { - return FALSE; - } - - hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ZOOMIN)); - - // Main message loop: - while (GetMessage(&msg, (HWND)NULL, 0, 0)) { - if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - return msg.wParam; -} diff --git a/rosapps/applications/devutils/zoomin/main.h b/rosapps/applications/devutils/zoomin/main.h deleted file mode 100644 index 3ed7d1b7c6a..00000000000 --- a/rosapps/applications/devutils/zoomin/main.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * ReactOS zoomin - * - * main.h - * - * Copyright (C) 2002 Robert Dickenson - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#include "resource.h" - -#define MAX_LOADSTRING 100 - - -//////////////////////////////////////////////////////////////////////////////// -// Global Variables: -// -extern HWND hFrameWnd; -extern HMENU hMenuFrame; - -extern TCHAR szTitle[]; - - -#endif // __MAIN_H__ diff --git a/rosapps/applications/devutils/zoomin/resource.h b/rosapps/applications/devutils/zoomin/resource.h deleted file mode 100644 index 5440f08f6c9..00000000000 --- a/rosapps/applications/devutils/zoomin/resource.h +++ /dev/null @@ -1,22 +0,0 @@ -#define ID_ZOOMIN_MENU 0 -#define ID_FILE_MENU 1 -#define ID_OPTIONS_MENU 2 -#define ID_HELP_MENU 3 - -#define IDD_ABOUTBOX 103 -#define IDS_APP_TITLE 103 -#define IDI_ZOOMIN 107 -#define IDI_SMALL 108 -#define IDR_ZOOMIN_MENU 109 -#define IDR_ZOOMIN 110 - -#define ID_EDIT_EXIT 32700 -#define ID_EDIT_COPY 32701 -#define ID_EDIT_REFRESH 32702 -#define ID_OPTIONS_REFRESH_RATE 32704 -#define ID_HELP_ABOUT 32703 - -#define ID_REFRESH 40001 - -#define IDC_STATIC -1 - diff --git a/rosapps/applications/devutils/zoomin/zoomin.ico b/rosapps/applications/devutils/zoomin/zoomin.ico deleted file mode 100644 index 386883523bcc032db77b69b047cbc5c15ae3b7fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmeH_K@!3s3`IZHwe$$AoF2oYaWszOk{jR)NR>_(PRDWOZgV)&%Zp6VccBVa2?uQ&sh9LW;!?J w2dwKn!S@jnH5GJS10MR3&V{nkc?%F^XS#jrb=7ItXV>BJ*yg?&H~)SR4}%AClK=n! diff --git a/rosapps/applications/devutils/zoomin/zoomin.rbuild b/rosapps/applications/devutils/zoomin/zoomin.rbuild deleted file mode 100644 index 8fd183f94c8..00000000000 --- a/rosapps/applications/devutils/zoomin/zoomin.rbuild +++ /dev/null @@ -1,9 +0,0 @@ - - . - kernel32 - gdi32 - user32 - framewnd.c - main.c - zoomin.rc - diff --git a/rosapps/applications/devutils/zoomin/zoomin.rc b/rosapps/applications/devutils/zoomin/zoomin.rc deleted file mode 100644 index 306831613e6..00000000000 --- a/rosapps/applications/devutils/zoomin/zoomin.rc +++ /dev/null @@ -1,16 +0,0 @@ -/* $Id$ */ - -#include -#include "resource.h" - -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Zoomin Utility\0" -#define REACTOS_STR_INTERNAL_NAME "zoomin\0" -#define REACTOS_STR_ORIGINAL_FILENAME "zoomin.exe\0" -#include - -#include "lang/en-US.rc" -#include "lang/es-ES.rc" -#include "lang/fr-FR.rc" -#include "lang/no-NO.rc" -#include "lang/sk-SK.rc" -#include "lang/uk-UA.rc" -- 2.17.1