本文へ移動
cccskills
無料GitHub で公開

find-CBasePlayerController_SetPawn-AND-CBasePlayerController_GetPawn

Find and identify the CBasePlayerController_SetPawn and CBasePlayerController_GetPawn functions in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll / libserver.so to locate the pawn-assignment routine by scanning for its distinctive multi-register-push prologue directly (no pre-resolved anchor needed), confirming uniqueness and byte-level match against a known reference signature. Trigger: CBasePlayerController_SetPawn, CBasePlayerController_GetPawn

インストール方法を見る

含まれるファイル(1)

  • SKILL.md7.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Find CBasePlayerController_SetPawn and CBasePlayerController_GetPawn

Locate CBasePlayerController_SetPawn and CBasePlayerController_GetPawn in CS2 server.dll / libserver.so using IDA Pro MCP tools.

Method

1. Locate SetPawn via Direct Byte-Pattern Scan

The upstream tooling normally resolves CBasePlayerController_SetPawn by LLM-decompiling the already-known CSource2GameClients_ClientDisconnect vfunc (see expected_input in config.yaml for this skill) and reading off the call CBasePlayerController_SetPawn(controller, 0, 0, 0, 0, 0) that clears the pawn on disconnect, right after a CBasePlayerController_GetPawn(controller) call. When that anchor is not pre-resolved, SetPawn's prologue is distinctive enough (5 callee-saved register pushes plus an early lea r13, [rdi+IMM32] sandwiched between two of the pushes) to scan directly:

mcp__ida-pro-mcp__find_bytes patterns=["55 48 89 E5 41 57 41 56 41 55 4C 8D AF ?? ?? ?? ?? 41 54 41 89 CC"]

This returns exactly one hit on the analyzed 14168 Linux binary.

2. Confirm via Decompile

mcp__ida-pro-mcp__decompile addr="<candidate_addr>"

The candidate takes 4 parameters (this, a2, a3, char a4) and, at its head, computes r13 = this + 968 (the lea r13, [rdi+imm32] from the prologue) — an internal table/map embedded in the controller object — then packs a2/a3 into a 16-byte key and performs a find-or-insert against that table (grow-on-miss, a4 gates whether a new entry is created on a lookup miss). This is consistent with SetPawn maintaining an internal handle-registration/lookup structure for the assigned pawn as part of updating m_hPawn (CS2's entity-handle system commonly backs simple-looking setters with hashtable-based bookkeeping for fast handle resolution). Byte match with the reference signature (see Output section) is the primary/authoritative confirmation for this recipe; treat the decompile as corroborating, not disqualifying, evidence given Hex-Rays' limited insight into a fully stripped binary.

3. Cross-Check Caller Count

mcp__ida-pro-mcp__xrefs_to addrs=["<candidate_addr>"]

Linux 14168 reference: candidate at 0x2280ab0 (size 0x430), with 6 direct callers — consistent with SetPawn being invoked from a handful of spawn/possession/disconnect code paths rather than being a hot-path/ubiquitous function (contrast with GetPawn, expected to have many more callers).

4. Locate GetPawn (Best Effort — No Ground Truth Available This Session)

GetPawn was not independently verified with ground truth in this session. Expect a small, trivial accessor (likely return m_hPawn.Get();, i.e. a handle-to-pointer resolve through the global entity list) called from a very large number of sites throughout the module (far more callers than SetPawn). A practical way to locate it: enumerate small (<0x40 byte) functions near SetPawn's translation unit that read the same this+968-adjacent memory region populated by SetPawn, or that are called immediately before SetPawn in known callers (e.g. the CSource2GameClients_ClientDisconnect anchor calls GetPawn(controller) then, if non-null, SetPawn(controller, 0,0,0,0,0)). Confirm any candidate by checking it has very high caller count and a one-or-two basic-block trivial body.

5. Generate Function Signature

ALWAYS Use SKILL /generate-signature-for-function with addr=<SetPawn_candidate_addr> to generate a robust and unique func_sig for CBasePlayerController_SetPawn. Repeat for GetPawn once resolved.

6. Write IDA Analysis Output as YAML

ALWAYS Use SKILL /write-func-as-yaml for CBasePlayerController_SetPawn with the address/signature from steps 1/5. Repeat for CBasePlayerController_GetPawn once independently resolved.

Function Characteristics

CBasePlayerController_SetPawn

  • Purpose: Assigns (or clears, when called with all-zero/false args) the CBasePlayerPawn* associated with a CBasePlayerController, updating internal handle-lookup bookkeeping as part of possession/spawn/disconnect flows.
  • Binary: server.dll / libserver.so
  • Parameters: (CBasePlayerController *this, ...) — observed as 4 detected params in the decompiled body (this, two 8-byte values forming a 16-byte key, and a trailing bool), though the real source-level signature may carry additional trailing bool parameters that are dead in this particular call shape (the CSource2GameClients_ClientDisconnect reference calls it with 5 trailing zero/false args).
  • VTable: none — concrete (non-virtual) method.

CBasePlayerController_GetPawn

  • Purpose: Returns the CBasePlayerPawn* currently assigned to the controller (resolves m_hPawn).
  • Binary: server.dll / libserver.so
  • Parameters: (CBasePlayerController *this)
  • Status: not resolved with ground truth this session — see step 4 for the discovery approach.

Discovery Strategy

  1. SetPawn's prologue (5 callee-saved pushes with a lea r13, [rdi+imm32] inserted mid-sequence) is distinctive enough to be directly scannable with find_bytes across the whole image, and returns a single hit.
  2. Byte-level agreement with the reference signature at every fixed-byte position is the authoritative validation signal for this recipe (see repo-wide validation rules); decompile semantics are corroborating but, on a stripped/optimized binary, can look unlike a naive "just assign a pointer" setter due to internal handle-bookkeeping.
  3. GetPawn is expected to be reachable as a much-more-frequently-called trivial accessor; without ground truth this session it is documented as a follow-up using caller-count and small-body heuristics rather than guessed at with an unverified address.

This is robust because the prologue byte pattern is unique in the whole 40MB image even without walking from the CSource2GameClients_ClientDisconnect anchor, and the resulting signature was independently regenerated via make_signature_for_function and found to match the reference byte-for-byte.

Output YAML Format

The output YAML filenames depend on the platform:

  • server.dll -> CBasePlayerController_SetPawn.windows.yaml, CBasePlayerController_GetPawn.windows.yaml
  • libserver.so -> CBasePlayerController_SetPawn.linux.yaml, CBasePlayerController_GetPawn.linux.yaml

Fields (both files): func_name, func_va, func_rva, func_size, func_sig.

Linux 14168 reference: CBasePlayerController_SetPawn func_sig = 55 48 89 E5 41 57 41 56 41 55 4C 8D AF ? ? ? ? 41 54 41 89 CC, func_va = 0x2280ab0, func_size = 0x430. CBasePlayerController_GetPawn not resolved this session.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Clean up the local workspace after a dev branch has been merged into main. Verifies the current dev branch is fully merged into origin/main, then switches to main, pulls the latest, deletes the local dev branch, and deletes the remote dev branch if it still exists. STOPS and warns the user if the current branch is not yet merged. Triggers: cleanup workspace, cleanup branch, delete merged branch, finish dev branch, post-merge cleanup

日本語の概要は準備中です。原文の説明を表示しています。

mrc4tt/CS2_VibeSignatures32026年10月13日 更新

Convert an existing find-XXXX SKILL.md into a preprocessor Python script, updating configs/<GAMEVER>.yaml and removing the old SKILL.md. Covers xref-string-based and LLM_DECOMPILE-based discovery patterns.

日本語の概要は準備中です。原文の説明を表示しています。

mrc4tt/CS2_VibeSignatures32026年10月13日 更新

Create an Agent SKILL.md fallback for an existing find-XXXX finder that relies on a fragile discovery foundation — above all LLM_DECOMPILE (patterns C/D/E), which matches the decompiled shape of a predecessor function against a stored reference and breaks when a symbol is inlined or de-inlined in a way the reference does not cover. The generated fallback coexists with the preprocessor and runs only when it returns failure, recovering every target robustly by decompiling the predecessor and following the inline/de-inline boundary with semantic anchors. Use when a finder broke on a game update, or you want to durably backstop one before it does. The recipe generalizes to any finder foundation. Triggers: create agent skill fallback, add SKILL.md fallback, robust fallback for finder, backstop LLM_DECOMPILE finder, final guarantee skill

日本語の概要は準備中です。原文の説明を表示しています。

mrc4tt/CS2_VibeSignatures32026年10月13日 更新

Create a new cpp_tests entry for validating a C++ interface vtable layout against binary reference YAMLs. Creates the .cpp test file in cpp_tests/ and appends a configs/<GAMEVER>.yaml entry under cpp_tests:. Use when a user asks to add vtable layout validation for a new hl2sdk_cs2 interface class.

日本語の概要は準備中です。原文の説明を表示しています。

mrc4tt/CS2_VibeSignatures32026年10月13日 更新

create-pr

無料

Create a GitHub pull request from staged task changes or an already-committed current branch. Deliver source/config/ reference changes together with their computed source-owned `bin_artifacts` closure. PR validation routing is owned by the default-branch trusted workflow; snapshots, gamedata, and manifests are Release-derived only.

日本語の概要は準備中です。原文の説明を表示しています。

mrc4tt/CS2_VibeSignatures32026年10月13日 更新

Create 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 find.

日本語の概要は準備中です。原文の説明を表示しています。

mrc4tt/CS2_VibeSignatures32026年10月13日 更新

mrc4tt のスキルをすべて見る

このスキルの問題を報告する