Find g_pGameTypes and IGameTypes_CreateWorkshopMapGroup
Locate g_pGameTypes (global variable) and IGameTypes_CreateWorkshopMapGroup (virtual function offset) in CS2 server.dll or server.so using IDA Pro MCP tools.
Method
1. Search for the string
mcp__ida-pro-mcp__find_regex pattern="mapgroup workshop"
Expected match: "mapgroup workshop;" at some address in the binary.
2. Get cross-references to the string
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"
3. Decompile the referencing function
mcp__ida-pro-mcp__decompile addr="<function_addr>"
Verify the function contains the pattern:
(*(void (__fastcall **)(__int64, const char *, __int64 *))(*(_QWORD *)qword_XXXXXXXX + 296LL))(
qword_XXXXXXXX, // This is g_pGameTypes
"workshop",
&v_local);
sub_XXXXXXXXX((char *)&v_local2 + 4, "mapgroup workshop;");
The key identifiers:
qword_XXXXXXXXaccessed with a virtual function call at offset296(0x128) — this isg_pGameTypes- The vfunc call at offset 0x128 is
IGameTypes::CreateWorkshopMapGroup, can change on game update
4. Disassemble around the call to find exact instruction addresses
mcp__ida-pro-mcp__disasm addr="<load_instruction_addr>" max_instructions=15
Look for the instruction sequence:
mov rcx, cs:qword_XXXXXXXX ; loads g_pGameTypes
lea r8, [rsp+...]
lea rdx, aWorkshop ; "workshop"
mov rax, [rcx]
call qword ptr [rax+128h] ; IGameTypes::CreateWorkshopMapGroup
lea rdx, aMapgroupWorksh ; "mapgroup workshop;"
Record:
- The address of
qword_XXXXXXXX— this is theg_pGameTypesglobal variable - The address of
call qword ptr [rax+128h]— this is the vfunc call instruction
5. Rename the global variable
mcp__ida-pro-mcp__rename batch={"data": {"old": "qword_XXXXXXXX", "new": "g_pGameTypes"}}
6. Generate signature for g_pGameTypes
ALWAYS Use SKILL /generate-signature-for-globalvar to generate a robust and unique signature for g_pGameTypes.
7. Generate signature for IGameTypes_CreateWorkshopMapGroup
ALWAYS Use SKILL /generate-signature-for-vfuncoffset to generate a robust and unique signature for the vfunc call instruction.
Parameters:
inst_addr: The address of thecall qword ptr [rax+128h]instruction from step 4vfunc_offset:0x128(296 decimal), can change on game update.
8. Write IDA analysis output as YAML
For IGameTypes_CreateWorkshopMapGroup:
ALWAYS Use SKILL /write-vfunc-as-yaml to write the analysis results.
Required parameters:
func_name:IGameTypes_CreateWorkshopMapGroupfunc_addr:None(this is a vfunc call site, not a direct function)func_sig:Nonevfunc_sig: The validated signature from step 7vtable_name:IGameTypesvfunc_offset:0x128vfunc_index:37(0x128 / 8)
For g_pGameTypes:
ALWAYS Use SKILL /write-globalvar-as-yaml to write the analysis results.
Required parameters:
gv_name:g_pGameTypesgv_addr: The global variable address from step 4gv_sig: The validated signature from step 6gv_sig_va: The virtual address that signature matchesgv_inst_offset:0gv_inst_length: Length of the GV-accessing instructiongv_inst_disp: Displacement offset within the instruction
Signature Pattern
The function contains a workshop map group registration pattern:
"workshop" — passed as the map group type identifier
"mapgroup workshop;" — used to build a console command string
Function / Global Variable Characteristics
g_pGameTypes
- Type: Global pointer (
IGameTypes*) - Purpose: Singleton interface pointer to the game types system, managing map groups, game modes, and game types
- Access Pattern: Typically accessed via
mov rcx, cs:g_pGameTypesbefore calling virtual methods through the vtable - Virtual Function Table: Contains methods for managing game types including
CreateWorkshopMapGroupat offset 0x128
IGameTypes_CreateWorkshopMapGroup
- Interface:
IGameTypes - VTable Offset:
0x128(296 decimal) - VTable Index:
37 - Purpose: Creates/registers a workshop map group with the given map paths
- Call Pattern:
g_pGameTypes->vtable[37](g_pGameTypes, "workshop", &mapPathArray) - Parameters:
this—g_pGameTypespointerconst char*— group type identifier ("workshop")CUtlVector*— array of workshop map path strings
Output YAML Format
The output YAML filename for IGameTypes_CreateWorkshopMapGroup depends on the platform:
server.dll→IGameTypes_CreateWorkshopMapGroup.windows.yamlserver.so/libserver.so→IGameTypes_CreateWorkshopMapGroup.linux.yaml
The output YAML filename for g_pGameTypes depends on the platform:
server.dll→g_pGameTypes.windows.yamlserver.so/libserver.so→g_pGameTypes.linux.yaml