Tool client (Tools/WowClient) with generated stand-ins now runs InitializeGlobal completely: config, locale, MPQs, signature file, hardware detect, D3D device, Storm log. Stops at InitializeEngineCallback. - entry start 0x401000 (StormRtlInitialize before CRT), /ENTRY:start - ConsoleDevice + ConsoleDetect module, GxDefaultApi - SFile signature path (ClearAllFileFlags, SetFileSignature, HashMap insert) - WowLogHeader + helpers, SMemIsValidPointer, ClntObjMgrIsValid - ConsoleWrite line list, CGObject_C vtable declarations - crash handler prints symbolized x64 stack - Engine/FFX port (FFX agent), Pass headers moved out of _Triage Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
65 lines
1.3 KiB
C++
65 lines
1.3 KiB
C++
#if defined(WOWDECOMP_ARCH_64)
|
|
|
|
#include <windows.h>
|
|
#include <cstdlib>
|
|
#include <float.h>
|
|
#include "Engine/Source/Storm/H/storm.h"
|
|
#include "WoW/Source/Client.h"
|
|
|
|
// STATIC: 0x00B311E8
|
|
static LPVOID lpFiber;
|
|
|
|
static void InvalidParameterHandler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t reserved) {
|
|
}
|
|
|
|
static bool ReturnFalse() {
|
|
return false;
|
|
}
|
|
|
|
extern "C" int WinMainCRTStartup();
|
|
|
|
// OFFSET: 0x00401000
|
|
extern "C" int start() {
|
|
StormRtlInitialize();
|
|
return WinMainCRTStartup();
|
|
}
|
|
|
|
// OFFSET: 0x00406D70
|
|
int main() {
|
|
_set_invalid_parameter_handler(InvalidParameterHandler);
|
|
_clearfp();
|
|
_control87(0x9001F & ~(_MCW_PC | _MCW_IC), _MCW_DN | _MCW_EM | _MCW_RC);
|
|
ReturnFalse();
|
|
|
|
return CommonMain();
|
|
}
|
|
|
|
// OFFSET: 0x0040B7D0
|
|
static VOID CALLBACK MainFiberProc(LPVOID parameter) {
|
|
*static_cast<int*>(parameter) = main();
|
|
SwitchToFiber(lpFiber);
|
|
}
|
|
|
|
// OFFSET: 0x0040B7F0
|
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
|
|
lpFiber = ConvertThreadToFiber(nullptr);
|
|
|
|
if (!lpFiber) {
|
|
return -1;
|
|
}
|
|
|
|
int result = -1;
|
|
LPVOID fiber = CreateFiberEx(0, 0x800000, 0, MainFiberProc, &result);
|
|
|
|
if (!fiber) {
|
|
return -1;
|
|
}
|
|
|
|
SwitchToFiber(fiber);
|
|
DeleteFiber(fiber);
|
|
|
|
return result;
|
|
}
|
|
|
|
#endif
|