Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add hzqst/CS2_VibeSignatures --skill "find-WeaponBuy"
Install specific skill from multi-skill repository
# Description
Find and identify the WeaponBuy (item purchase handler) function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the WeaponBuy function by searching for the "item_purchase" string reference and analyzing cross-references.
# SKILL.md
name: find-WeaponBuy
description: Find and identify the WeaponBuy (item purchase handler) function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the WeaponBuy function by searching for the "item_purchase" string reference and analyzing cross-references.
Find WeaponBuy
Locate WeaponBuy (item purchase handler) in CS2 server.dll or server.so using IDA Pro MCP tools.
Method
-
Search for the string:
mcp__ida-pro-mcp__find_regex pattern="item_purchase" -
Get cross-references to the string:
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>" -
Decompile the referencing function:
mcp__ida-pro-mcp__decompile addr="<function_addr>" -
Verify the function:
- Look for the "item_purchase" game event being created and fired
- The function should handle weapon/item purchasing logic
-
Typical pattern involves:
- Creating game event with "item_purchase"
- Setting event fields like "userid", "team", "loadout", "weapon"
- Firing the event
-
Rename the function:
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<function_addr>", "name": "WeaponBuy"}]} -
Generate and validate unique signature:
DO NOT use find_bytes as it won't work for function.
ALWAYS Use SKILL /generate-signature-for-function to generate a robust and unique signature for the function.
- Write IDA analysis output as YAML beside the binary:
ALWAYS Use SKILL /write-func-as-yaml to write the analysis results.
Required parameters:
- func_name: WeaponBuy
- func_addr: The function address from step 3
- func_sig: The validated signature from step 6
Note: This is NOT a virtual function, so no vtable parameters are needed.
String References
The function uses the item_purchase game event string which is used when a player buys a weapon or item.
Function Characteristics
- Purpose: Handles item/weapon purchases by players
- Game Event: Fires
item_purchaseevent with details about the purchase - Event Fields:
userid: Player who made the purchaseteam: Team of the purchasing playerloadout: Loadout slot informationweapon: The weapon/item that was purchased
Key Behaviors
- Validates the purchase request
- Creates the
item_purchasegame event - Populates event with purchase details
- Fires the event to notify the game system
DLL Information
- DLL:
server.dll(Windows) /server.so(Linux)
Notes
- This is a regular function, NOT a virtual function
- No vtable information is needed for this function
- The function is central to the buy system in CS2
- Multiple references to "item_purchase" may exist; look for the main purchase handler
Output YAML Format
The output YAML filename depends on the platform:
- server.dll -> WeaponBuy.windows.yaml
- server.so -> WeaponBuy.linux.yaml
func_va: 0x180XXXXXX # Virtual address of the function - This can change when game updates.
func_rva: 0xXXXXXX # Relative virtual address (VA - image base) - This can change when game updates.
func_size: 0xXXX # Function size in bytes - This can change when game updates.
func_sig: XX XX XX XX XX # Unique byte signature for pattern scanning - This can change when game updates.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.