benilla-re systems structs docs

system objectlayer · source

objectlayer: initializers

The static initializers of the system's object files, which the C runtime runs through its initializer table 0x827000 before WinMain.

Each object file of the system has a run of initializers in the table, which opens with its +∞ (systems/README, Object files). An initializer is a thunk the table points at, a jmp or a call five bytes long, and a body at the next 16-byte boundary. Most bodies store one float computed from constants, the same 30 or so in every file that includes the shared header; the rest store copied constants, count the files that share a start-up hook, register exit callbacks, and build a few of the object manager's tables. Of the 984 globals the constant bodies write, 971 are read by no other code. Every thunk the table points at is a root; the roots below are each file's +∞ thunk.

Roots: 0x464190, 0x47bee0, 0x47c480, 0x47c9c0, 0x47cef0, 0x47d4d0, 0x47daa0, 0x47e070, 0x47e5b0, 0x47eaf0, 0x47f7d0, 0x5d3f40, 0x5d50e0, 0x5d6200, 0x5d79d0, 0x5d7f40, 0x5db700, 0x5f2f30, 0x5fa080, 0x613ad0, 0x61b130, 0x61ce90, 0x61ef10, 0x61f760, 0x621680, 0x621b70, 0x6220d0, 0x623000, 0x624350, 0x626430, 0x62ed00, 0x62f300, 0x62fbf0, 0x630240, 0x637df0

File names

The table gives the file of every slot: a run opens with its file's +∞ thunk and holds the file's initializers up to the next +∞ thunk. The file's own code lies between its thunks: 0x47c480 is the +∞ of the corpse field file, its 2π thunk is 0x47c4d0, and the functions 0x47c4a0 and 0x47c4b0 between them are the file's. Names are Init<File><Kind><n> for a body and Init<File><Kind><n>Thunk for its thunk (symbols/README). The kinds are Copy for the +∞ copy, Double, Quotient, Square, Product, Const, CountUnit and Other; <n> counts the file's bodies of the kind in table order.

Addresses: 0x47c480, 0x47c4a0, 0x47c4b0, 0x47c4d0 Confidence: verified Proof: one Test: none

Field file names

The field files and the manager, by their +∞ thunk: ObjMgr 0x464190, Guid 0x47bee0 (the 64-bit copy helpers), CorpseFields 0x47c480, DynObjFields 0x47c9c0, GameObjFields 0x47cef0, PlayerFields 0x47d4d0, UnitFields 0x47daa0, ContainerFields 0x47e070, ItemFields 0x47e5b0, ObjectFields 0x47eaf0 and Mirror 0x47f7d0 (the watcher tables).

Addresses: 0x464190, 0x47bee0, 0x47c480, 0x47c9c0, 0x47cef0, 0x47d4d0, 0x47daa0, 0x47e070, 0x47e5b0, 0x47eaf0, 0x47f7d0 Confidence: verified Proof: one Test: none

Object file names

The object files in link order: Trade 0x5d3f40, DynObj 0x5d50e0, Corpse 0x5d6200, Container 0x5d79d0, Item 0x5d7f40, Player 0x5db700, GameObj 0x5f2f30, Unit 0x5fa080, Object 0x613ad0, LootRoll 0x61b130, Missile 0x61ce90, MissileB 0x61ef10, Effect 0x61f760, EffectB 0x621680, GameObjTables 0x621b70, Bag 0x6220d0.

Addresses: 0x5d3f40, 0x5d50e0, 0x5d6200, 0x5d79d0, 0x5d7f40, 0x5db700, 0x5f2f30, 0x5fa080, 0x613ad0, 0x61b130, 0x61ce90, 0x61ef10, 0x61f760, 0x621680, 0x621b70, 0x6220d0 Confidence: verified Proof: one Test: none

The rest, to the log files: UnitSound 0x623000, UnitCombat 0x624350, CombatLog 0x626430, CombatLogC 0x62ed00, PlayerSound 0x62f300, ResistLog 0x62fbf0, CombatLogD 0x630240 and CombatLogXp 0x637df0. MissileB, EffectB, CombatLogC and CombatLogD have no source path; they take the name of the file before them and a letter. GameObjTables is the small file with the game object type tables (gameobjects).

Addresses: 0x623000, 0x624350, 0x626430, 0x62ed00, 0x62f300, 0x62fbf0, 0x630240, 0x637df0 Confidence: verified Proof: one Test: none

Initializer thunks

Each of these is the target of one slot of the C runtime's initializer table. A jmp thunk jumps to its body; a call thunk calls its body and jumps on to a function that registers the body's exit callback.

Addresses: 0x464190, 0x4641b0, 0x464250, 0x4642c0, 0x464f50, 0x464f70, 0x4694c0, 0x4694f0, 0x469520, 0x469550, 0x469580, 0x4695b0, 0x4695e0, 0x469610, 0x469640, 0x469670, 0x4696a0, 0x4696d0, 0x469700, 0x469730, 0x469750, 0x469780, 0x4697b0, 0x4697e0, 0x46a0c0, 0x46a0f0, 0x46a120, 0x46a150, 0x46a180, 0x46a1b0, 0x46a1e0, 0x46a210, 0x47bf90, 0x47bfb0, 0x47bfe0, 0x47c010, 0x47c040, 0x47c070, 0x47c0a0, 0x47c0d0, 0x47c100, 0x47c130, 0x47c160, 0x47c190, 0x47c1c0, 0x47c1f0, 0x47c220, 0x47c250, 0x47c270, 0x47c2a0, 0x47c2d0, 0x47c300, 0x47c330, 0x47c360, 0x47c390, 0x47c3c0, 0x47c3f0, 0x47c420, 0x47c450, 0x47c480, 0x47c4d0, 0x47c4f0, 0x47c520, 0x47c550, 0x47c580, 0x47c5b0, 0x47c5e0, 0x47c610, 0x47c640, 0x47c670, 0x47c6a0, 0x47c6d0, 0x47c700, 0x47c730, 0x47c760, 0x47c790, 0x47c7b0, 0x47c7e0, 0x47c810, 0x47c840, 0x47c870, 0x47c8a0, 0x47c8d0, 0x47c900, 0x47c930, 0x47c960, 0x47c990, 0x47c9c0, 0x47ca00, 0x47ca20, 0x47ca50, 0x47ca80, 0x47cab0, 0x47cae0, 0x47cb10, 0x47cb40, 0x47cb70, 0x47cba0, 0x47cbd0, 0x47cc00, 0x47cc30, 0x47cc60, 0x47cc90, 0x47ccc0, 0x47cce0, 0x47cd10, 0x47cd40, 0x47cd70, 0x47cda0, 0x47cdd0, 0x47ce00, 0x47ce30, 0x47ce60, 0x47ce90, 0x47cec0, 0x47cef0, 0x47cf10, 0x47cf30, 0x47d030, 0x47d060, 0x47d090, 0x47d0c0, 0x47d0f0, 0x47d120, 0x47d150, 0x47d180, 0x47d1b0, 0x47d1e0, 0x47d210, 0x47d240, 0x47d270, 0x47d2a0, 0x47d2c0, 0x47d2f0, 0x47d320, 0x47d350, 0x47d380, 0x47d3b0, 0x47d3e0, 0x47d410, 0x47d440, 0x47d470, 0x47d4a0, 0x47d4d0, 0x47d4f0, 0x47d510, 0x47d600, 0x47d630, 0x47d660, 0x47d690, 0x47d6c0, 0x47d6f0, 0x47d720, 0x47d750, 0x47d780, 0x47d7b0, 0x47d7e0, 0x47d810, 0x47d840, 0x47d870, 0x47d890, 0x47d8c0, 0x47d8f0, 0x47d920, 0x47d950, 0x47d980, 0x47d9b0, 0x47d9e0, 0x47da10, 0x47da40, 0x47da70, 0x47daa0, 0x47dac0, 0x47dae0, 0x47dbd0, 0x47dc00, 0x47dc30, 0x47dc60, 0x47dc90, 0x47dcc0, 0x47dcf0, 0x47dd20, 0x47dd50, 0x47dd80, 0x47ddb0, 0x47dde0, 0x47de10, 0x47de40, 0x47de60, 0x47de90, 0x47dec0, 0x47def0, 0x47df20, 0x47df50, 0x47df80, 0x47dfb0, 0x47dfe0, 0x47e010, 0x47e040, 0x47e070, 0x47e0c0, 0x47e0e0, 0x47e110, 0x47e140, 0x47e170, 0x47e1a0, 0x47e1d0, 0x47e200, 0x47e230, 0x47e260, 0x47e290, 0x47e2c0, 0x47e2f0, 0x47e320, 0x47e350, 0x47e380, 0x47e3a0, 0x47e3d0, 0x47e400, 0x47e430, 0x47e460, 0x47e490, 0x47e4c0, 0x47e4f0, 0x47e520, 0x47e550, 0x47e580, 0x47e5b0, 0x47e600, 0x47e620, 0x47e650, 0x47e680, 0x47e6b0, 0x47e6e0, 0x47e710, 0x47e740, 0x47e770, 0x47e7a0, 0x47e7d0, 0x47e800, 0x47e830, 0x47e860, 0x47e890, 0x47e8c0, 0x47e8e0, 0x47e910, 0x47e940, 0x47e970, 0x47e9a0, 0x47e9d0, 0x47ea00, 0x47ea30, 0x47ea60, 0x47ea90, 0x47eac0, 0x47eaf0, 0x47f2e0, 0x47f300, 0x47f330, 0x47f360, 0x47f390, 0x47f3c0, 0x47f3f0, 0x47f420, 0x47f450, 0x47f480, 0x47f4b0, 0x47f4e0, 0x47f510, 0x47f540, 0x47f570, 0x47f5a0, 0x47f5c0, 0x47f5f0, 0x47f620, 0x47f650, 0x47f680, 0x47f6b0, 0x47f6e0, 0x47f710, 0x47f740, 0x47f770, 0x47f7a0, 0x47f7d0, 0x47f7f0, 0x47f810, 0x5d3f40, 0x5d4ba0, 0x5d4bc0, 0x5d4bf0, 0x5d4c20, 0x5d4c50, 0x5d4c80, 0x5d4cb0, 0x5d4ce0, 0x5d4d10, 0x5d4d40, 0x5d4d90, 0x5d4dc0, 0x5d4df0, 0x5d4e20, 0x5d4e50, 0x5d4e80, 0x5d4eb0, 0x5d4ee0, 0x5d4f10, 0x5d4f40, 0x5d4f70, 0x5d4fa0, 0x5d4fd0, 0x5d5000, 0x5d5020, 0x5d5050, 0x5d5080, 0x5d50b0, 0x5d50e0, 0x5d59d0, 0x5d59f0, 0x5d5a20, 0x5d5a50, 0x5d5a80, 0x5d5ab0, 0x5d5ae0, 0x5d5b10, 0x5d5b40, 0x5d5b70, 0x5d5bc0, 0x5d5bf0, 0x5d5c20, 0x5d5c50, 0x5d5c80, 0x5d5cb0, 0x5d5ce0, 0x5d5d10, 0x5d5d40, 0x5d5d70, 0x5d5da0, 0x5d5dd0, 0x5d5e00, 0x5d5e30, 0x5d5e50, 0x5d5e80, 0x5d5eb0, 0x5d5ee0, 0x5d6200, 0x5d7150, 0x5d7170, 0x5d71a0, 0x5d71d0, 0x5d7200, 0x5d7230, 0x5d7260, 0x5d7290, 0x5d72c0, 0x5d72f0, 0x5d7340, 0x5d7370, 0x5d73a0, 0x5d73d0, 0x5d7400, 0x5d7430, 0x5d7460, 0x5d7490, 0x5d74c0, 0x5d74f0, 0x5d7520, 0x5d7550, 0x5d7580, 0x5d75b0, 0x5d75d0, 0x5d7600, 0x5d7630, 0x5d7660, 0x5d79d0, 0x5d79f0, 0x5d7a10, 0x5d7a40, 0x5d7a70, 0x5d7aa0, 0x5d7ad0, 0x5d7b00, 0x5d7b30, 0x5d7b60, 0x5d7b90, 0x5d7be0, 0x5d7c10, 0x5d7c40, 0x5d7c70, 0x5d7ca0, 0x5d7cd0, 0x5d7d00, 0x5d7d30, 0x5d7d60, 0x5d7d90, 0x5d7dc0, 0x5d7df0, 0x5d7e20, 0x5d7e50, 0x5d7e70, 0x5d7ea0, 0x5d7ed0, 0x5d7f00, 0x5d7f40, 0x5d7f60, 0x5d9c40, 0x5d9c90, 0x5dac30, 0x5dac60, 0x5dac90, 0x5dacc0, 0x5dacf0, 0x5db0a0, 0x5db0d0, 0x5db360, 0x5db3b0, 0x5db3e0, 0x5db410, 0x5db440, 0x5db470, 0x5db4a0, 0x5db4d0, 0x5db500, 0x5db530, 0x5db560, 0x5db590, 0x5db5c0, 0x5db5f0, 0x5db620, 0x5db640, 0x5db670, 0x5db6a0, 0x5db6d0, 0x5db700, 0x5db720, 0x5db740, 0x5db770, 0x5db7d0, 0x5db7f0, 0x5db840, 0x5db8a0, 0x5e0be0, 0x5e1fe0, 0x5efa30, 0x5efa60, 0x5efa90, 0x5efb80, 0x5efca0, 0x5f0df0, 0x5f0e20, 0x5f1290, 0x5f12e0, 0x5f1310, 0x5f1340, 0x5f1370, 0x5f13a0, 0x5f13d0, 0x5f1400, 0x5f1430, 0x5f1460, 0x5f1490, 0x5f14c0, 0x5f14f0, 0x5f1520, 0x5f1550, 0x5f1570, 0x5f15a0, 0x5f15d0, 0x5f1600, 0x5f2f30, 0x5f36d0, 0x5f4550, 0x5f4570, 0x5f8f90, 0x5f8fc0, 0x5f8ff0, 0x5f9020, 0x5f9050, 0x5f9080, 0x5f90b0, 0x5f9640, 0x5f9690, 0x5f96c0, 0x5f96f0, 0x5f9720, 0x5f9750, 0x5f9780, 0x5f97b0, 0x5f97e0, 0x5f9810, 0x5f9840, 0x5f9870, 0x5f98a0, 0x5f98d0, 0x5f9900, 0x5f9920, 0x5f9950, 0x5f9980, 0x5f99b0, 0x5fa080, 0x5fa0a0, 0x5fa0e0, 0x5fa120, 0x5fa150, 0x5fa190, 0x5fa290, 0x5fa390, 0x5fa3b0, 0x5fa3e0, 0x5fa420, 0x5fa4b0, 0x5fa500, 0x60d570, 0x60d5a0, 0x60d760, 0x60d790, 0x60dc30, 0x60e580, 0x60e670, 0x60e6a0, 0x60e6d0, 0x60e700, 0x60e730, 0x60e760, 0x6122f0, 0x6123c0, 0x613250, 0x6132a0, 0x6132d0, 0x613300, 0x613330, 0x613360, 0x613390, 0x6133c0, 0x6133f0, 0x613420, 0x613450, 0x613480, 0x6134b0, 0x6134e0, 0x613510, 0x613530, 0x613560, 0x613590, 0x6135c0, 0x613ad0, 0x61b150, 0x61c680, 0x61c6a0, 0x61c700, 0x61c730, 0x61c760, 0x61c790, 0x61c7c0, 0x61c7f0, 0x61c820, 0x61c850, 0x61c8a0, 0x61c8d0, 0x61c900, 0x61c930, 0x61c960, 0x61c990, 0x61c9c0, 0x61c9f0, 0x61ca20, 0x61ca50, 0x61ca80, 0x61cab0, 0x61cae0, 0x61cb10, 0x61cb30, 0x61cb60, 0x61cb90, 0x61cbc0, 0x61ce90, 0x61e970, 0x61e990, 0x61e9d0, 0x61ea00, 0x61ea30, 0x61ea60, 0x61ea90, 0x61eac0, 0x61eaf0, 0x61eb20, 0x61eb70, 0x61eba0, 0x61ebd0, 0x61ec00, 0x61ec30, 0x61ec60, 0x61ec90, 0x61ecc0, 0x61ecf0, 0x61ed20, 0x61ed50, 0x61ed80, 0x61edb0, 0x61ede0, 0x61ee00, 0x61ee30, 0x61ee60, 0x61ee90, 0x61ef10, 0x61ef30, 0x61ef50, 0x61ef80, 0x61efb0, 0x61efe0, 0x61f010, 0x61f040, 0x61f070, 0x61f0a0, 0x61f0d0, 0x61f120, 0x61f150, 0x61f180, 0x61f1b0, 0x61f1e0, 0x61f210, 0x61f240, 0x61f270, 0x61f2a0, 0x61f2d0, 0x61f300, 0x61f330, 0x61f360, 0x61f390, 0x61f3b0, 0x61f3e0, 0x61f410, 0x61f440, 0x61f760, 0x621110, 0x621130, 0x621190, 0x6211c0, 0x6211f0, 0x621220, 0x621250, 0x621280, 0x6212b0, 0x6212e0, 0x621330, 0x621360, 0x621390, 0x6213c0, 0x6213f0, 0x621420, 0x621450, 0x621480, 0x6214b0, 0x6214e0, 0x621510, 0x621540, 0x621570, 0x6215a0, 0x6215c0, 0x6215f0, 0x621620, 0x621650, 0x621680, 0x6216a0, 0x6216d0, 0x621700, 0x621730, 0x621760, 0x621790, 0x6217c0, 0x6217f0, 0x621820, 0x621850, 0x621880, 0x6218b0, 0x6218e0, 0x621910, 0x621930, 0x621960, 0x621990, 0x6219c0, 0x621b70, 0x621b90, 0x621bb0, 0x621be0, 0x621c10, 0x621c40, 0x621c70, 0x621ca0, 0x621cd0, 0x621d00, 0x621d30, 0x621d80, 0x621db0, 0x621de0, 0x621e10, 0x621e40, 0x621e70, 0x621ea0, 0x621ed0, 0x621f00, 0x621f30, 0x621f60, 0x621f90, 0x621fc0, 0x621ff0, 0x622010, 0x622040, 0x622070, 0x6220a0, 0x6220d0, 0x622a50, 0x622a70, 0x622aa0, 0x622ad0, 0x622b00, 0x622b30, 0x622b60, 0x622b90, 0x622bc0, 0x622bf0, 0x622c40, 0x622c70, 0x622ca0, 0x622cd0, 0x622d00, 0x622d30, 0x622d60, 0x622d90, 0x622dc0, 0x622df0, 0x622e20, 0x622e50, 0x622e80, 0x622eb0, 0x622ed0, 0x622f00, 0x622f30, 0x622f60, 0x622f90, 0x623000, 0x623d40, 0x623d60, 0x623e60, 0x623e90, 0x623ec0, 0x623ef0, 0x623f20, 0x623f50, 0x623f80, 0x623fb0, 0x624000, 0x624030, 0x624060, 0x624090, 0x6240c0, 0x6240f0, 0x624120, 0x624150, 0x624180, 0x6241b0, 0x6241e0, 0x624210, 0x624240, 0x624270, 0x624290, 0x6242c0, 0x6242f0, 0x624320, 0x624350, 0x625e60, 0x625e80, 0x625eb0, 0x625ee0, 0x625f10, 0x625f40, 0x625f70, 0x625fa0, 0x625fd0, 0x626000, 0x626050, 0x626080, 0x6260b0, 0x6260e0, 0x626110, 0x626140, 0x626170, 0x6261a0, 0x6261d0, 0x626200, 0x626230, 0x626260, 0x626290, 0x6262c0, 0x6262e0, 0x626310, 0x626340, 0x626370, 0x626430, 0x626450, 0x626cb0, 0x626cd0, 0x62e430, 0x62e460, 0x62e490, 0x62e4c0, 0x62e4f0, 0x62e520, 0x62e550, 0x62e620, 0x62e670, 0x62e6a0, 0x62e6d0, 0x62e700, 0x62e730, 0x62e760, 0x62e790, 0x62e7c0, 0x62e7f0, 0x62e820, 0x62e850, 0x62e880, 0x62e8b0, 0x62e8e0, 0x62e900, 0x62e930, 0x62e960, 0x62e990, 0x62ed00, 0x62ed20, 0x62ed40, 0x62ed70, 0x62eda0, 0x62edd0, 0x62ee00, 0x62ee30, 0x62ee60, 0x62ee90, 0x62eec0, 0x62ef10, 0x62ef40, 0x62ef70, 0x62efa0, 0x62efd0, 0x62f000, 0x62f030, 0x62f060, 0x62f090, 0x62f0c0, 0x62f0f0, 0x62f120, 0x62f150, 0x62f180, 0x62f1a0, 0x62f1d0, 0x62f200, 0x62f230, 0x62f300, 0x62f320, 0x62f340, 0x62f370, 0x62f3a0, 0x62f3d0, 0x62f400, 0x62f430, 0x62f460, 0x62f490, 0x62f4c0, 0x62f510, 0x62f540, 0x62f570, 0x62f5a0, 0x62f5d0, 0x62f600, 0x62f630, 0x62f660, 0x62f690, 0x62f6c0, 0x62f6f0, 0x62f720, 0x62f750, 0x62f780, 0x62f7a0, 0x62f7d0, 0x62f800, 0x62f830, 0x62fbf0, 0x62fc10, 0x62fc30, 0x62fc60, 0x62fc90, 0x62fcc0, 0x62fcf0, 0x62fd20, 0x62fd50, 0x62fd80, 0x62fdb0, 0x62fe00, 0x62fe30, 0x62fe60, 0x62fe90, 0x62fec0, 0x62fef0, 0x62ff20, 0x62ff50, 0x62ff80, 0x62ffb0, 0x62ffe0, 0x630010, 0x630040, 0x630070, 0x630090, 0x6300c0, 0x6300f0, 0x630120, 0x630240, 0x630260, 0x630280, 0x6302b0, 0x6302e0, 0x630310, 0x630340, 0x630370, 0x6303a0, 0x6303d0, 0x630400, 0x630450, 0x630480, 0x6304b0, 0x6304e0, 0x630510, 0x630540, 0x630570, 0x6305a0, 0x6305d0, 0x630600, 0x630630, 0x630660, 0x630690, 0x6306c0, 0x6306e0, 0x630710, 0x630740, 0x630770, 0x637df0, 0x637fc0, 0x637fe0, 0x638010, 0x638040, 0x638070, 0x6380a0, 0x6380d0, 0x638100, 0x638130, 0x638160, 0x6381b0, 0x6381e0, 0x638210, 0x638240, 0x638270, 0x6382a0, 0x6382d0, 0x638300, 0x638330, 0x638360, 0x638390, 0x6383c0, 0x6383f0, 0x638420, 0x638440, 0x638470, 0x6384a0, 0x6384d0, 0x6151f0, 0x615210, 0x615240, 0x615270, 0x6152a0, 0x6152d0, 0x615300, 0x615330, 0x615360, 0x615390, 0x6153e0, 0x615410, 0x615440, 0x615470, 0x6154a0, 0x6154d0, 0x615500, 0x615530, 0x615560, 0x615590, 0x6155c0, 0x6155f0, 0x615620, 0x615650, 0x615670, 0x6156a0, 0x6156d0, 0x615700, 0x61b130, 0x47bee0, 0x47fee0, 0x47ff10, 0x47ff40, 0x47ff70, 0x47ffa0, 0x47ffd0, 0x480000, 0x480030, 0x480060, 0x480090, 0x4800c0, 0x4800f0, 0x480120, 0x480150, 0x480170, 0x4801a0, 0x4801d0, 0x480200, 0x480230, 0x480260, 0x480290, 0x4802c0, 0x4802f0, 0x480320, 0x480350 Confidence: verified Proof: one Test: none

The census takes every dword of the table from 0x827004 to its end that points into the system's object files: 1,027, each an instruction e9 (a jmp, 983) or e8 (a call followed by a jmp, 44) whose target is the body at the next 16-byte boundary. A typical pair is 0x5d3f40, jmp 0x5d3f50, and 0x5d3f50, which copies a constant and returns.

Float constants

These bodies store one float each: a constant squared, a product or quotient of two constants, or π doubled. The values, in the order the table runs them, with each operand read from its address at that point, are the meanings of their rows. The client's 53-bit precision makes each product of two floats exact before the store rounds it to a float; a quotient rounds twice.

Addresses: 0x464f60, 0x464f80, 0x4694d0, 0x469500, 0x469530, 0x469560, 0x469590, 0x4695c0, 0x4695f0, 0x469620, 0x469650, 0x469680, 0x4696b0, 0x4696e0, 0x469710, 0x469760, 0x469790, 0x4697c0, 0x4697f0, 0x46a0d0, 0x46a100, 0x46a130, 0x46a160, 0x46a190, 0x46a1c0, 0x46a1f0, 0x47bfa0, 0x47bfc0, 0x47bff0, 0x47c020, 0x47c050, 0x47c080, 0x47c0b0, 0x47c0e0, 0x47c110, 0x47c140, 0x47c170, 0x47c1a0, 0x47c1d0, 0x47c200, 0x47c230, 0x47c280, 0x47c2b0, 0x47c2e0, 0x47c310, 0x47c340, 0x47c370, 0x47c3a0, 0x47c3d0, 0x47c400, 0x47c430, 0x47c460, 0x47c4e0, 0x47c500, 0x47c530, 0x47c560, 0x47c590, 0x47c5c0, 0x47c5f0, 0x47c620, 0x47c650, 0x47c680, 0x47c6b0, 0x47c6e0, 0x47c710, 0x47c740, 0x47c770, 0x47c7c0, 0x47c7f0, 0x47c820, 0x47c850, 0x47c880, 0x47c8b0, 0x47c8e0, 0x47c910, 0x47c940, 0x47c970, 0x47c9a0, 0x47ca10, 0x47ca30, 0x47ca60, 0x47ca90, 0x47cac0, 0x47caf0, 0x47cb20, 0x47cb50, 0x47cb80, 0x47cbb0, 0x47cbe0, 0x47cc10, 0x47cc40, 0x47cc70, 0x47cca0, 0x47ccf0, 0x47cd20, 0x47cd50, 0x47cd80, 0x47cdb0, 0x47cde0, 0x47ce10, 0x47ce40, 0x47ce70, 0x47cea0, 0x47ced0, 0x47cf20, 0x47cf40, 0x47d040, 0x47d070, 0x47d0a0, 0x47d0d0, 0x47d100, 0x47d130, 0x47d160, 0x47d190, 0x47d1c0, 0x47d1f0, 0x47d220, 0x47d250, 0x47d280, 0x47d2d0, 0x47d300, 0x47d330, 0x47d360, 0x47d390, 0x47d3c0, 0x47d3f0, 0x47d420, 0x47d450, 0x47d480, 0x47d4b0, 0x47d500, 0x47d520, 0x47d610, 0x47d640, 0x47d670, 0x47d6a0, 0x47d6d0, 0x47d700, 0x47d730, 0x47d760, 0x47d790, 0x47d7c0, 0x47d7f0, 0x47d820, 0x47d850, 0x47d8a0, 0x47d8d0, 0x47d900, 0x47d930, 0x47d960, 0x47d990, 0x47d9c0, 0x47d9f0, 0x47da20, 0x47da50, 0x47da80, 0x47dad0, 0x47daf0, 0x47dbe0, 0x47dc10, 0x47dc40, 0x47dc70, 0x47dca0, 0x47dcd0, 0x47dd00, 0x47dd30, 0x47dd60, 0x47dd90, 0x47ddc0, 0x47ddf0, 0x47de20, 0x47de70, 0x47dea0, 0x47ded0, 0x47df00, 0x47df30, 0x47df60, 0x47df90, 0x47dfc0, 0x47dff0, 0x47e020, 0x47e050, 0x47e0d0, 0x47e0f0, 0x47e120, 0x47e150, 0x47e180, 0x47e1b0, 0x47e1e0, 0x47e210, 0x47e240, 0x47e270, 0x47e2a0, 0x47e2d0, 0x47e300, 0x47e330, 0x47e360, 0x47e3b0, 0x47e3e0, 0x47e410, 0x47e440, 0x47e470, 0x47e4a0, 0x47e4d0, 0x47e500, 0x47e530, 0x47e560, 0x47e590, 0x47e610, 0x47e630, 0x47e660, 0x47e690, 0x47e6c0, 0x47e6f0, 0x47e720, 0x47e750, 0x47e780, 0x47e7b0, 0x47e7e0, 0x47e810, 0x47e840, 0x47e870, 0x47e8a0, 0x47e8f0, 0x47e920, 0x47e950, 0x47e980, 0x47e9b0, 0x47e9e0, 0x47ea10, 0x47ea40, 0x47ea70, 0x47eaa0, 0x47ead0, 0x47f2f0, 0x47f310, 0x47f340, 0x47f370, 0x47f3a0, 0x47f3d0, 0x47f400, 0x47f430, 0x47f460, 0x47f490, 0x47f4c0, 0x47f4f0, 0x47f520, 0x47f550, 0x47f580, 0x47f5d0, 0x47f600, 0x47f630, 0x47f660, 0x47f690, 0x47f6c0, 0x47f6f0, 0x47f720, 0x47f750, 0x47f780, 0x47f7b0, 0x47f800, 0x47f820, 0x5d4bb0, 0x5d4bd0, 0x5d4c00, 0x5d4c30, 0x5d4c60, 0x5d4c90, 0x5d4cc0, 0x5d4cf0, 0x5d4d20, 0x5d4da0, 0x5d4dd0, 0x5d4e00, 0x5d4e30, 0x5d4e60, 0x5d4e90, 0x5d4ec0, 0x5d4ef0, 0x5d4f20, 0x5d4f50, 0x5d4f80, 0x5d4fb0, 0x5d4fe0, 0x5d5030, 0x5d5060, 0x5d5090, 0x5d50c0, 0x5d59e0, 0x5d5a00, 0x5d5a30, 0x5d5a60, 0x5d5a90, 0x5d5ac0, 0x5d5af0, 0x5d5b20, 0x5d5b50, 0x5d5bd0, 0x5d5c00, 0x5d5c30, 0x5d5c60, 0x5d5c90, 0x5d5cc0, 0x5d5cf0, 0x5d5d20, 0x5d5d50, 0x5d5d80, 0x5d5db0, 0x5d5de0, 0x5d5e10, 0x5d5e60, 0x5d5e90, 0x5d5ec0, 0x5d5ef0, 0x5d7160, 0x5d7180, 0x5d71b0, 0x5d71e0, 0x5d7210, 0x5d7240, 0x5d7270, 0x5d72a0, 0x5d72d0, 0x5d7350, 0x5d7380, 0x5d73b0, 0x5d73e0, 0x5d7410, 0x5d7440, 0x5d7470, 0x5d74a0, 0x5d74d0, 0x5d7500, 0x5d7530, 0x5d7560, 0x5d7590, 0x5d75e0, 0x5d7610, 0x5d7640, 0x5d7670, 0x5d7a00, 0x5d7a20, 0x5d7a50, 0x5d7a80, 0x5d7ab0, 0x5d7ae0, 0x5d7b10, 0x5d7b40, 0x5d7b70, 0x5d7bf0, 0x5d7c20, 0x5d7c50, 0x5d7c80, 0x5d7cb0, 0x5d7ce0, 0x5d7d10, 0x5d7d40, 0x5d7d70, 0x5d7da0, 0x5d7dd0, 0x5d7e00, 0x5d7e30, 0x5d7e80, 0x5d7eb0, 0x5d7ee0, 0x5d7f10, 0x5d9c50, 0x5d9ca0, 0x5dac40, 0x5dac70, 0x5daca0, 0x5dacd0, 0x5dad00, 0x5db0b0, 0x5db0e0, 0x5db3c0, 0x5db3f0, 0x5db420, 0x5db450, 0x5db480, 0x5db4b0, 0x5db4e0, 0x5db510, 0x5db540, 0x5db570, 0x5db5a0, 0x5db5d0, 0x5db600, 0x5db650, 0x5db680, 0x5db6b0, 0x5db6e0, 0x5db730, 0x5db750, 0x5efa40, 0x5efa70, 0x5efaa0, 0x5efb90, 0x5efcb0, 0x5f0e00, 0x5f0e30, 0x5f12f0, 0x5f1320, 0x5f1350, 0x5f1380, 0x5f13b0, 0x5f13e0, 0x5f1410, 0x5f1440, 0x5f1470, 0x5f14a0, 0x5f14d0, 0x5f1500, 0x5f1530, 0x5f1580, 0x5f15b0, 0x5f15e0, 0x5f1610, 0x5f4560, 0x5f4580, 0x5f8fa0, 0x5f8fd0, 0x5f9000, 0x5f9030, 0x5f9060, 0x5f9090, 0x5f90c0, 0x5f96a0, 0x5f96d0, 0x5f9700, 0x5f9730, 0x5f9760, 0x5f9790, 0x5f97c0, 0x5f97f0, 0x5f9820, 0x5f9850, 0x5f9880, 0x5f98b0, 0x5f98e0, 0x5f9930, 0x5f9960, 0x5f9990, 0x5f99c0, 0x5fa130, 0x5fa3a0, 0x5fa3c0, 0x60d580, 0x60d5b0, 0x60d770, 0x60d7a0, 0x60dc40, 0x60e680, 0x60e6b0, 0x60e6e0, 0x60e710, 0x60e740, 0x60e770, 0x612300, 0x6123d0, 0x6132b0, 0x6132e0, 0x613310, 0x613340, 0x613370, 0x6133a0, 0x6133d0, 0x613400, 0x613430, 0x613460, 0x613490, 0x6134c0, 0x6134f0, 0x613540, 0x613570, 0x6135a0, 0x6135d0, 0x61c690, 0x61c6b0, 0x61c710, 0x61c740, 0x61c770, 0x61c7a0, 0x61c7d0, 0x61c800, 0x61c830, 0x61c8b0, 0x61c8e0, 0x61c910, 0x61c940, 0x61c970, 0x61c9a0, 0x61c9d0, 0x61ca00, 0x61ca30, 0x61ca60, 0x61ca90, 0x61cac0, 0x61caf0, 0x61cb40, 0x61cb70, 0x61cba0, 0x61cbd0, 0x61e980, 0x61e9a0, 0x61e9e0, 0x61ea10, 0x61ea40, 0x61ea70, 0x61eaa0, 0x61ead0, 0x61eb00, 0x61eb80, 0x61ebb0, 0x61ebe0, 0x61ec10, 0x61ec40, 0x61ec70, 0x61eca0, 0x61ecd0, 0x61ed00, 0x61ed30, 0x61ed60, 0x61ed90, 0x61edc0, 0x61ee10, 0x61ee40, 0x61ee70, 0x61eea0, 0x61ef40, 0x61ef60, 0x61ef90, 0x61efc0, 0x61eff0, 0x61f020, 0x61f050, 0x61f080, 0x61f0b0, 0x61f130, 0x61f160, 0x61f190, 0x61f1c0, 0x61f1f0, 0x61f220, 0x61f250, 0x61f280, 0x61f2b0, 0x61f2e0, 0x61f310, 0x61f340, 0x61f370, 0x61f3c0, 0x61f3f0, 0x61f420, 0x61f450, 0x621120, 0x621140, 0x6211a0, 0x6211d0, 0x621200, 0x621230, 0x621260, 0x621290, 0x6212c0, 0x621340, 0x621370, 0x6213a0, 0x6213d0, 0x621400, 0x621430, 0x621460, 0x621490, 0x6214c0, 0x6214f0, 0x621520, 0x621550, 0x621580, 0x6215d0, 0x621600, 0x621630, 0x621660, 0x6216b0, 0x6216e0, 0x621710, 0x621740, 0x621770, 0x6217a0, 0x6217d0, 0x621800, 0x621830, 0x621860, 0x621890, 0x6218c0, 0x6218f0, 0x621940, 0x621970, 0x6219a0, 0x6219d0, 0x621ba0, 0x621bc0, 0x621bf0, 0x621c20, 0x621c50, 0x621c80, 0x621cb0, 0x621ce0, 0x621d10, 0x621d90, 0x621dc0, 0x621df0, 0x621e20, 0x621e50, 0x621e80, 0x621eb0, 0x621ee0, 0x621f10, 0x621f40, 0x621f70, 0x621fa0, 0x621fd0, 0x622020, 0x622050, 0x622080, 0x6220b0, 0x622a60, 0x622a80, 0x622ab0, 0x622ae0, 0x622b10, 0x622b40, 0x622b70, 0x622ba0, 0x622bd0, 0x622c50, 0x622c80, 0x622cb0, 0x622ce0, 0x622d10, 0x622d40, 0x622d70, 0x622da0, 0x622dd0, 0x622e00, 0x622e30, 0x622e60, 0x622e90, 0x622ee0, 0x622f10, 0x622f40, 0x622f70, 0x623d50, 0x623d70, 0x623e70, 0x623ea0, 0x623ed0, 0x623f00, 0x623f30, 0x623f60, 0x623f90, 0x624010, 0x624040, 0x624070, 0x6240a0, 0x6240d0, 0x624100, 0x624130, 0x624160, 0x624190, 0x6241c0, 0x6241f0, 0x624220, 0x624250, 0x6242a0, 0x6242d0, 0x624300, 0x624330, 0x625e70, 0x625e90, 0x625ec0, 0x625ef0, 0x625f20, 0x625f50, 0x625f80, 0x625fb0, 0x625fe0, 0x626060, 0x626090, 0x6260c0, 0x6260f0, 0x626120, 0x626150, 0x626180, 0x6261b0, 0x6261e0, 0x626210, 0x626240, 0x626270, 0x6262a0, 0x6262f0, 0x626320, 0x626350, 0x626380, 0x626cc0, 0x626ce0, 0x62e440, 0x62e470, 0x62e4a0, 0x62e4d0, 0x62e500, 0x62e530, 0x62e560, 0x62e680, 0x62e6b0, 0x62e6e0, 0x62e710, 0x62e740, 0x62e770, 0x62e7a0, 0x62e7d0, 0x62e800, 0x62e830, 0x62e860, 0x62e890, 0x62e8c0, 0x62e910, 0x62e940, 0x62e970, 0x62e9a0, 0x62ed30, 0x62ed50, 0x62ed80, 0x62edb0, 0x62ede0, 0x62ee10, 0x62ee40, 0x62ee70, 0x62eea0, 0x62ef20, 0x62ef50, 0x62ef80, 0x62efb0, 0x62efe0, 0x62f010, 0x62f040, 0x62f070, 0x62f0a0, 0x62f0d0, 0x62f100, 0x62f130, 0x62f160, 0x62f1b0, 0x62f1e0, 0x62f210, 0x62f240, 0x62f330, 0x62f350, 0x62f380, 0x62f3b0, 0x62f3e0, 0x62f410, 0x62f440, 0x62f470, 0x62f4a0, 0x62f520, 0x62f550, 0x62f580, 0x62f5b0, 0x62f5e0, 0x62f610, 0x62f640, 0x62f670, 0x62f6a0, 0x62f6d0, 0x62f700, 0x62f730, 0x62f760, 0x62f7b0, 0x62f7e0, 0x62f810, 0x62f840, 0x62fc20, 0x62fc40, 0x62fc70, 0x62fca0, 0x62fcd0, 0x62fd00, 0x62fd30, 0x62fd60, 0x62fd90, 0x62fe10, 0x62fe40, 0x62fe70, 0x62fea0, 0x62fed0, 0x62ff00, 0x62ff30, 0x62ff60, 0x62ff90, 0x62ffc0, 0x62fff0, 0x630020, 0x630050, 0x6300a0, 0x6300d0, 0x630100, 0x630130, 0x630270, 0x630290, 0x6302c0, 0x6302f0, 0x630320, 0x630350, 0x630380, 0x6303b0, 0x6303e0, 0x630460, 0x630490, 0x6304c0, 0x6304f0, 0x630520, 0x630550, 0x630580, 0x6305b0, 0x6305e0, 0x630610, 0x630640, 0x630670, 0x6306a0, 0x6306f0, 0x630720, 0x630750, 0x630780, 0x637fd0, 0x637ff0, 0x638020, 0x638050, 0x638080, 0x6380b0, 0x6380e0, 0x638110, 0x638140, 0x6381c0, 0x6381f0, 0x638220, 0x638250, 0x638280, 0x6382b0, 0x6382e0, 0x638310, 0x638340, 0x638370, 0x6383a0, 0x6383d0, 0x638400, 0x638450, 0x638480, 0x6384b0, 0x6384e0, 0x615200, 0x615220, 0x615250, 0x615280, 0x6152b0, 0x6152e0, 0x615310, 0x615340, 0x615370, 0x6153f0, 0x615420, 0x615450, 0x615480, 0x6154b0, 0x6154e0, 0x615510, 0x615540, 0x615570, 0x6155a0, 0x6155d0, 0x615600, 0x615630, 0x615680, 0x6156b0, 0x6156e0, 0x615710, 0x47fef0, 0x47ff20, 0x47ff50, 0x47ff80, 0x47ffb0, 0x47ffe0, 0x480010, 0x480040, 0x480070, 0x4800a0, 0x4800d0, 0x480100, 0x480130, 0x480180, 0x4801b0, 0x4801e0, 0x480210, 0x480240, 0x480270, 0x4802a0, 0x4802d0, 0x480300, 0x480330, 0x480360 Confidence: verified Proof: one Test: none

Each body is fld [a]; fmul [b] (or fdiv [b], or fadd st,st), fstp [g]; ret, 19 or 15 bytes. A quotient's divisor can be a global an earlier body of the same file stored, as 0x464f80 divides 1 by the 2π that 0x464f60 stored first; the evaluation runs the bodies in table order and reads such a global as stored. A scan of the whole image for each written global's address as a dword, outside the initializers themselves, finds a reader for 13 of the 984 globals the float, copy and store bodies write (0xc4c28c by Player_C.cpp code among them), and none for the rest.

Stored constants

These bodies copy one dword from a constant, +inf as a float in every file, or store an immediate: 5.0 as a float in every file, and a few file-specific values.

Addresses: 0x4641a0, 0x469740, 0x47c260, 0x47c490, 0x47c7a0, 0x47c9d0, 0x47ccd0, 0x47cf00, 0x47d2b0, 0x47d4e0, 0x47d880, 0x47dab0, 0x47de50, 0x47e080, 0x47e390, 0x47e5c0, 0x47e8d0, 0x47eb00, 0x47f5b0, 0x47f7e0, 0x5d3f50, 0x5d5010, 0x5d50f0, 0x5d5e40, 0x5d6210, 0x5d75c0, 0x5d79e0, 0x5d7e60, 0x5d7f50, 0x5db630, 0x5db710, 0x5db7e0, 0x5f1560, 0x5f2f40, 0x5f36e0, 0x5f3730, 0x5f9910, 0x5fa090, 0x5fa0b0, 0x5fa0f0, 0x5fa160, 0x5fa3f0, 0x613520, 0x613ae0, 0x61cb20, 0x61cea0, 0x61edf0, 0x61ef20, 0x61f3a0, 0x61f770, 0x6215b0, 0x621690, 0x621920, 0x621b80, 0x622000, 0x6220e0, 0x622ec0, 0x623010, 0x624280, 0x624360, 0x6262d0, 0x626440, 0x62e8f0, 0x62ed10, 0x62f190, 0x62f310, 0x62f790, 0x62fc00, 0x630080, 0x630250, 0x6306d0, 0x637e00, 0x638430, 0x615660, 0x61b140, 0x47bef0, 0x480160 Confidence: verified Proof: one Test: none

A copy is mov eax,[c]; mov [g],eax; ret, 11 bytes, the constant 0x7f800000; a store is mov dword [g],imm; ret.

Start-up counts

Each object file that includes the shared header counts itself in a global count shared with files across the client, 124 sites in all: the first file to run calls the empty hook 0x5b71c0; at exit each file uncounts itself, and the last calls the empty hook 0x5b71d0.

Addresses: 0x46a220, 0x46a250, 0x5d4d50, 0x5d4d80, 0x5d5b80, 0x5d5bb0, 0x5d7300, 0x5d7330, 0x5d7ba0, 0x5d7bd0, 0x5db370, 0x5db3a0, 0x5f12a0, 0x5f12d0, 0x5f9650, 0x5f9680, 0x613260, 0x613290, 0x61c860, 0x61c890, 0x61eb30, 0x61eb60, 0x61f0e0, 0x61f110, 0x6212f0, 0x621320, 0x621d40, 0x621d70, 0x622c00, 0x622c30, 0x623fc0, 0x623ff0, 0x626010, 0x626040, 0x62e630, 0x62e660, 0x62eed0, 0x62ef00, 0x62f4d0, 0x62f500, 0x62fdc0, 0x62fdf0, 0x630410, 0x630440, 0x638170, 0x6381a0, 0x5b71c0, 0x5b71d0, 0x6153a0, 0x6153d0 Confidence: verified Proof: one Test: none

The counting body is mov eax,[0xc2a3c4]; inc eax; cmp eax,1; mov [0xc2a3c4],eax; jne; jmp 0x5b71c0; the exit body is dec dword [0xc2a3c4]; jne; jmp 0x5b71d0. Both hooks are a lone ret (net/layout).

Exit callbacks

A call thunk's second half registers an exit callback with the C runtime (0x409aef). The callbacks free a global block through SMemFree, release a global list or table, or return at once.

Addresses: 0x464300, 0x46a240, 0x5d4d70, 0x5d5ba0, 0x5d7320, 0x5d7bc0, 0x5d8030, 0x5db390, 0x5db7a0, 0x5db7b0, 0x5db820, 0x5db830, 0x5db870, 0x5db880, 0x5db8d0, 0x5db8e0, 0x5e0c10, 0x5e0c20, 0x5e2010, 0x5e2020, 0x5f12c0, 0x5f3720, 0x5f9670, 0x5fa0c0, 0x5fa0d0, 0x5fa100, 0x5fa110, 0x5fa170, 0x5fa180, 0x5fa1d0, 0x5fa2d0, 0x5fa400, 0x5fa410, 0x5fa4e0, 0x5fa4f0, 0x5fa530, 0x5fa540, 0x613280, 0x61b190, 0x61c880, 0x61eb50, 0x61f100, 0x621310, 0x621d60, 0x622c20, 0x622fc0, 0x623fe0, 0x626030, 0x626480, 0x626490, 0x62e650, 0x62eef0, 0x62f4f0, 0x62fde0, 0x630430, 0x638190, 0x409aef, 0x6153c0 Confidence: verified Proof: one Test: none

Each registrar is push callback; call 0x409aef; pop ecx; ret, 12 bytes. A freeing callback loads its global, tests it, and calls 0x646430 with it, the tag -2 and 0.

Object tables

Four initializers of ObjectMgrClient.cpp build the manager's per-type tables: each type's field count at 0xb4143c, its allocation size at 0xb4141c, and the 10,256 field watcher lists at 0xb23310, which an exit callback empties again. The sizes are the end of the type's field array plus 4 bytes for each entry of its second array (fields): 0x134 object, 0x494 item, 0xa74 container, 0x1400 unit, 0x2c4c another player, 0x310 game object, 0x1ec dynamic object, 0x368 corpse.

Addresses: 0x4641c0, 0x464260, 0x4642d0, 0x464310, 0xb4141c, 0xb4143c, 0xb23310 Confidence: verified Proof: one Test: none

0x4641c0 adds 4·n to the array ends 0x128, 0x408, 0x8c8, 0x1158, 0x2508, 0x2f0, 0x1e0 and 0x350, with n from 0x47f2b0, 0x47e5d0, 0x47e090, 0x47db10, 0x47d550, 0x47d000, 0x47c9e0 and 0x47c4a0 (3, 35, 107, 170, 465, 8, 3 and 6; fields). 0x464260 stores 6, 0x30, 0x7a, 0xbc, 0x502, 0x1a, 0x10 and 0x26 in turn. 0x4642d0 loops 0x2810 times over 12-byte heads from 0xb23310, storing link offset 0 and an end link to itself with bit 0 set.

Other initializers

The rest fill tables of specific files: the inventory art hash table, list heads, the quest and talk marker model paths, a table of unit settings, the death thud sound records, and globals cleared at start-up.

Addresses: 0x5d7f70, 0x5d8040, 0x5db780, 0x5db800, 0x5db850, 0x5db8b0, 0x5e0bf0, 0x5e1ff0, 0x5fa1a0, 0x5fa1e0, 0x5fa2a0, 0x5fa2e0, 0x5fa430, 0x5fa4c0, 0x5fa510, 0x60e590, 0x61b160, 0x61b1a0, 0x622fa0, 0x622fd0, 0x626460 Confidence: inferred Proof: none Test: none

The bodies are listed by what they store; their tables' readers are not traced here.