$npx -y skills add HLND2T/CS2_VibeSignatures --skill find-CEntitySystem_Init-decompilesFinal-guarantee fallback for the find-CEntitySystem_Init-decompiles preprocessor. Recovers the struct members, indirect virtual-function offsets, and de-inlined helpers that CEntitySystem::Init sets up, by decompiling CEntitySystem_Init in CS2 server.dll / libserver.so and follow
| 1 | # Find CEntitySystem_Init-decompiles (final-guarantee fallback) |
| 2 | |
| 3 | Recover every symbol that `CEntitySystem::Init` wires up, in CS2 `server.dll` / `libserver.so`, using IDA Pro |
| 4 | MCP tools. This is the **Agent fallback** for the `find-CEntitySystem_Init-decompiles` skill: it only runs when |
| 5 | the preprocessor script returned failure, which almost always means one target's access pattern **moved** — |
| 6 | either it was inlined into `CEntitySystem_Init` where the reference expected a separate function, or it was |
| 7 | de-inlined out of `CEntitySystem_Init` into a helper the reference does not know about. |
| 8 | |
| 9 | Your job is to produce the missing output YAMLs regardless of that inline/de-inline boundary. |
| 10 | |
| 11 | ## Realworld Function References |
| 12 | |
| 13 | Read the platform-relevant real-world YAMLs before searching in IDA. They provide concrete disassembly, |
| 14 | decompiler output, semantic anchors, and both sides of the known inline/de-inline boundary. Treat their |
| 15 | addresses and offsets as reference-build values only; verify every result against the current binary. |
| 16 | |
| 17 | - Windows inline baseline: `ida_preprocessor_scripts/references/server/CEntitySystem_Init.windows.yaml` |
| 18 | - Linux baseline: `ida_preprocessor_scripts/references/server/CEntitySystem_Init.linux.yaml` |
| 19 | - Windows de-inlined `CEntitySystem_Init` variant: |
| 20 | `ida_preprocessor_scripts/references/server/CEntitySystem_Init-noinline.windows.yaml` |
| 21 | - Windows de-inlined material helper: |
| 22 | `ida_preprocessor_scripts/references/server/CEntitySystem_InitEntityMaterialAttributes.windows.yaml` |
| 23 | - Linux registration helper: |
| 24 | `ida_preprocessor_scripts/references/server/CEntitySystem_ProcessEntityRegistration.linux.yaml` |
| 25 | |
| 26 | ## Background — what CEntitySystem_Init does |
| 27 | |
| 28 | `CEntitySystem_Init(this, const char *name, int a3, int mode, char a5)` is a long constructor-style routine. |
| 29 | Along the way it: |
| 30 | |
| 31 | - copies the system name into `this->m_sEntSystemName`; |
| 32 | - stores the serialization `mode` into `this->m_eNetworkSerializationMode`; |
| 33 | - initializes `this->m_ComponentUnserializerInfoAllocator` (a `CUtlScratchMemoryPool`); |
| 34 | - registers all entity/component classes; |
| 35 | - calls `g_pNetworkMessages->SetNetworkSerializationContextData("string_t_table", m_eNetworkSerializationMode, &m_Symbols)` |
| 36 | through the **`INetworkMessages` vtable** (an indirect virtual call); |
| 37 | - when `m_eNetworkSerializationMode` is set, allocates a `CNetworkFieldScratchData` into |
| 38 | `this->m_pNetworkFieldScratchData` and calls |
| 39 | `g_pFlattenedSerializers->CreateFieldChangedEventQueue(m_pNetworkFieldScratchData, m_pFieldChangeLimitSpew)` |
| 40 | through the **`IFlattenedSerializers` vtable**, storing the result into `this->m_pNetworkFieldChangedEventQueue`; |
| 41 | - (Linux) tail-calls the de-inlined `CEntitySystem_ProcessEntityRegistration`; |
| 42 | - (Windows) runs the entity-material-attributes registration loop that touches `this->m_EntityMaterialAttributes`. |
| 43 | |
| 44 | All member accesses are **relative to `this`** (the first argument — `rcx` on Windows, `rdi` on Linux — usually |
| 45 | copied to `rsi`/`rbx`). This is the key to robustness: `this + offset` is stable whether the access sits in |
| 46 | `CEntitySystem_Init` itself or in a helper that received `this` as its first argument. |
| 47 | |
| 48 | ## Robustness principle — follow the de-inline boundary |
| 49 | |
| 50 | For **every** target below: |
| 51 | |
| 52 | 1. First look for its access pattern **inside `CEntitySystem_Init`**. |
| 53 | 2. If it is not there, it has been **de-inlined into a callee**. Enumerate the functions that |
| 54 | `CEntitySystem_Init` calls (read the pseudocode / disassembly and collect each `sub_*` / named `call` |
| 55 | target), decompile the plausible ones, and search there. The owning helper takes `this` (the |
| 56 | `CEntitySystem *`) as its first parameter, so the same `this + offset` pattern appears. Recurse one or two |
| 57 | levels if needed. |
| 58 | 3. Conversely, a target the reference expected in a **separate function** (e.g. Linu |