/***************************************************************************** * @(#) Ndless - * *****************************************************************************/ #include #include "utils.h" asm(".string \"PRG\"\n"); int main(void) { FILE *outf; int size, inu; showSimpleDialogBox( "Ndless+ , Emu file writer", "-----------------------------------\n" "Put full path of the file at 11700000\n" "Put file size at 11700100\n" "Use the emulator wf command to place\n" " the file contents at 11800000\n" "-----------------------------------\n" "A debug break will follow this dialog" ); TCT_Local_Control_Interrupts(0); asm(".long 0xe1200071"); if(*(char*)0x11700104 == 'r' ){ // r=0x72 unlink("/documents/ndless/strbackup.tns"); rename("/phoenix/syst/locales/en/strings.res","/documents/ndless/strbackup.tns"); outf = fopen("/phoenix/syst/locales/en/strings.res","wb"); if (outf == NULL) { printf("Problem opening file: %s\n","/phoenix/syst/locales/en/strings.res"); return 1; } size = fwrite((void*)0x11800000,0x1448,1,outf); fclose(outf); printf("bytes written: %d\n",size); return 0; } outf = fopen((char*)0x11700000,"wb"); if (outf == NULL) { printf("Problem opening file: %s\n",(char*)0x11700000); return 1; } size = *(int*)0x11700100; fwrite((void*)0x11800000,size,1,outf); fclose(outf); asm(".long 0xe1200072"); return 0; }