$npx -y skills add HLND2T/CS2_VibeSignatures --skill create-preprocessor-scriptsCreate a new find-XXXX preprocessor Python script from scratch (no existing SKILL.md), add configs/<GAMEVER>.yaml skill and symbol entries. Covers xref-string-based and LLM_DECOMPILE-based discovery patterns. Use when a GitHub issue or user instruction specifies a new function to
| 1 | # Create Preprocessor Scripts from Scratch |
| 2 | |
| 3 | Create an `ida_preprocessor_scripts/find-XXXX.py` preprocessor script and add the corresponding |
| 4 | `configs/<GAMEVER>.yaml` entries for a newly requested function, vtable, or struct member offset. |
| 5 | |
| 6 | Resolve `GAMEVER` from the user's explicit request or `CS2VIBE_GAMEVER`, set the edit target to |
| 7 | `configs/$GAMEVER.yaml`, and stop if that exact file does not exist. Never edit another version as a fallback. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | - A GitHub issue or user instruction requests adding support for finding a new function/symbol |
| 12 | - No existing `.claude/skills/find-XXXX/SKILL.md` needs conversion (for that, use `convert-finder-skill-to-preprocessor-scripts`) |
| 13 | |
| 14 | ## Inputs |
| 15 | |
| 16 | The user or issue will provide some or all of: |
| 17 | |
| 18 | | Field | Description | Example | |
| 19 | |-------|-------------|---------| |
| 20 | | **Function name(s)** | Target symbol(s) to find | `CPlayer_MovementServices_PlayWaterStepSound` | |
| 21 | | **Module** | Which DLL/SO the function lives in | `server`, `engine`, `networksystem`, `client` | |
| 22 | | **Category** | Symbol type | `func`, `vfunc`, `structmember`, `patch`, `vtable` | |
| 23 | | **xref_strings** | Debug strings for xref-based discovery | `"CT_Water.StepLeft"` | |
| 24 | | **xref_gvs** | Global variable VA (e.g. vtable address) to find functions that reference it | vtable VA from `SomeClass_vtable.{platform}.yaml` | |
| 25 | | **xref_funcs** | Known callee function name to find its callers | `"CPlayerCommandQueue_ctor"` | |
| 26 | | **Predecessor function** | Function to decompile for LLM_DECOMPILE patterns | `CBaseEntity_TakeDamageOld` | |
| 27 | | **VTable class** | Class owning the vtable (for vfuncs) | `CBasePlayerPawn` | |
| 28 | | **Desired YAML fields** | Which fields the output YAML needs | `func_name, func_sig, func_va, func_rva, func_size` | |
| 29 | | **Dependencies** | Input YAMLs this skill depends on | `CCSPlayer_MovementServices_vtable.{platform}.yaml` | |
| 30 | | **Aliases** | Alternative names for the symbol | `CPlayer_MovementServices::PlayWaterStepSound` | |
| 31 | |
| 32 | ## Overview |
| 33 | |
| 34 | Twelve preprocessor patterns exist. The discovery method and target type determine which to use: |
| 35 | |
| 36 | | Pattern | Discovery Method | Has FUNC_XREFS | Has LLM_DECOMPILE | Has INHERIT_VFUNCS | Has FUNC_VTABLE_RELATIONS | preprocess_skill has llm_config | |
| 37 | |---------|-----------------|-----------------|---------------------|--------------------|---------------------------|-------------------------------| |
| 38 | | **A** -- Regular function via xref strings | `find_regex` + `xrefs_to` on debug strings | Yes | No | No | No | No | |
| 39 | | **B** -- Virtual function via xref strings | Same as A, but function is in a vtable | Yes | No | No | Yes | No | |
| 40 | | **C** -- Virtual function via LLM_DECOMPILE | Decompile a known predecessor function, identify vfunc call offsets | No | Yes | No | Yes | Yes | |
| 41 | | **D** -- Regular function via LLM_DECOMPILE | Decompile a known predecessor function, identify direct call targets | No | Yes | No | No | Yes | |
| 42 | | **E** -- Struct member offset via LLM_DECOMPILE | Decompile a known predecessor function, identify struct field access offsets | No | Yes | No | No | Yes | |
| 43 | | **F** -- Virtual function via INHERIT_VFUNCS | Inherit vtable slot index from a known base-class vfunc, look up same slot in derived-class vtable (standard); or slot-only mode for abstract/interface vfuncs where only offset/index is needed | No | No | Yes | No | No | |
| 44 | | **G** -- ConCommand handler function | Find the handler callback registered via `RegisterConCommand` by matching command name and help string | No (uses COMMAND_NAME/HELP_STRING) | No | No | No | No | |
| 45 | | **H** -- Secondary (ordinal) vtable | Locate a class's secondary vtable via mangled symbol (Windows) or offset-to-top (Linux) | No | No | No | No | No | |
| 46 | | **I** -- Interface vfunc offset via thunk instruction walk | Walk a known concrete-class thunk via `py_eval` + `idaapi.decode_insn`, extract `jmp [reg+disp]` displacement as vfunc_offset | No | No | No | No | No | |
| 47 | | **J** -- IGameSystem vfunc via dispatch scan | Scan `IGameSystem_DispatchCall(idx, callback, ...)` call sites in a known predecessor; map targets by scan/index order using `_igamesystem_dispatch_common` | No | No | No | No | No | |
| 48 | | **K** -- IGameSystem vfunc via slot dispatch scan | Walk an `IGameSystem_Loop*AllSystems` dispatcher function body; extract `[rax+offset]` vtable call displacements via `_igamesystem_slot_dispatch_common`; output is slot-only (no `func_sig`) | No | No | No | No | No | |
| 49 | | **L** -- Interface vfunc slot via indirect vcall scan | Scan a known thunk/caller for its **unique** register-indirect vtable call (`jmp/call qword ptr [reg+disp]`) via `_indirect_vcall_target_common`; read the displace |