// GENERATED — do not edit. Facts about Sword of the Stars.exe (GOG 1.8.1). // Source: sots-re ghidra/addresses.json @ b24f13c, generated 2026-09-07 by tools/gen_addresses.py // Runtime address = (uintptr_t)GetModuleHandle(NULL) + RVA (the exe is ASLR-relocated). #pragma once #include namespace sots::addr { constexpr uint32_t IMAGE_BASE = 0x00400000; // thiscall bool (Application* this, AppStartup* startup) /* ONE stack arg, RET 4, returns AL; EDX unused. startup = {HINSTANCE hInst; std::vector args; ...; int nShow; const char* wndClass; int iconId} built in WinMain */ [verified] constexpr uint32_t Mars_Application_Initialize = 0x004a0e50; // thiscall void (Application* this) /* no stack args, plain RET, EDX not an input, EAX = last PumpMessages result (ignore) */ [verified] constexpr uint32_t Mars_Application_Run = 0x0049f5b0; // cdecl void (int coreIndex) [unverified] constexpr uint32_t Process_PinAffinity = 0x0049ee70; // thiscall GlobalConst* (GlobalConst* this, void* storage, const char* key, ParseFn parser, const char* file) // RET 0x10 [verified] constexpr uint32_t CfgVar_RegisterKey = 0x004b76a0; // thiscall bool (DemoApp* this) /* no stack args; returns 0 when quitting (this+0x1b2), else 1 */ [verified] constexpr uint32_t DemoApp_OnTick = 0x0049a640; // thiscall void (StrategyClient* this) [unverified] constexpr uint32_t StrategyClient_EndTurn = 0x00383be0; // thiscall void (StrategyServer* this) [unverified] constexpr uint32_t StrategyServer_BeginProcessTurn = 0x003d98e0; // thiscall void (StrategyServer* this) [unverified] constexpr uint32_t StrategyServer_ProcessTurn = 0x003dc6c0; // thiscall void (ServerPlayer* this, int out[25], bool projected) [verified] constexpr uint32_t ServerPlayer_ComputeBudget = 0x00463030; // thiscall void (TechTree* this, ?, vector<{node,int}>* alloc, int* overbudget) /* decay loop hits current target */ [verified] constexpr uint32_t TechTree_ProcessResearch = 0x001876c0; // thiscall void (ServerSystem* this /*+8 IStreamable*/, Stream* s) [verified-by-save] constexpr uint32_t ServerSystem_Read = 0x0035d4b0; // thiscall void (ServerSystem* this /*+8*/, Stream* s) [verified-by-save] constexpr uint32_t ServerSystem_Write = 0x00349630; // thiscall void (ServerPlayer* this /*+0x3a0*/, Stream* s) [verified-by-save] constexpr uint32_t ServerPlayer_Read = 0x004804d0; // thiscall void (ServerPlayer* this /*+0x3a0*/, Stream* s) [verified-by-save] constexpr uint32_t ServerPlayer_Write = 0x004563e0; // thiscall void (StarFleet* this /*+8*/, Stream* s) [verified-by-save] constexpr uint32_t StarFleet_Read = 0x00302470; // thiscall void (StarFleet* this /*+8*/, Stream* s) [verified-by-save] constexpr uint32_t StarFleet_Write = 0x00301070; // thiscall void (StarShip* this /*+8*/, Stream* s) [verified-by-save] constexpr uint32_t StarShip_Read = 0x00453fa0; // thiscall void (StarShip* this /*+8*/, Stream* s) [verified-by-save] constexpr uint32_t StarShip_Write = 0x004291f0; // thiscall void (StrategyServer* this, Stream* s) [verified-by-save] constexpr uint32_t StrategyServer_Read = 0x003d27a0; // thiscall void (StrategyServer* this, Stream* s) [verified-by-save] constexpr uint32_t StrategyServer_Write = 0x0039fa70; // thiscall void (Stream* this, const char* tag, NetworkObject* obj) [unverified] constexpr uint32_t Stream_WriteNetworkObjectId = 0x00416490; // thiscall void (RNG* this) [unverified] constexpr uint32_t RNG_Twist = 0x00026e00; // thiscall void (RNG* this, uint32_t seed) [unverified] constexpr uint32_t RNG_Seed = 0x0009fdf0; // thiscall float (RNG* this) [unverified] constexpr uint32_t RNG_NextFloat = 0x0007d830; // thiscall uint32_t (RNG* this) [unverified] constexpr uint32_t RNG_NextInt = 0x000271c0; // cdecl void (void) /* sots.ini [Modules] Mount -> gobio::Init */ [verified] constexpr uint32_t Mars_Application_MountModules = 0x004a0a20; // cdecl void (int* count, const char*** table) /* count 3 @0x00b2d514, table @0x00a35e98 */ [verified] constexpr uint32_t Game_GetDefaultMounts = 0x004991c0; // thiscall GlobalConst* (GlobalConst* this, void* storage, const char* key, GlobalConstParseFn parser, const char* file) /* RET 0x10; static-init stub call. GlobalConst 0x10 bytes: {+0 void* storage (int/float/float[4]), +4 const char* key, +8 parser, +c const char* file} */ [verified] constexpr uint32_t GlobalConst_ctor = 0x004b76a0; // cdecl void (GlobalConst* g) [verified] constexpr uint32_t GlobalConst_Register = 0x004b7610; // cdecl void (int* storage, const char* text) [verified] constexpr uint32_t GlobalConst_ParseInt = 0x004b7000; // cdecl void (float* storage, const char* text) [verified] constexpr uint32_t GlobalConst_ParseFloat = 0x004b7020; // cdecl void (float* storage, const char* text) /* sscanf(%f) into *storage, then *storage = (float)((double)*storage * *(double*)0x00af5210) */ [verified] constexpr uint32_t GlobalConst_ParseFloatScaled = 0x004b70e0; // cdecl void (float rgba[4], const char* text) /* '%d %d %d %d', defaults 255, /255, clamp 0..1 */ [verified] constexpr uint32_t GlobalConst_ParseColour = 0x004b7110; // cdecl void (int rect[4], const char* text) /* '%d %d %d %d' (x y w h); 2 keys (COMBATSETUP_CARD_*_RECT); layout inferred from the M1 trace, int vs float unconfirmed */ [verified-by-trace] constexpr uint32_t GlobalConst_ParseRect = 0x004b7040; // cdecl void (float xyz[3], const char* text) /* '%f %f %f'; 5 keys (HIVER_SPAWN_*_GATE_HEIGHT / _SHIP_OFFSET ...); inferred from the M1 trace */ [verified-by-trace] constexpr uint32_t GlobalConst_ParseVec3 = 0x004b7080; // cdecl void (std::string* storage, const char* text) /* *storage = text; MSVC2010 std::string 0x18 bytes {+0 char buf[16] | char* ptr when capacity > 15, +0x10 size, +0x14 capacity}; 146 keys (*_NAME, *_SOUND, *_TEXTURENAME, DERELICT_SECTION_nn ...); seen in the M1 trace */ [verified-by-trace] constexpr uint32_t GlobalConst_ParseString = 0x004b7670; // cdecl void (void) /* called once from Application::Initialize; sets g_GlobalConstsLoaded */ [verified] constexpr uint32_t GlobalConsts_LoadAll = 0x004b76d0; // cdecl void (const char* file, GlobalConstMap* consts) /* consts = std::map of the keys registered for this file; MSVC2010 layout: map {+4 head node, +8 size}; node {+0 left, +4 parent, +8 right, +0xc const char* key, +0x10 GlobalConst*, +0x14 color, +0x15 isnil}; head: isnil=1, parent=root. Consumed keys are erased from the map. Hook this for the file-level read */ [verified] constexpr uint32_t GlobalConsts_LoadFile = 0x004b73c0; // data bool [verified] constexpr uint32_t g_GlobalConstsLoaded = 0x0072d740; // data std::map /* +4 (0x00b2d748) = header node pointer */ [verified] constexpr uint32_t g_GlobalConstRegistry = 0x0072d744; // data double /* pi/180 as a DOUBLE (0x3f91df46a2529d39); GlobalConst_ParseFloatScaled does float word *= this in x87 and stores float */ [verified] constexpr uint32_t g_GlobalConstFloatScale = 0x006f5210; // thiscall Script* (Script* this) /* sizeof(Script) = 0x28 */ [verified] constexpr uint32_t Script_ctor = 0x004cd700; // thiscall void (Script* this) [verified] constexpr uint32_t Script_dtor = 0x004cd720; // thiscall bool (Script* this, const char* path) /* gobio::ReadFile into this->buf */ [verified] constexpr uint32_t Script_Open = 0x004cd7d0; // thiscall void (Script* this) [verified] constexpr uint32_t Script_Close = 0x004cd6c0; // thiscall int (Script* this, char* out, uint outMax) /* 0 token, 1 no buffer/past end, 2 reached end */ [verified] constexpr uint32_t Script_ReadToken = 0x004cd2f0; // thiscall int (Script* this, ScriptToken* tok) /* tok: {int type; char key[1024]; char value[1024]}; type 1 kv, 2 block open, 3 '}' */ [verified] constexpr uint32_t Script_Next = 0x004cd3e0; // thiscall int (Script* this, int depth) /* 0 ok, nonzero EOF */ [verified] constexpr uint32_t Script_SkipBlock = 0x004cd4b0; // custom /* EAX=cursor, ECX="edFlag, EDX=out; stack: end, outEnd, &len — internal, do not hook */ [verified] constexpr uint32_t Script_ScanToken = 0x004cd1f0; // cdecl void (IConfigCallback* cb, const char* path, const char* blockName, bool* found) /* cb->vft[1](Script*) per matching block */ [verified] constexpr uint32_t ConfigParser_ParseFile = 0x004cd820; // fastcall int (IBuffer* obj) /* ECX=obj; --refcount, vft[0](1) at 0 */ [verified] constexpr uint32_t RefCounted_Release = 0x004a7230; // thiscall void (WeaponDictionary* this) /* reads Weapons/_weapons.txt manifest */ [verified] constexpr uint32_t WeaponDictionary_Init = 0x0019a4c0; // thiscall void (WeaponDictionary* this, const char* path, int id, WeaponDef** out) [verified] constexpr uint32_t WeaponDictionary_LoadWeapon = 0x0019a230; // thiscall WeaponDef* (WeaponDictionary* this, const char* name) /* _stricmp over def->name @+0x40 */ [verified] constexpr uint32_t WeaponDictionary_FindByName = 0x00190a10; // thiscall WeaponDef* (WeaponDictionary* this, const char* name) /* 'Weapon not found: "%s" - Was it added to the index file?' */ [verified] constexpr uint32_t WeaponDictionary_FindByNameSorted = 0x00191e30; // thiscall WeaponDef* (WeaponDef* this, int index, int id, const char* path) /* sizeof 0x278 */ [verified] constexpr uint32_t WeaponDef_ctor = 0x00198a20; // thiscall bool (WeaponDef* this, Script* script, int* rc, TechTree* tree) [verified] constexpr uint32_t WeaponDef_ParseScript = 0x00199070; // thiscall SectionDictionary* (SectionDictionary* this, TechTree* tree) /* reads Species//_shipsections.txt for species 0..6 */ [verified] constexpr uint32_t SectionDictionary_ctor = 0x00176f40; // thiscall SectionDef* (SectionDictionary* this, const char* path, int species, int id) [verified] constexpr uint32_t SectionDictionary_LoadSection = 0x00176cd0; // thiscall SectionDef* (SectionDef* this, int index, int species, int id) /* sizeof 0x3d8 */ [verified] constexpr uint32_t SectionDef_ctor = 0x00174020; // thiscall bool (SectionDef* this, Script* script, int* rc, TechTree* tree) [verified] constexpr uint32_t SectionDef_ParseScript = 0x001744e0; // cdecl const char* (uint species) [verified] constexpr uint32_t Species_GetDirName = 0x00145ec0; // thiscall MasterTechTree* (MasterTechTree* this) /* TechTree/MasterTechList.tech */ [verified] constexpr uint32_t MasterTechTree_ctor = 0x0018b870; // thiscall void (MasterTechTree* this, const char* path, int flag) [verified] constexpr uint32_t MasterTechTree_LoadTechFile = 0x0018b770; // thiscall void (MasterTechTree* this, Script* script, int flag) /* one tech{} block */ [verified] constexpr uint32_t MasterTechTree_ParseTech = 0x0018b050; // thiscall void (DemoApp* this) /* MasterTechTree -> +0x110, WeaponDictionary -> +0x118, SectionDictionary -> +0x114 */ [verified] constexpr uint32_t DemoApp_LoadGameData = 0x00499280; // thiscall void (DemoApp* this) /* once, from OnTick when this+0x10c is set */ [verified] constexpr uint32_t DemoApp_EnsureGameData = 0x00499870; // cdecl void (std::vector* mountPaths) [verified] constexpr uint32_t gobio_Init = 0x004d7010; // thiscall FileSystemSet* (FileSystemSet* this, std::vector* mounts) [verified] constexpr uint32_t gobio_FileSystemSet_ctor = 0x004d6d60; // thiscall bool (FileSystemSet* this, const char* path) [verified] constexpr uint32_t gobio_FileSystemSet_Open = 0x004d5060; // thiscall void (FileSystemSet* this, const char* pattern, std::vector* out) [verified] constexpr uint32_t gobio_FileSystemSet_ListFiles = 0x004d7090; // cdecl bool (const char* path, IBuffer** out) /* whole file by relative path; THE hook point for M4 */ [verified] constexpr uint32_t gobio_ReadFile = 0x004d5140; // cdecl bool (const char* path) [verified] constexpr uint32_t gobio_Open = 0x004d50d0; // cdecl void (void) [verified] constexpr uint32_t gobio_Close = 0x004d4d20; // cdecl uint (void) [verified] constexpr uint32_t gobio_Size = 0x004d4d50; // cdecl uint (void* dst, uint n) [verified] constexpr uint32_t gobio_Read = 0x004d4d80; // cdecl bool (const char* path) [verified] constexpr uint32_t gobio_Exists = 0x004d50f0; // cdecl void (const char* pattern, std::vector* out) [verified] constexpr uint32_t gobio_ListFiles = 0x004d71d0; // custom /* size in EBX, IBuffer** out on stack — internal, do not hook */ [verified] constexpr uint32_t gobio_Buffer_Create = 0x004d4c90; // thiscall void* (IBuffer* this) /* vft[1] and vft[2]; = this+8 */ [verified] constexpr uint32_t gobio_Buffer_Data = 0x00282d50; // thiscall uint (IBuffer* this) /* vft[3]; = this+0xc */ [verified] constexpr uint32_t gobio_Buffer_Size = 0x004d4c80; // thiscall NativeFileSystem* (NativeFileSystem* this, const char* root) /* sizeof 0x28; vtable 0x00a398ac */ [verified] constexpr uint32_t gobio_NativeFileSystem_ctor = 0x004d57a0; // thiscall bool (NativeFileSystem* this, const char* path) /* vft[1] fopen(root+path,'rb') */ [verified] constexpr uint32_t gobio_NativeFileSystem_Open = 0x004d4ef0; // thiscall uint (NativeFileSystem* this, void* dst, uint n) /* vft[4] */ [verified] constexpr uint32_t gobio_NativeFileSystem_Read = 0x004d4c30; // thiscall ZipFileSystem* (ZipFileSystem* this, const char* zipPath) /* sizeof 0x34; vtable 0x00a39934 */ [verified] constexpr uint32_t gobio_ZipFileSystem_ctor = 0x004d6c40; // thiscall bool (ZipFileSystem* this, const char* path) /* vft[1]; case- and slash-insensitive */ [verified] constexpr uint32_t gobio_ZipFileSystem_Open = 0x004d56a0; // thiscall uint (ZipFileSystem* this, void* dst, uint n) /* vft[4] */ [verified] constexpr uint32_t gobio_ZipFileSystem_Read = 0x004d4b40; // data FileSystemSet* /* -> 0x00b2e274 after gobio::Init */ [verified] constexpr uint32_t g_gobio = 0x0072e270; // data const char*[3] /* used when sots.ini has no [Modules] Mount; contains sots_local_en.gob, sots.gob */ [verified] constexpr uint32_t g_DefaultMountTable = 0x00635e98; // cdecl Stream* (const char* path) /* sniffs 'TXT' magic, returns a TextFileStream (0x420 bytes) opened for read */ [verified] constexpr uint32_t Stream_OpenFile = 0x004cfcb0; // thiscall TextFileStream* (TextFileStream* this) /* vtable 0x00a428c0 */ [verified] constexpr uint32_t TextFileStream_ctor = 0x0051e460; // thiscall bool (TextFileStream* this, const char* path, int mode /*1*/) [verified] constexpr uint32_t TextFileStream_Open = 0x004cfb90; // thiscall uint (Stream* this, char* out, int max) [verified] constexpr uint32_t FileStream_ReadLine = 0x004cfa30; // thiscall const char* (TextFileStream* this, const char* line, const char* label) /* NULL on END/mismatch */ [verified] constexpr uint32_t TextFileStream_MatchLabel = 0x0051e760; // thiscall bool (TextFileStream* this, const char* label, char* out, int outMax) /* vft[1] */ [verified] constexpr uint32_t TextFileStream_ReadString = 0x0051ec90; // thiscall bool (TextFileStream* this, const char* label, bool* out) /* vft[2] */ [verified] constexpr uint32_t TextFileStream_ReadBool = 0x0051eba0; // thiscall bool (TextFileStream* this, const char* label, float* out) /* vft[3] */ [verified] constexpr uint32_t TextFileStream_ReadFloat = 0x0051eb30; // thiscall bool (TextFileStream* this, const char* label, int* out, int dflt) /* vft[4] */ [verified] constexpr uint32_t TextFileStream_ReadInt = 0x0051eab0; // thiscall void (TextFileStream* this, const char* label, IStreamable* obj /*NULL=skip*/) /* vft[5]; BEGIN..END */ [verified] constexpr uint32_t TextFileStream_ReadNested = 0x0051e8e0; // thiscall void (ParticleSystem* this, Stream* s) /* .effect body */ [verified] constexpr uint32_t ParticleSystem_Read = 0x004db650; // thiscall void (ParticleSystem* this, Stream* s) [verified] constexpr uint32_t ParticleSystem_Write = 0x004dad60; // thiscall void* (EffectDictionary* this, const char* name) /* 'effects/' + name; Stream::OpenFile; 0x1c0-byte effect */ [unverified] constexpr uint32_t EffectDictionary_Load = 0x004b42b0; // cdecl void (Stream* s, const char* label, std::string* out, int flag) /* wrapper over vft[1] */ [verified] constexpr uint32_t Stream_ReadString = 0x004b9d90; // cdecl void (Stream* s, const char* label, int* out, int dflt) /* wrapper over vft[4] */ [verified] constexpr uint32_t Stream_ReadInt = 0x004b9d20; // cdecl void (Stream* s, const char* label, bool* out) /* wrapper over vft[2] */ [verified] constexpr uint32_t Stream_ReadBool = 0x004b9c00; // cdecl void (Stream* s, const char* label, float* out, int flag) /* wrapper over vft[3] */ [verified] constexpr uint32_t Stream_ReadFloat = 0x004b9bc0; // thiscall void (ServerPlayer* this, TechDef* def, bool silent) /* vft slot 4 of 0x00a327a4; hard-coded tech effects */ [verified] constexpr uint32_t ServerPlayer_OnTechResearched = 0x00491790; // thiscall bool (MasterTechTree* this, TechDef* def, int techId) /* techId = 10000+index into g_TechIdNames; 0xc5 = none */ [verified] constexpr uint32_t MasterTechTree_IsTech = 0x0017d5d0; // thiscall TechDef* (MasterTechTree* this, int techId) [verified] constexpr uint32_t MasterTechTree_GetTechDef = 0x0017d610; // thiscall bool (TechTree* this, int techId) [verified] constexpr uint32_t TechTree_HasResearched = 0x0017d810; // thiscall void (MasterTechTree* this) /* fills TechDef*[196] at this+0 from g_TechIdNames */ [verified] constexpr uint32_t MasterTechTree_ResolveTechIds = 0x00181c10; // cdecl int (std::string* name) /* membership in g_CombatTechNames (116) */ [verified] constexpr uint32_t IsCombatTechName = 0x002965c0; // fastcall void (ServerPlayer* this) /* flags[7] at +0x348 from SpeciesDef xnc tech ids */ [verified] constexpr uint32_t ServerPlayer_RebuildSpeciesTechFlags = 0x0042bf10; // thiscall void (ServerPlayer* this, TechDef* def) [verified] constexpr uint32_t ServerPlayer_ApplyAITechBonus = 0x0040e330; // thiscall void (ServerPlayer* this, bool on) [verified] constexpr uint32_t ServerPlayer_SetAIBenefit = 0x004186b0; // cdecl bool (TechDef* def, uint* maskOut) [verified] constexpr uint32_t TechDef_GetPlagueCureMask = 0x00137240; // cdecl uint* (uint out[2], TechTree* tree) /* EBX-passed tree in caller; tables 0x00adf378 / 0x00adf478 */ [unverified] constexpr uint32_t ComputeTechBitmasks = 0x000d7960; // cdecl SpeciesDef* (uint species) /* 0x00b10a00 + i*0x184 */ [verified] constexpr uint32_t SpeciesDef_Get = 0x00145cc0; // cdecl void (void) [verified] constexpr uint32_t SpeciesDef_InitTable = 0x001453a0; // fastcall void (ServerPlayer* this) [verified] constexpr uint32_t ServerPlayer_UpdateBankruptcyLimits = 0x00418600; // thiscall void (ServerPlayer* this, int level) [verified] constexpr uint32_t ServerPlayer_SetBankruptcyState = 0x0040e260; // fastcall int (ServerPlayer* this) [verified] constexpr uint32_t ServerPlayer_BankruptcyLevel = 0x0040db10; // cdecl double (double suit, double ideal, double tol) /* clamp01(1-|suit-ideal|/(tol+0.1)) */ [verified] constexpr uint32_t ServerSystem_HazardMod = 0x00347ae0; // thiscall double (ServerSystem* this, double tradePoints) /* RET 8 */ [verified] constexpr uint32_t ServerSystem_TradePointsToMoney = 0x003505b0; // thiscall double (ServerSystem* this, int species) [verified] constexpr uint32_t ServerSystem_CalcSuitMod = 0x003484d0; // fastcall void (ServerSystem* this) [verified] constexpr uint32_t ServerSystem_AccrueSystemBonus = 0x0034d4f0; // thiscall int (ServerSystem* this, float frac) [verified] constexpr uint32_t ServerSystem_SystemBonusPopTarget = 0x0034b5a0; // cdecl void (Vector3* posOut, bool* arrivedOut, float nodespeed, float dt, void* lines, Vector3* from, Vector3* to) [unverified] constexpr uint32_t NodeLine_Step = 0x00305510; // cdecl void (vector* segsOut, vector* systems, Vector3* from, Vector3* to) [unverified] constexpr uint32_t NodeLine_BuildStutterSegments = 0x00305280; // data struct { const char* name; int x; }[196] /* TechId = 10000+i */ [verified] constexpr uint32_t g_TechIdNames = 0x005ff9e4; // data const char*[116] [verified] constexpr uint32_t g_CombatTechNames = 0x00619718; // data SpeciesDef[7] (0x184 B each, .bss, filled by SpeciesDef_InitTable) [verified] constexpr uint32_t g_SpeciesDefTable = 0x00710a00; // data struct { int techId; uint bit; }[32] [verified] constexpr uint32_t g_TechBitmaskTableA = 0x006df378; // data struct { int techId; uint bit; }[29] [verified] constexpr uint32_t g_TechBitmaskTableB = 0x006df478; // data struct { int techId; int a; float value; }[6] /* values not dumped */ [unverified] constexpr uint32_t g_AITechValueTable = 0x00617888; // data int (config storage; PTR slot 0x00aedfe0) [verified] constexpr uint32_t g_PERGATETRAFFIC_DRV_TpGate = 0x00723e2c; // data int (config storage; PTR slot 0x00aedfe4) [verified] constexpr uint32_t g_PERGATETRAFFIC_DRV_GatAmp = 0x00723e30; } // namespace sots::addr