diff --git a/build/gnu/Makefile b/build/gnu/Makefile deleted file mode 100644 index 497e8dc6f..000000000 --- a/build/gnu/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# ****************************************************************** -# * -# * .,-::::: .,:: .::::::::. .,:: .: -# * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -# * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -# * $$$ Y$$$P $$""""Y$$ Y$$$P -# * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -# * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -# * -# * Cxbx->Makefile -# * -# * This file is part of the Cxbx project. -# * -# * Cxbx and Cxbe are free software; you can redistribute them -# * and/or modify them 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 recieved a copy of the GNU General Public License -# * along with this program; see the file COPYING. -# * If not, write to the Free Software Foundation, Inc., -# * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -# * -# * (c) 2002-2003 Aaron Robinson -# * -# * All rights reserved -# * -# ****************************************************************** -# * File Authors: Aaron Robinson, Edgar Hucek -# ****************************************************************** -CC = g++ -CFLAGS = -g -O2 -I../../src -I../../src/Common/Linux -I../..src/Linux -OBJCOPY = objcopy -GCC295 = cpp0-2.95 -#LDFLAGS = -s -S -T ldscript.ld - -OBJECTS = ../../src/Common/Error.o \ - ../../src/Common/Exe.o \ - ../../src/Common/Xbe.o \ - ../../src/Common/OpenXDK.o \ - ../../src/Cxbe/Main.o - -RESOURCES = - -# target: -all : cxbe - -clean : - rm -rf *.o *~ core *.core ${OBJECTS} ${RESOURCES} - rm -rf *.o *~ core *.core ${OBJECTS} ${RESOURCES} ../../bin/cxbe ../../bin/cxbe.exe - -cxbe : ${OBJECTS} ${RESOURCES} - ${CC} -o ../../bin/$@ ${OBJECTS} ${RESOURCES} ${LDFLAGS-XBE} - -### rules: - -%.o : %.cpp - ${CC} ${CFLAGS} -o $@ -c $< - -%.o : %.c - ${CC} ${CFLAGS} -o $@ -c $< - -%.o : %.S - ${CC} -DASSEMBLER ${CFLAGS} -o $@ -c $< diff --git a/build/win32/Cxbe.vcxproj b/build/win32/Cxbe.vcxproj deleted file mode 100644 index bb65797af..000000000 --- a/build/win32/Cxbe.vcxproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - Cxbe - {028D5D8F-072C-4308-9095-4EF1EA6B83B0} - 8.1 - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - false - true - AllRules.ruleset - - - AllRules.ruleset - - - ..\..\import\DirectX8\include;$(IncludePath) - ..\..\import\DirectX8\lib;$(LibraryPath) - ..\..\import\DirectX8\include;$(IncludePath) - ..\..\import\DirectX8\lib;$(LibraryPath) - - - - .\..\..\bin\release/Cxbe.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\src;..\..\src\Common\Win32;..\..\src\Win32;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level3 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Console - false - - - MachineX86 - - - true - - - - - .\..\..\bin\debug/Cxbe.tlb - - - - - Disabled - ..\..\src;..\..\src\Common\Win32;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - true - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - true - Console - false - - - MachineX86 - - - true - - - - - - - - - - - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/build/win32/Cxbx.sln b/build/win32/Cxbx.sln index 3582acace..1890fa8b6 100644 --- a/build/win32/Cxbx.sln +++ b/build/win32/Cxbx.sln @@ -1,12 +1,8 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbe", "Cxbe.vcxproj", "{028D5D8F-072C-4308-9095-4EF1EA6B83B0}" - ProjectSection(ProjectDependencies) = postProject - {22592F16-CC5F-45CB-A40A-022FF6FCC146} = {22592F16-CC5F-45CB-A40A-022FF6FCC146} - {E7A72D3D-5810-4078-A243-348B59726365} = {E7A72D3D-5810-4078-A243-348B59726365} - EndProjectSection -EndProject +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbx", "Cxbx.vcxproj", "{E7A72D3D-5810-4078-A243-348B59726365}" ProjectSection(ProjectDependencies) = postProject {22592F16-CC5F-45CB-A40A-022FF6FCC146} = {22592F16-CC5F-45CB-A40A-022FF6FCC146} @@ -20,10 +16,6 @@ Global Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {028D5D8F-072C-4308-9095-4EF1EA6B83B0}.Debug|Win32.ActiveCfg = Debug|Win32 - {028D5D8F-072C-4308-9095-4EF1EA6B83B0}.Debug|Win32.Build.0 = Debug|Win32 - {028D5D8F-072C-4308-9095-4EF1EA6B83B0}.Release|Win32.ActiveCfg = Release|Win32 - {028D5D8F-072C-4308-9095-4EF1EA6B83B0}.Release|Win32.Build.0 = Release|Win32 {E7A72D3D-5810-4078-A243-348B59726365}.Debug|Win32.ActiveCfg = Debug|Win32 {E7A72D3D-5810-4078-A243-348B59726365}.Debug|Win32.Build.0 = Debug|Win32 {E7A72D3D-5810-4078-A243-348B59726365}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/build/win32/CxbxKrnl.vcxproj b/build/win32/CxbxKrnl.vcxproj index b7111f81d..f77c880f4 100644 --- a/build/win32/CxbxKrnl.vcxproj +++ b/build/win32/CxbxKrnl.vcxproj @@ -82,7 +82,7 @@ Include\Win32\CxbxKrnl;%(AdditionalIncludeDirectories) - legacy_stdio_definitions.lib;dxerr8.lib;xinput.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx8.lib;d3d8.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Shlwapi.lib;legacy_stdio_definitions.lib;dxerr8.lib;xinput.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx8.lib;d3d8.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) true libci.lib;%(IgnoreSpecificDefaultLibraries) false @@ -127,7 +127,7 @@ Include\Win32\CxbxKrnl;%(AdditionalIncludeDirectories) - legacy_stdio_definitions.lib;dxerr8.lib;xinput.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx8.lib;d3d8.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;dbghelp.lib;%(AdditionalDependencies) + Shlwapi.lib;legacy_stdio_definitions.lib;dxerr8.lib;xinput.lib;ws2_32.lib;dsound.lib;winmm.lib;ddraw.lib;d3dx8.lib;d3d8.lib;dinput8.lib;dxguid.lib;odbc32.lib;odbccp32.lib;dbghelp.lib;%(AdditionalDependencies) true libci.lib;%(IgnoreSpecificDefaultLibraries) true @@ -162,7 +162,6 @@ - @@ -469,12 +468,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) diff --git a/doc/64bitsupport.txt.txt b/doc/64bitsupport.txt.txt deleted file mode 100644 index 4b91283af..000000000 --- a/doc/64bitsupport.txt.txt +++ /dev/null @@ -1,123 +0,0 @@ -Grt -Patrick - - -NewPcr->Prcb = &NewPct->PrcbData; - -prcbdataoffset = (DWORD)&NewPct->PrcbData; -ethreadoffset = (DWORD)&EThread; -newtls = (DWORD)pNewTLS; - -__asm -{ - pushad - - mov eax, 00011000h - mov edi, 1FA2ACh - mov ecx, 1E92B2h - -search_me: - // 64 a1 28 00 - cmp dword ptr [eax], 0028a164h ; mov eax, large fs:28h - je fix_eax_fs28 - - // 64 a1 20 00 - cmp dword ptr [eax], 0020a164h ; mov eax, large fs:20h - je fix_eax_fs20 - - // 64 8b 0d 04 - cmp dword ptr [eax], 040d8b64h ; mov ecx, large fs:4 - je fix_ecx_fs04 - - // 64 8b 3d 04 - cmp dword ptr [eax], 043d8b64h ; mov edi, large fs:4 - je fix_edi_fs04 - - // 64 0f b6 05 - cmp dword ptr [eax], 05b60f64h ; movzx eax, large byte ptr fs:24h - je fix_eax_fs24 - - jmp cont111 - -fix_eax_fs28: - mov byte ptr [eax], 0B8h ; mov eax, {00000000} - mov ebx, EThread - mov dword ptr [eax+1], ebx - move byte ptr [eax+5], 090h ; NOP - jmp cont111 - -fix_eax_fs20: - mov byte ptr [eax], 0B8h ; mov eax, {00000000} - mov ebx, prcbdataoffset - mov dword ptr [eax+1], ebx - move byte ptr [eax+5], 090h ; NOP - jmp cont111 - -fix_ecx_fs04: - mov byte ptr [eax], 0B9h ; mov ecx, {00000000} - mov ebx, newtls - mov dword ptr [eax+1], ebx - move byte ptr [eax+5], 090h ; NOP - move byte ptr [eax+6], 090h ; NOP - jmp cont111 - -fix_edi_fs04: - move byte ptr [eax], 066h ; Put 66 bf, which means : - move byte ptr [eax+1], 0BFh ; mov di, {0000} - mov ebx, newtls - -// GUESSWORK FROM HERE ON : - mov dword ptr [eax+2], ebx - jmp cont111 - -fix_eax_fs24: - - move byte ptr [eax+0], 090h ; NOP - move byte ptr [eax+1], 090h ; NOP - move byte ptr [eax+2], 090h ; NOP - move byte ptr [eax+3], 090h ; NOP - move byte ptr [eax+4], 090h ; NOP - move byte ptr [eax+5], 090h ; NOP - move byte ptr [eax+6], 090h ; NOP - move byte ptr [eax+7], 090h ; NOP - jmp cont111 - -cont111: - inc eax - cmp eax, edi ; Use ecx instead? - jne search_me -} ----------- Forwarded message ---------- -From: Robert Yates -Date: Tue, Jul 15, 2008 at 18:36 -Subject: EmuFS proof of concept change. -To: patrickvl@users.sourceforge.net - - - -Hi Patrick, - -I didnt learn anything else from caustik. -Today i studied the cxbx code some more and -now i have a perfect understand of how the xbox -uses the FS differently. - -I now see that patching the executable is possible -to avoid the need to an LDT allocation which breaks -in some cases on vista i believe. - -Today i removed the LDT code from cxbx, then i saw how -turok crashes cos of invalid FS structure, i need coded -a small scanner in asm(quick and dirty code) to patch and -fix up FS references, and guess what,,it works! :-) - -have a look at my proof of concept picture attached. -now i know this is working i can start to code it into -dxbx. - -p.s reply to robert.yates@reverse-engineering.info, having trouble -sending email from that account currently. - - -Regards, - Robert Yates diff --git a/src/Cxbe/Main.cpp b/src/Cxbe/Main.cpp deleted file mode 100644 index f32c30079..000000000 --- a/src/Cxbe/Main.cpp +++ /dev/null @@ -1,278 +0,0 @@ -// ****************************************************************** -// * -// * .,-::::: .,:: .::::::::. .,:: .: -// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;; -// * [[[ '[[,,[[' [[[__[[\. '[[,,[[' -// * $$$ Y$$$P $$""""Y$$ Y$$$P -// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo, -// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm, -// * -// * Cxbx->Standard->Cxbe->Main.cpp -// * -// * This file is part of the Cxbx project. -// * -// * Cxbx and Cxbe are free software; you can redistribute them -// * and/or modify them 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 recieved a copy of the GNU General Public License -// * along with this program; see the file COPYING. -// * If not, write to the Free Software Foundation, Inc., -// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. -// * -// * (c) 2002-2003 Aaron Robinson -// * -// * All rights reserved -// * -// ****************************************************************** - -#include "../Common/Exe.h" -#include "../Common/Xbe.h" - -#include - -// static global(s) -static void ShowUsage(); -static void MakeUpper(char *str); - -// program entry point -int main(int argc, char *argv[]) -{ - char szErrorMessage[266] = {0}; - char szExeFilename[266] = {0}; - char szXbeFilename[266] = {0}; - char szDumpFilename[266] = {0}; - char szXbeTitle[256] = "Untitled"; - bool bRetail = true; - - // parse command line - for(int v=1;v 256) - printf("WARNING: Title too long, using default title\n"); - else - strcpy(szXbeTitle, szParam); - } - else if(strcmp(szOptionU, "MODE") == 0) - { - if(strcmp(szParamU, "RETAIL") == 0) - bRetail = true; - else if(strcmp(szParamU, "DEBUG") == 0) - bRetail = false; - else - { - strcpy(szErrorMessage, "invalid MODE"); - goto cleanup; - } - } - else - { - char szBuffer[255]; - sprintf(szBuffer, "Unrecognized command : %s", szOption); - strcpy(szErrorMessage, szBuffer); - goto cleanup; - } - } - } - - // verify we recieved the required parameters - if(szExeFilename[0] == '\0') - { - ShowUsage(); - return 1; - } - - // if we don't have an Xbe filename, generate one from szExeFilename - if(szXbeFilename[0] == '\0') - { - strcpy(szXbeFilename, szExeFilename); - - char *szFilename = &szXbeFilename[0]; - - // locate last \ or / (if there are any) - { - for(int c=0;szXbeFilename[c] != 0;c++) - if(szXbeFilename[c] == '\\' || szXbeFilename[c] == '/') - szFilename = &szXbeFilename[c+1]; - } - - // locate and remove last . (if there are any) - { - char szWorkingU[266]; - - char *szWorking = szFilename; - - strncpy(szWorkingU, szWorking, 265); - - for(int c=0;szFilename[c] != 0;c++) - if(szFilename[c] == '.') - szWorking = &szFilename[c]; - - MakeUpper(szWorking); - - if(strcmp(szWorkingU, ".exe") == 0) - strcpy(szWorking, ".xbe"); - else - strcat(szXbeFilename, ".xbe"); - } - } - - // open and convert Exe file - { - Exe *ExeFile = new Exe(szExeFilename); - - if(ExeFile->GetError() != 0) - { - strcpy(szErrorMessage, ExeFile->GetError()); - goto cleanup; - } - - Xbe *XbeFile = new Xbe(ExeFile, szXbeTitle, bRetail); - - if(XbeFile->GetError() != 0) - { - strcpy(szErrorMessage, XbeFile->GetError()); - goto cleanup; - } - - if(szDumpFilename[0] != 0) - { - FILE *outfile = fopen(szDumpFilename, "wt"); - XbeFile->DumpInformation(outfile); - fclose(outfile); - - if(XbeFile->GetError() != 0) - { - if(XbeFile->IsFatal()) - { - strcpy(szErrorMessage, XbeFile->GetError()); - goto cleanup; - } - else - { - printf("DUMPINFO -> Warning: %s\n", XbeFile->GetError()); - XbeFile->ClearError(); - } - } - } - - XbeFile->Export(szXbeFilename); - - if(XbeFile->GetError() != 0) - { - strcpy(szErrorMessage, XbeFile->GetError()); - goto cleanup; - } - } - -cleanup: - - if(szErrorMessage[0] != 0) - { - ShowUsage(); - - printf("\n"); - printf(" * Error : %s\n", szErrorMessage); - - return 1; - } - - return 0; -} - -// show program usage -static void ShowUsage() -{ - printf - ( - "CXBE XBE->EXE (XBox->Win32) Relinker (CXBX Core Version " _CXBX_VERSION ")\n" - "Copyright (C) Aaron Robinson 2002-2003. All rights reserved.\n" - "\n" - "Usage : cxbe [options] [exefile]\n" - "\n" - "Options :\n" - "\n" - " -OUT:filename\n" - " -DUMPINFO:filename\n" - " -TITLE:title\n" - " -MODE:{debug|retail}\n" - ); -} - -// convert string to upper case -static void MakeUpper(char *str) -{ - while(*str != '\0') - { - if(*str >= 'a' && *str <= 'z') - *str = *str - ('a' - 'A'); - - str++; - } -}