==Summary==
Attempt to open save file - call sub_483AC4 : jnz loc_452500
report error ; "\n ** Error opening save game for writin"...
Attempt save Header - call sub_484744, call sub_452828 : jnz loc_452554
report error ; "\n ** Error writing save game header! **"...
print ; " Save file header size written: %d byte"...
Attempt Save Complete - : jnz loc_4525B8
00452577 call sub_484744
00452585 call ds:off_4CBCB8[esi]
report error ; "\n ** Error writing save function #%d da"...
print ; " Save function #%d data size written: %"...
print ; " Total save data written: %ld bytes.\n"
BEGTEXT:00452639 retn
make folder data in your game folder.
make folder SAVEGAME in data folder
make folder SLOT00 in SAVEGAME
copy fallout 2 save.dat to SLOT00 folder.
this DLL if injected, takes one key press of ctrl-right. your game will crash. go and refresh view of SLOT00 folder contents.
your save.dat will be 0kb. all data will have been cleared but nothing written. the crash is because of complication with strncopy.
the ultimate solution for no crash no doubt, a few instructions modified/added. but for now you have insight.
Code: Select all
#include <Windows>
void SimpleGoto();
HRESULT WINAPI InputThread(LPVOID);
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if(fdwReason == DLL_PROCESS_ATTACH){
DisableThreadLibraryCalls(hinstDLL);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)InputThread, NULL, NULL, NULL);
return TRUE;
}
return FALSE;
}
HRESULT WINAPI InputThread(LPVOID Param)
{
while(1){
Sleep(1);
if(GetAsyncKeyState(VK_RCONTROL) & 0x8000){
SimpleGoto();
Sleep(1);
}
if(GetAsyncKeyState(VK_PAUSE) & 0x8000){
break;
}
}
return TRUE;
}
char szSaveBuff [30051]={0}; // modding wiki . decimal value for header size is 30051.
void SimpleGoto()
{
// with a debugger changing the register eax from 0xcd2a20bc to offset of szSaveBuff
// gets a bit further, but still confused.
DWORD dwSaveAddr = 0x00452488;
__asm {
call dwSaveAddr
}
}