find-CSource2Server_Shutdown-decompiles
Skill67 starsChanged 58 days agoMITView on GitHub
Final-guarantee fallback for the find-CSource2Server_Shutdown-decompiles preprocessor. Recovers the three teardown functions that CSource2Server::Shutdown calls directly — CGameEventManager_Shutdown, CLoopModeRegistry_UnregisterLoopModes, and CEngineServiceRegistry_UnregisterEngineServices — by decompiling CSource2Server_Shutdown in CS2 server.dll / libserver.so and reading its direct call targets. Use this skill only when the deterministic/LLM preprocessor (ida_preprocessor_scripts/find-CSource2Server_Shutdown-decompiles.py) could not resolve every target — for example when a previous-version func_sig no longer matches and the LLM_DECOMPILE step returns an empty result. Trigger: CGameEventManager_Shutdown, CLoopModeRegistry_UnregisterLoopModes, CEngineServiceRegistry_UnregisterEngineServices
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- cleanup-workspaceSkill
- convert-finder-skill-to-preprocessor-scriptsSkill
- create-agent-skill-fallbackSkill
- create-cpp-testsSkill
- create-preprocessor-scriptsSkill
- create-prSkill
- dump-vtablesSkill
- find-CBaseEntity_GetChangeAccessorPathInfo_1Skill
- find-CCSBotManager_AddBot_BotNavIgnoreSkill
- find-CCSGameRules__sm_mapGcBanInformationSkill
- find-CCSPlayer_MovementServices_CheckJumpButton_WaterPatchSkill
- find-CCSPlayer_MovementServices_FullWalkMove_SpeedClampSkill
- find-CEntitySystem_Init-decompilesSkill
- find-CEntitySystem_m_entityNamesSkill
- find-CNetworkGameServerBase_CheckTimeouts-decompilesSkill
- find-CNetworkGameServerBase_CreateFakeClientSkill
- find-CNetworkGameServerBase_GetChallengeTypeSkill
- find-CNetworkGameServer_GetFreeClientSkill
- find-CNetworkMessages_dtorSkill
- find-CNetworkMessages_GetIsForServerSkill
- find-CNetworkMessages_GetNetworkSerializationContextDataSkill
- find-CNetworkMessages_vtable-decompilesSkill
- find-CServerSideClientBase_GetUserIDStringSkill
- find-CSteam3ServerS1_InitGameServer-decompilesSkill
- find-INetworkServerService_GetServerSerializersCRCSkill
- find-INetworkServerService_IsActiveInGameSkill
- find-INetworkServerService_IsServerRunningSkill
- find-IVEngineServer2_GetClientSteamIDSkill
- find-OnServerVoiceData_IsPlayingDemo_CalleeSkill
- fix-cppheadersSkill
- generate-reference-yamlSkill
- generate-signature-for-functionSkill
- generate-signature-for-globalvarSkill
- generate-signature-for-patchSkill
- generate-signature-for-structoffsetSkill
- generate-signature-for-vfuncoffsetSkill
- get-func-from-yamlSkill
- get-vtable-addressSkill
- get-vtable-from-yamlSkill
- get-vtable-indexSkill
- init-gamebinSkill
- rename-preprocessor-scriptsSkill
- resolve-pr-conflictSkill
- run-validation-until-no-failureSkill
- run-vcall-finderSkill
- trigger-release-buildSkill
- write-func-as-yamlSkill
- write-globalvar-as-yamlSkill
- write-patch-as-yamlSkill
- write-structoffset-as-yamlSkill
- write-vfunc-as-yamlSkill
- write-vtable-as-yamlSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Every output is a concrete function (a func_sig), not a vcall.
- Very specific: line 29
Read the platform-relevant reference YAML before searching in IDA.
- Very specific: line 41
run a fixed sequence of four indirect calls through the same global object, each fetched as vtable slot [reg+50h] and each fed one freshly …
- Distinctive: line 73
All three outputs are regular functions.
- Very specific: line 103
ALWAYS: Use SKILL /get-func-from-yaml with func_name=CSource2Server_Shutdown to obtain its func_va.
- Distinctive: line 105
If the skill returns an error, STOP and report to user (this fallback cannot run without the predecessor).
- Distinctive: line 113
Do not rely on the reference addresses.
- Very specific: line 129
If the operand still reads sub_XXXXXXXX, that first call — the one fed by the gameeventmanager global and made *before* the four [reg+50h] …
- Very specific: line 152
ALWAYS: Use SKILL /generate-signature-for-function with addr=<func_addr> to obtain func_sig.
- Very specific: line 153
ALWAYS: Use SKILL /write-func-as-yaml with:
- Distinctive: line 163
Write each output beside the binary with the writer skill.
- Very specific: line 167
If the predecessor CSource2Server_Shutdown YAML is missing → STOP and report to user.
- Very specific: line 168
If a target cannot be located by position even after reading the full decompilation → resolve the ones you can, then STOP and report …
- Very specific: line 171
Never emit a symbol you did not confirm as a direct call from CSource2Server_Shutdown.
- Very specific: line 185
All three targets are direct calls from a single, stable caller (CSource2Server_Shutdown), so no cross-version name mapping or vtable slot …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Find CSource2Server_Shutdown-decompiles (final-guarantee fallback)
Recover the three functions that CSource2Server::Shutdown calls directly, in CS2 server.dll /
libserver.so, using IDA Pro MCP tools. This is the Agent fallback for the
find-CSource2Server_Shutdown-decompiles preprocessor: it runs only when the preprocessor script returned
failure. It reproduces the LLM_DECOMPILE step by hand — the three targets are ordinary direct calls made
from one well-known caller, so no cross-version name mapping is actually required: the caller's call graph
names them.
Every output is a concrete function (a func_sig), not a vcall. There is no vtable involved.
Realworld Function References
Read the platform-relevant reference YAML before searching in IDA. It provides the concrete disassembly of
CSource2Server_Shutdown including the annotated call sites. Treat its addresses and offsets as
reference-build values only; verify every result against the current binary.
- Windows:
ida_preprocessor_scripts/references/server/CSource2Server_Shutdown.windows.yaml - Linux:
ida_preprocessor_scripts/references/server/CSource2Server_Shutdown.linux.yaml
Background — where the three teardown calls sit
CSource2Server_Shutdown is a short teardown routine. Its body is, in order:
- shut down the game-event manager (
CGameEventManager_Shutdown, passing thegameeventmanagerglobal); - run a fixed sequence of four indirect calls through the same global object, each fetched as
vtable slot [reg+50h]and each fed one freshly built argument (sub_*producers) — these are not our targets; - a contiguous run of four direct calls: the first two are our targets
(
CLoopModeRegistry_UnregisterLoopModes, thenCEngineServiceRegistry_UnregisterEngineServices), followed byReleaseParticleEffectsandReleaseCSBotManagerwhich are not targets; - return through a tail
jmp.
So the two requested functions in that run are its first two entries, sitting right after the four
[reg+50h] indirect dispatches and right before ReleaseParticleEffects / ReleaseCSBotManager. That
position — not the raw address — is the anchor, and it survives decompiler renames and address shifts across
updates.
Windows reference calls (platform refs, do not copy):
.text:0000000180CE832E call CLoopModeRegistry_UnregisterLoopModes
.text:0000000180CE8333 call CEngineServiceRegistry_UnregisterEngineServices
.text:0000000180CE8338 call ReleaseParticleEffects
.text:0000000180CE833D call ReleaseCSBotManagerCGameEventManager_Shutdown is the first meaningful call in the routine, ahead of the four indirect
dispatches, and is the only one taking the gameeventmanager global:
.text:0000000180CE82A6 mov rcx, cs:gameeventmanager
.text:0000000180CE82AD call CGameEventManager_ShutdownOutput inventory
All three outputs are regular functions; none is a struct member, vtable vfunc, indirect vcall, or global
variable. The preprocessor's GENERATE_YAML_DESIRED_FIELDS confirms this: each target lists only
func_name/func_sig/func_va/func_rva/func_size and no vtable_name/vfunc_*.
The preview VAs below are from the 14188 build (verified on both platforms) — treat them as reference-build values and re-verify against the current binary; do not copy them.
| # | Output symbol | Kind | Windows | Linux | Writer skill |
| 1 | CGameEventManager_Shutdown | regular function | 0x180C23D00 | 0x171B380 | /write-func-as-yaml |
| 2 | CLoopModeRegistry_UnregisterLoopModes | regular function | 0x181370150 | 0x21C1A40 | /write-func-as-yaml |
| 3 | CEngineServiceRegistry_UnregisterEngineServices | regular function | 0x181370080 | 0x21C1B30 | /write-func-as-yaml |
Platform gating: all three are produced on both platforms (expected_output uses {platform} with no
_windows/_linux split in configs/<GAMEVER>.yaml).
Step 0. Skip targets already produced
Some outputs may already exist beside the binary (written by the preprocessor before it failed). For each
output, if <name>.<platform>.yaml already exists next to the binary and parses to a non-empty mapping,
skip it and spend effort only on the missing ones.
mcp__ida-pro-mcp__py_eval code="import idaapi, os; d=os.path.dirname(idaapi.get_input_file_path()); print('\n'.join(sorted(f for f in os.listdir(d) if f.endswith('.yaml'))))"/get-func-from-yaml also reports existence for functions (returns an error when absent).
Step 1. Load and decompile the predecessor
ALWAYS Use SKILL /get-func-from-yaml with func_name=CSource2Server_Shutdown to obtain its func_va.
If the skill returns an error, STOP and report to user (this fallback cannot run without the predecessor).
Decompile it and read its direct calls:
mcp__ida-pro-mcp__decompile addr="<CSource2Server_Shutdown.func_va>"Do not rely on the reference addresses. Identify each target by the semantic position described in Background above.
Step 2. Resolve the three direct calls
Locate each instruction and confirm it is a direct call (or a tail jmp — treat the same way).
2a. CGameEventManager_Shutdown
The first meaningful call in the routine. It is preceded by a load of the gameeventmanager global into
the argument register (rcx on Windows, rdi on Linux):
CGameEventManager_Shutdown(&s_GameEventManager);If the operand still reads sub_XXXXXXXX, that first call — the one fed by the gameeventmanager global and
made before the four [reg+50h] indirect dispatches — is this function. Rename it with
mcp__ida-pro-mcp__rename before generating the signature.
2b. CLoopModeRegistry_UnregisterLoopModes
The first call of the contiguous direct-call run described in Background (the run sitting between the
four [reg+50h] indirect dispatches and the ReleaseParticleEffects / ReleaseCSBotManager pair).
2c. CEngineServiceRegistry_UnregisterEngineServices
The second call of that same run, immediately after CLoopModeRegistry_UnregisterLoopModes and
immediately before ReleaseParticleEffects. Keep the order: CLoopModeRegistry_UnregisterLoopModes comes
first, CEngineServiceRegistry_UnregisterEngineServices second.
Confirm all three are direct calls from CSource2Server_Shutdown, not references that merely appear in a
reference block or comment. If the operand is a j_XXXX thunk, report the real function name XXXX (strip
the j_ prefix).
Step 3. Generate signatures and write the YAMLs
For each of the three resolved functions:
- ALWAYS Use SKILL
/generate-signature-for-functionwithaddr=<func_addr>to obtainfunc_sig. - ALWAYS Use SKILL
/write-func-as-yamlwith:func_name: the resolved symbol (e.g.CLoopModeRegistry_UnregisterLoopModes)func_addr: the resolved addressfunc_sig: the validated signature from step 1
CGameEventManager_Shutdown is a tiny tail-call-style stub, so its signature may need to extend past the end
of the function into the next one. When /generate-signature-for-function cannot produce a unique signature
inside the function, allow the signature to cross the function boundary
(func_sig_allow_across_function_boundary: true) — this is the platform reference value and is expected.
Write each output beside the binary with the writer skill; do not hand-edit the YAML.
Failure handling
- If the predecessor
CSource2Server_ShutdownYAML is missing → STOP and report to user. - If a target cannot be located by position even after reading the full decompilation → resolve the ones you
can, then STOP and report exactly which output(s) could not be found, so the user can extend the
references. Do not guess a
sub_*by proximity. - Never emit a symbol you did not confirm as a direct call from
CSource2Server_Shutdown.
Output YAML filenames
Written beside the binary by the writer skill, one file per symbol:
- Windows (
server.dll):<symbol>.windows.yaml - Linux (
libserver.so):<symbol>.linux.yaml
e.g. CGameEventManager_Shutdown.windows.yaml, CLoopModeRegistry_UnregisterLoopModes.windows.yaml,
CEngineServiceRegistry_UnregisterEngineServices.linux.yaml.
Why this is robust
- All three targets are direct calls from a single, stable caller (
CSource2Server_Shutdown), so no cross-version name mapping or vtable slot is involved. - Each target is anchored to its position in the caller (the first call, and the first/second of the contiguous post-dispatch run), which is stable even when addresses, offsets, and decompiler names change across updates.
- The anchor degrades gracefully when the callers' callees are unresolved
sub_*: the semantic position and the neighboringReleaseParticleEffects/ReleaseCSBotManagercalls still identify the run.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

