Files
sacred2_k/docs/modules.md
T
khallaandClaude Opus 5.5 8a7bdfd99f Framework for Sacred 2 Gold, game log mirror, borderless fullscreen
Ported from sacredK with module-relative addresses, hooks by exported
name and a SHA-256 check of the six game modules (Community Patch
2.65.1). Borderless windowed at monitor size replaces exclusive
fullscreen, whose focus loss during loading made the game quit and
crash on exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 01:39:44 +01:00

2.1 KiB

Game modules

Surveyed 2026-10-31 on Sacred 2 Gold (Steam) with Community Patch 2.65.1.

sacred2.exe (client, UI) statically imports the game DLLs, so all of them are mapped before our DLL's DllMain runs. All DLLs prefer image base 0x10000000 and none is ASLR-enabled; the loader relocates all but the first, so their running bases differ from Ghidra's. re::Address{module, va} holds the Ghidra VA and resolves it at runtime; sacred2K.log lists the running bases.

Module Role Exports Notes
sacred2.exe client: main loop, UI, input 1 image base 0x400000, sections .text .rdata .rdata .data .data .rdata .common .rsrc; "linker 4.0", PE date 2010 (modified by the Community Patch)
orcSystem.dll "Orc" engine base: Orc::String, Log, LogManager, files, timers, singletons 3231 2009-07
s2core.dll shared types: kernel events (cEvent*), world/sector positions, waypoints, type manager 1966
s2logic.dll game logic: creatures, items, quests, dialogs, factions, drops, balance (cLogicMgr, c*Mgr singletons) 5398
s2logicai.dll AI 176
s2render.dll renderer (D3D9, Granny, PhysX) 2258

Other modules, not in the build check yet: s2logicdll.dll, s2editor.dll, s2vista.dll, the plugin_*.dll set from plugins.cfg (file system, zip, particle FX, Bink, Miles, OpenAL; loaded at runtime), third-party libraries (granny2, binkw32, mss32, PhysX, stlport.5.0, MSVC 8 runtime). s2gs.exe is the dedicated server.

Toolchain: MSVC 8 (VS 2005), STLport 5.0 strings and containers, C++ classes exported with decorated names (?method@Class@@...), so most functions of the DLLs are named. tools/exports.mjs lists them; Ghidra demangles them.

Orc::String

STLport string with a 16-byte inline buffer, 0x18 bytes; see src/game/orc/string.h.

Data

pak\*.zip (graphics, sectors, sound), scripts\ (client/server/shared Lua-like text configs), locale\de_DE (German texts global.res, item name CSVs, speech). User options: %LOCALAPPDATA%\Ascaron Entertainment\Sacred 2\options.txt.