$npx -y skills add HLND2T/CS2_VibeSignatures --skill get-func-from-yamlLoad function information from a pre-generated YAML file. Use this skill when you need function address, size, signature, and optional vtable metadata before downstream analysis. This skill checks for existing function YAML files and errors out if not found.
| 1 | # Get Function from YAML |
| 2 | |
| 3 | Load function information from a pre-generated `{func_name}.{platform}.yaml` file beside the binary. |
| 4 | |
| 5 | ## Parameters |
| 6 | |
| 7 | - `func_name`: The function name to look up (e.g., `CBaseModelEntity_SetModel`, `CCSPlayerController_ChangeTeam`, `CEntityInstance_AcceptInput`) |
| 8 | |
| 9 | ## Method |
| 10 | |
| 11 | ### 1. Check and Load Function YAML |
| 12 | |
| 13 | Run the following code with the appropriate `func_name`: |
| 14 | |
| 15 | ```python |
| 16 | mcp__ida-pro-mcp__py_eval code=""" |
| 17 | import idaapi |
| 18 | import os |
| 19 | |
| 20 | func_name = "<FUNC_NAME>" # Replace with actual function 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"{func_name}.{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("FUNC_YAML_EXISTS: True") |
| 32 | else: |
| 33 | print(f"ERROR: Required file {func_name}.{platform}.yaml not found.") |
| 34 | """ |
| 35 | ``` |
| 36 | |
| 37 | ### 2. Handle Result |
| 38 | |
| 39 | **If YAML exists** (`FUNC_YAML_EXISTS: True`), extract available values from the output: |
| 40 | - `func_name`: Function name (if present) |
| 41 | - `func_va`: Function virtual address (if present) |
| 42 | - `func_rva`: Function relative virtual address (if present) |
| 43 | - `func_size`: Function size in bytes (if present) |
| 44 | - `func_sig`: Function signature bytes (if present) |
| 45 | - `vtable_name`: Related vtable class name (optional, virtual-function YAML only) |
| 46 | - `vfunc_offset`: Offset from vtable start (optional, virtual-function YAML only) |
| 47 | - `vfunc_index`: Index in vtable (optional, virtual-function YAML only) |
| 48 | |
| 49 | Example YAML content: |
| 50 | ```yaml |
| 51 | func_name: CCSPlayerController_Respawn |
| 52 | func_va: 0x180A8CA10 |
| 53 | func_rva: 0xA8CA10 |
| 54 | func_size: 0x3F |
| 55 | func_sig: 41 B8 80 00 00 00 48 8D 99 10 05 00 00 |
| 56 | vtable_name: CCSPlayerController |
| 57 | vfunc_offset: 0x330 |
| 58 | vfunc_index: 102 |
| 59 | ``` |
| 60 | |
| 61 | If some fields are missing, use only the fields that exist in YAML and **do not fabricate values**. |
| 62 | |
| 63 | **If YAML does NOT exist**, **ERROR OUT** and report to user: |
| 64 | ``` |
| 65 | ERROR: Required file {func_name}.{platform}.yaml not found. |
| 66 | Please run `/write-func-as-yaml` with func_name={func_name} first. |
| 67 | For virtual functions, `/write-vfunc-as-yaml` is also acceptable. |
| 68 | ``` |
| 69 | Do NOT proceed with any remaining steps in the calling skill. |
| 70 | |
| 71 | ## Usage in Other Skills |
| 72 | |
| 73 | When a skill needs function information, use this skill first: |
| 74 | |
| 75 | ```markdown |
| 76 | ### 1. Get {FuncName} Function Info |
| 77 | |
| 78 | **ALWAYS** Use SKILL `/get-func-from-yaml` with `func_name={FuncName}`. |
| 79 | |
| 80 | If the skill returns an error, stop and report to user. |
| 81 | Otherwise, extract `func_va`, `func_sig`, and other available fields for subsequent steps. |
| 82 | ``` |
| 83 | |
| 84 | ## Example Output |
| 85 | |
| 86 | | Field | Description | Example | |
| 87 | |-------|-------------|---------| |
| 88 | | `func_name` | Function name | `CCSPlayerController_Respawn` | |
| 89 | | `func_va` | Virtual address of function (optional in some virtual-function YAML) | `0x180A8CA10` | |
| 90 | | `func_rva` | Relative virtual address (optional) | `0xA8CA10` | |
| 91 | | `func_size` | Function size in bytes (optional) | `0x3F` | |
| 92 | | `func_sig` | Byte signature (optional) | `41 B8 80 00 00 00 ...` | |
| 93 | | `vtable_name` | Related class name for virtual function (optional) | `CCSPlayerController` | |
| 94 | | `vfunc_offset` | Offset from vtable start (optional) | `0x330` | |
| 95 | | `vfunc_index` | Index in vtable (optional) | `102` | |