Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add hzqst/CS2_VibeSignatures --skill "find-CCSPlayer_ItemServices_CanAcquire"
Install specific skill from multi-skill repository
# Description
Find and identify the CCSPlayer_ItemServices_CanAcquire function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the CanAcquire function that checks if a player's item services can acquire a specific item. This function validates item acquisition based on bot AI purchase logic and item availability.
# SKILL.md
name: find-CCSPlayer_ItemServices_CanAcquire
description: Find and identify the CCSPlayer_ItemServices_CanAcquire function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the CanAcquire function that checks if a player's item services can acquire a specific item. This function validates item acquisition based on bot AI purchase logic and item availability.
Find CCSPlayer_ItemServices_CanAcquire
Locate CCSPlayer_ItemServices_CanAcquire in CS2 server.dll or server.so using IDA Pro MCP tools.
Method
-
Search for the unique error string:
mcp__ida-pro-mcp__find_regex pattern="\[AI BT\]: Unable to determine the cost of '%s'\. Moving on to the next bot\." -
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>" -
Identify the target method call:
Look for the following pattern in the decompiled code:
c
v39 = (*CALL)(*(object + 3712), item_handle, 1, 0);
This call satisfies:
- First argument is a services subobject at offset 3712 (offset can diffs between windows / linux and change after game updates)
- Second argument is an item definition/handle
- Third argument is a flag (value: 1) indicating execution mode
- Fourth argument is a flag (value: 0)
- Return value controls success/failure flow (checked with if ( v39 ))
The function being called at this pattern is CCSPlayer_ItemServices_CanAcquire.
-
Rename the function:
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<function_addr>", "name": "CCSPlayer_ItemServices_CanAcquire"}]} -
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: CCSPlayer_ItemServices_CanAcquire
- func_addr: The function address from step 5
- func_sig: The validated signature from step 6
Note: This is NOT a virtual function, so no vtable parameters are needed.
Signature Pattern
The function is identified through bot AI purchase logic that contains error logging:
[AI BT]: Unable to determine the cost of '%s'. Moving on to the next bot.
The calling context shows item validation and purchase flow where the function at offset 3712 from the player services object is invoked to check item acquisition eligibility.
Function Characteristics
- Parameters:
(item_services, item_def, mode_flag, additional_flag)where: item_servicesis the CCSPlayer_ItemServices pointeritem_defis the item definition/handlemode_flagcontrols execution mode (typically 1)additional_flagis an additional parameter (typically 0)- Return value: Boolean indicating whether the item can be acquired (non-zero = can acquire)
- Offset: Called via services subobject at offset 3712 from player object
Code Context
The function is called within bot AI purchase logic:
v37 = (_BYTE *)sub_19077C0(v64, *(unsigned __int16 *)(v68 + 16), 0, 0); // Get item
v38 = *(_QWORD *)(v28 + 24); // Get player object pointer
if ( !v37 || !v37[104] || !v38 ) // Validate item and player
{
// Error: player unable to purchase item
}
v39 = sub_1339CD0(*(_QWORD *)(v38 + 3712), v37, 1, 0); // CAN ACQUIRE CHECK
if ( v39 ) // Success: item can be acquired
{
// Continue with purchase
}
else
{
// Error: unable to determine cost, skip to next bot
sub_97B5D0("[AI BT]: Unable to determine the cost of '%s'. Moving on to the next bot.");
}
Output YAML Format
The output YAML filename depends on the platform:
- server.dll → CCSPlayer_ItemServices_CanAcquire.windows.yaml
- server.so → CCSPlayer_ItemServices_CanAcquire.linux.yaml
func_va: 0x1339cd0 # Virtual address of the function - changes with game updates
func_rva: 0x1339cd0 # Relative virtual address (VA - image base) - changes with game updates
func_size: 0x62c # Function size in bytes - changes with game updates
func_sig: 55 48 89 E5 ... # Unique byte signature for pattern scanning - changes with game updates
Note: No vtable information is included as this is not a virtual function.
# 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.