npx skills add ...
npx skills add p4nda0s/reverse-skills --skill rev-struct
Reconstruct data structures by analyzing memory access patterns across functions
npx skills add p4nda0s/reverse-skills --skill rev-struct
Recover data structure definitions by analyzing memory access patterns in functions and their call chains.
Determine which IDA access method is available:
Option A — IDA Pro MCP (preferred if connected):
Check if the IDA Pro MCP server is connected (look for an active ida-pro or equivalent MCP connection). If connected, you can query IDA directly via MCP tools — no exported files needed. Proceed with the analysis using MCP.
Option B — IDA-NO-MCP exported data: If MCP is not connected, check if IDA-NO-MCP exported data exists in the current directory:
decompile/ directory exists.c files insideIf neither MCP nor exported data is available, prompt the user:
Each .c file contains function metadata comments and decompiled code:
decompile/<address>.cSearch for the following patterns in the target function:
Direct offset access:
Array access:
Nested structures:
Record format:
Read each caller function and analyze:
Parameter passing: What is passed when calling?
Operations before/after the call:
Collect more offset accesses
Read each callee function and analyze:
How parameters are used:
Passed to other functions:
strlen/printf → string pointer./
├── decompile/ # Decompiled C code directory
│ ├── 0x401000.c # One file per function, named by hex address
│ ├── 0x401234.c
│ └── ...
├── decompile_failed.txt # Failed decompilation list
├── decompile_skipped.txt # Skipped functions list
├── strings.txt # String table (address, length, type, content)
├── imports.txt # Import table (address:function_name)
├── exports.txt # Export table (address:function_name)
└── memory/ # Memory hexdump (1MB chunks)/*
* func-name: sub_401000
* func-address: 0x401000
* callers: 0x402000, 0x403000 // List of functions that call this function
* callees: 0x404000, 0x405000 // List of functions called by this function
*/
int __fastcall sub_401000(int a1, int a2)
{
// Decompiled code...
}*(a1 + 0x10) // offset 0x10
*(_DWORD *)(a1 + 8) // offset 0x8, DWORD type
*(_QWORD *)(a1 + 0x20) // offset 0x20, QWORD type
*(_BYTE *)(a1 + 4) // offset 0x4, BYTE type*(a1 + 8 * i) // array, element size 8 bytes
a1[i] // array access*(*a1 + 0x10) // first field of struct pointed by a1 is a pointeroffset=0x00, size=8, access=read/write, type=QWORD
offset=0x08, size=4, access=read, type=DWORD
...