$npx -y skills add HLND2T/CS2_VibeSignatures --skill get-vtable-from-yamlLoad vtable information from a pre-generated YAML file. Use this skill when you need to get vtable address and size for a class before analyzing virtual functions. This skill checks for existing vtable YAML files and errors out if not found, ensuring the vtable analysis has been
| 1 | # Get VTable from YAML |
| 2 | |
| 3 | Load vtable information from a pre-generated `{class_name}_vtable.{platform}.yaml` file beside the binary. |
| 4 | |
| 5 | ## Parameters |
| 6 | |
| 7 | - `class_name`: The class name to look up (e.g., `CCSPlayerController`, `CCSPlayer_WeaponServices`, `CServerSideClient`) |
| 8 | |
| 9 | ## Method |
| 10 | |
| 11 | ### 1. Check and Load VTable YAML |
| 12 | |
| 13 | Run the following code with the appropriate `class_name`: |
| 14 | |
| 15 | ```python |
| 16 | mcp__ida-pro-mcp__py_eval code=""" |
| 17 | import idaapi |
| 18 | import os |
| 19 | |
| 20 | class_name = "<CLASS_NAME>" # Replace with actual class name |
| 21 | |
| 22 | input_file = idaapi.get_input_file_path() |
| 23 | dir_path = os.path.dirname(input_file) |
| 24 | platform = 'windows' if input_file.endswith('.dll') else 'linux' |
| 25 | |
| 26 | yaml_path = os.path.join(dir_path, f"{class_name}_vtable.{platform}.yaml") |
| 27 | |
| 28 | if os.path.exists(yaml_path): |
| 29 | with open(yaml_path, 'r', encoding='utf-8') as f: |
| 30 | print(f.read()) |
| 31 | print(f"YAML_EXISTS: True") |
| 32 | else: |
| 33 | print(f"ERROR: Required file {class_name}_vtable.{platform}.yaml not found.") |
| 34 | """ |
| 35 | ``` |
| 36 | |
| 37 | ### 2. Handle Result |
| 38 | |
| 39 | **If YAML exists** (`YAML_EXISTS: True`), extract these values from the output: |
| 40 | - `vtable_va`: The vtable virtual address (use as `<VTABLE_START>`) |
| 41 | - `vtable_rva`: The vtable relative virtual address |
| 42 | - `vtable_size`: The vtable size in bytes |
| 43 | - `vtable_numvfunc`: The valid vtable entry count (last valid index = count - 1) |
| 44 | - `vtable_entries`: An array of virtual functions starting from vtable[0]. |
| 45 | |
| 46 | Example YAML content: |
| 47 | ```yaml |
| 48 | vtable_class: CCSPlayerController |
| 49 | vtable_symbol: _ZTV19CCSPlayerController |
| 50 | vtable_va: 0x221fc80 |
| 51 | vtable_rva: 0x221fc80 |
| 52 | vtable_size: 0xd60 |
| 53 | vtable_numvfunc: 428 |
| 54 | vtable_entries: |
| 55 | - 0x9b4bb0 |
| 56 | - 0x9b4bc0 |
| 57 | - 0x9b4bd0 |
| 58 | ``` |
| 59 | |
| 60 | **If YAML does NOT exist**, **ERROR OUT** and report to user: |
| 61 | ``` |
| 62 | ERROR: Required file {class_name}_vtable.{platform}.yaml not found. |
| 63 | Please run `/write-vtable-as-yaml` with class_name={class_name} first to generate the vtable YAML file. |
| 64 | ``` |
| 65 | Do NOT proceed with any remaining steps in the calling skill. |
| 66 | |
| 67 | ## Usage in Other Skills |
| 68 | |
| 69 | When a skill needs vtable information, use this skill first: |
| 70 | |
| 71 | ```markdown |
| 72 | ### 1. Get {ClassName} VTable Address |
| 73 | |
| 74 | **ALWAYS** Use SKILL `/get-vtable-from-yaml` with `class_name={ClassName}`. |
| 75 | |
| 76 | If the skill returns an error, stop and report to user. |
| 77 | Otherwise, extract `vtable_va`, `vtable_numvfunc` and `vtable_entries` for subsequent steps. |
| 78 | ``` |
| 79 | |
| 80 | ## Expected Output Values |
| 81 | |
| 82 | | Field | Description | Example | |
| 83 | |-------|-------------|---------| |
| 84 | | `vtable_class` | Class name | `CCSPlayerController` | |
| 85 | | `vtable_va` | Virtual address of vtable | `0x2114cd0` | |
| 86 | | `vtable_rva` | Relative virtual address | `0x2114cd0` | |
| 87 | | `vtable_size` | Size in bytes | `0xd60` | |
| 88 | | `vtable_numvfunc` | Number of virtual functions | `428` | |
| 89 | | `vtable_entries` | An array of virtual functions starting from vtable[0] | ... | |