$npx -y skills add HLND2T/CS2_VibeSignatures --skill write-func-as-yamlWrite function analysis results as YAML file beside the binary using IDA Pro MCP. Use this skill after completing function identification and signature generation to persist the results in a standardized YAML format. For virtual functions with known vtable index, use write-vfunc-
| 1 | # Write Function IDA Analysis Output as YAML |
| 2 | |
| 3 | Persist function analysis results to a YAML file beside the binary using IDA Pro MCP. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | Before using this skill, you should have: |
| 8 | 1. Identified and renamed the target function |
| 9 | 2. Generated a unique signature using `/generate-signature-for-function` |
| 10 | |
| 11 | ## Required Parameters |
| 12 | |
| 13 | | Parameter | Description | Example | |
| 14 | |-----------|-------------|---------| |
| 15 | | `func_name` | Name of the function | `CBaseModelEntity_SetModel` | |
| 16 | | `func_addr` | Virtual address of the function | `0x180A8CA10` | |
| 17 | | `func_sig` | Unique byte signature | `41 B8 80 00 00 00 48 8D 99 10 05 00 00` | |
| 18 | |
| 19 | ## Method |
| 20 | |
| 21 | ```python |
| 22 | mcp__ida-pro-mcp__py_eval code=""" |
| 23 | import idaapi |
| 24 | import os |
| 25 | import yaml |
| 26 | |
| 27 | # === REQUIRED: Replace these values === |
| 28 | func_name = "<func_name>" # e.g., "CBaseModelEntity_SetModel" |
| 29 | func_addr = <func_addr> # e.g., 0x180A8CA10 |
| 30 | func_sig = "<func_sig>" # e.g., "41 B8 80 00 00 00" |
| 31 | # ====================================== |
| 32 | |
| 33 | # Get function size |
| 34 | func = idaapi.get_func(func_addr) |
| 35 | func_size = func.size() if func else 0 |
| 36 | |
| 37 | # Get binary path and determine platform |
| 38 | input_file = idaapi.get_input_file_path() |
| 39 | dir_path = os.path.dirname(input_file) |
| 40 | |
| 41 | if input_file.endswith('.dll'): |
| 42 | platform = 'windows' |
| 43 | image_base = idaapi.get_imagebase() |
| 44 | else: |
| 45 | platform = 'linux' |
| 46 | image_base = 0x0 |
| 47 | |
| 48 | func_rva = func_addr - image_base |
| 49 | |
| 50 | data = { |
| 51 | 'func_name': func_name, |
| 52 | 'func_va': hex(func_addr), |
| 53 | 'func_rva': hex(func_rva), |
| 54 | 'func_size': hex(func_size), |
| 55 | 'func_sig': func_sig, |
| 56 | } |
| 57 | |
| 58 | yaml_path = os.path.join(dir_path, f"{func_name}.{platform}.yaml") |
| 59 | with open(yaml_path, 'w', encoding='utf-8') as f: |
| 60 | yaml.dump(data, f, default_flow_style=False, sort_keys=False) |
| 61 | print(f"Written to: {yaml_path}") |
| 62 | """ |
| 63 | ``` |
| 64 | |
| 65 | ## Output File Naming Convention |
| 66 | |
| 67 | The output YAML filename follows this pattern: |
| 68 | - `<func_name>.<platform>.yaml` |
| 69 | |
| 70 | Examples: |
| 71 | - `server.dll` → `CBaseModelEntity_SetModel.windows.yaml` |
| 72 | - `libserver.so` / `libserver.so` → `CBaseModelEntity_SetModel.linux.yaml` |
| 73 | |
| 74 | - `engine2.dll` → `CServerSideClient_IsHearingClient.windows.yaml` |
| 75 | - `libengine2.so` → `CServerSideClient_IsHearingClient.linux.yaml` |
| 76 | |
| 77 | ## Output YAML Format |
| 78 | |
| 79 | ```yaml |
| 80 | func_name: CBaseModelEntity_SetModel |
| 81 | func_va: 0x180A8CA10 # Virtual address - changes with game updates |
| 82 | func_rva: 0xA8CA10 # Relative virtual address (VA - image base) - changes with game updates |
| 83 | func_size: 0x3F # Function size in bytes - changes with game updates |
| 84 | func_sig: 41 B8 80 00 00 00 48 8D 99 10 05 00 00 # Unique byte signature |
| 85 | ``` |
| 86 | |
| 87 | ## Platform Detection |
| 88 | |
| 89 | The skill automatically detects the platform based on file extension: |
| 90 | - `.dll` → Windows (uses `idaapi.get_imagebase()` for image base) |
| 91 | - `.so` → Linux (uses `0x0` as image base) |
| 92 | |
| 93 | ## Notes |
| 94 | |
| 95 | - All values marked "changes with game updates" should be regenerated when analyzing new binary versions |
| 96 | - The YAML file is written to the same directory as the input binary |
| 97 | - func_size is automatically calculated from IDA's function analysis |
| 98 | - func_rva is automatically calculated as `func_va - image_base` |
| 99 | - For virtual functions with vtable information, use `/write-vfunc-as-yaml` instead |