$npx -y skills add HLND2T/CS2_VibeSignatures --skill find-CNetworkMessages_GetNetworkSerializationContextDataFind and identify the CNetworkMessages_GetNetworkSerializationContextData virtual function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 networksystem.dll or libnetworksystem.so to locate the getter vfunc by reusing the known CNetworkMessages_SetNet
| 1 | # Find CNetworkMessages_GetNetworkSerializationContextData |
| 2 | |
| 3 | Locate `CNetworkMessages_GetNetworkSerializationContextData` vfunc in CS2 `networksystem.dll` or `libnetworksystem.so` using IDA Pro MCP tools. |
| 4 | |
| 5 | ## Method |
| 6 | |
| 7 | ### 1. Load CNetworkMessages_SetNetworkSerializationContextData from YAML |
| 8 | |
| 9 | **ALWAYS** Use SKILL `/get-func-from-yaml` with `func_name=CNetworkMessages_SetNetworkSerializationContextData`. |
| 10 | |
| 11 | If the skill returns an error, **STOP** and report to user. |
| 12 | |
| 13 | Otherwise, extract: |
| 14 | - `vfunc_index` |
| 15 | - `vfunc_offset` |
| 16 | |
| 17 | ### 2. Load CNetworkMessages VTable from YAML |
| 18 | |
| 19 | **ALWAYS** Use SKILL `/get-vtable-from-yaml` with `class_name=CNetworkMessages`. |
| 20 | |
| 21 | If the skill returns an error, **STOP** and report to user. |
| 22 | |
| 23 | Otherwise, extract: |
| 24 | - `vtable_numvfunc` |
| 25 | - `vtable_entries` |
| 26 | |
| 27 | ### 3. Resolve the Adjacent Getter Slot |
| 28 | |
| 29 | Compute the candidate slot for `CNetworkMessages_GetNetworkSerializationContextData`: |
| 30 | |
| 31 | - `target_vfunc_index = CNetworkMessages_SetNetworkSerializationContextData.vfunc_index + 1` |
| 32 | - `target_vfunc_offset = CNetworkMessages_SetNetworkSerializationContextData.vfunc_offset + 8` |
| 33 | |
| 34 | Validate that `target_vfunc_index < vtable_numvfunc`, then read: |
| 35 | |
| 36 | - `candidate_func_addr = CNetworkMessages_vtable[target_vfunc_index]` |
| 37 | |
| 38 | This adjacent-slot rule is required because `GetNetworkSerializationContextData` immediately follows |
| 39 | `SetNetworkSerializationContextData` in the `CNetworkMessages` vtable for `networksystem.dll` / `libnetworksystem.so`. |
| 40 | |
| 41 | ### 4. Decompile the Getter Candidate |
| 42 | |
| 43 | Decompile the resolved adjacent entry: |
| 44 | |
| 45 | ```text |
| 46 | mcp__ida-pro-mcp__decompile addr="<candidate_func_addr>" |
| 47 | ``` |
| 48 | |
| 49 | Confirm the candidate matches the network-serialization-context getter pattern. |
| 50 | |
| 51 | Expected behavior: |
| 52 | |
| 53 | 1. Takes `(this, key_name)` arguments |
| 54 | 2. Uses an internal lock around the lookup |
| 55 | 3. Looks up `key_name` from the internal symbol table owned by `CNetworkMessages` |
| 56 | 4. Returns the resolved 16-bit context value, or `0xFFFF` / `-1` when not found |
| 57 | |
| 58 | Windows example shape: |
| 59 | |
| 60 | ```c |
| 61 | __int64 __fastcall CNetworkMessages_GetNetworkSerializationContextData(..., __int64 key_name) |
| 62 | { |
| 63 | AcquireSRWLockExclusive(...); |
| 64 | CUtlSymbolTable::Find(..., key_name); |
| 65 | ... |
| 66 | ReleaseSRWLockExclusive(...); |
| 67 | return ...; |
| 68 | } |
| 69 | ``` |
| 70 | |
| 71 | Linux example shape: |
| 72 | |
| 73 | ```c |
| 74 | __int64 __fastcall CNetworkMessages_GetNetworkSerializationContextData(__int64 thisptr, __int64 key_name) |
| 75 | { |
| 76 | ... |
| 77 | sub_176D10(..., thisptr + ..., key_name); |
| 78 | ... |
| 79 | return ...; |
| 80 | } |
| 81 | ``` |
| 82 | |
| 83 | The exact helper names and structure offsets may change across game updates. The identification rule is: |
| 84 | |
| 85 | 1. The function is the next vtable entry after `SetNetworkSerializationContextData` |
| 86 | 2. It performs a locked lookup from the `CNetworkMessages` serialization-context symbol table |
| 87 | 3. It returns the resolved small integer context value instead of writing data into the object |
| 88 | |
| 89 | If all three conditions hold, the candidate is `CNetworkMessages_GetNetworkSerializationContextData`. |
| 90 | |
| 91 | ### 5. Generate Function Signature |
| 92 | |
| 93 | **ALWAYS** Use SKILL `/generate-signature-for-function` with `addr=<candidate_func_addr>` to generate a robust and unique `func_sig` for `CNetworkMessages_GetNetworkSerializationContextData`. |
| 94 | |
| 95 | Use the returned validated `func_sig` in the next step. |
| 96 | |
| 97 | ### 6. Write IDA Analysis Output as YAML |
| 98 | |
| 99 | **ALWAYS** Use SKILL `/write-vfunc-as-yaml` to write the analysis results. |
| 100 | |
| 101 | Required parameters: |
| 102 | - `func_name`: `CNetworkMessages_GetNetworkSerializationContextData` |
| 103 | - `func_addr`: `<candidate_func_addr>` |
| 104 | - `func_sig`: The validated signature from step 5 |
| 105 | - `vfunc_sig`: `None` |
| 106 | |
| 107 | VTable parameters: |
| 108 | - `vtable_name`: `CNetworkMessages` |
| 109 | - `vfunc_offset`: `<target_vfunc_offset>` in hex |
| 110 | - `vfunc_index`: `<target_vfunc_index>` |
| 111 | |
| 112 | ## Function Characteristics |
| 113 | |
| 114 | - **Purpose**: Returns the network serialization context id associated with a key name from the `CNetworkMessages` symbol table |
| 115 | - **Binary**: `networksystem.dll` / `libnetworksystem.so` |
| 116 | - **Parameters**: `(this, key_name)` |
| 117 | - **Return value**: A small integer / symbol id for the serialization context, typically `0xFFFF` when the key is not found |
| 118 | |
| 119 | ## Discovery Strategy |
| 120 | |
| 121 | 1. Reuse the existing `CNetworkMessages_SetNetworkSerializationContextData` YAML to obtain the authoritative slot index |
| 122 | 2. Reuse the existing `CNetworkMessages_vtable` YAML to resolve the adjacent vtable entry |
| 123 | 3. Confirm the adjacent candidate is a locked symbol-table lookup getter for serialization-context data |
| 124 | 4. Generate a stable `func_sig` from the resolved getter body |
| 125 | |
| 126 | This is robust because: |