CS2_VibeSignatures: Skill for Claude Code

.claude/skills/generate-signature-for-structoffset/SKILL.md

generate-signature-for-structoffset is a skill for Claude Code from HLND2T/CS2_VibeSignatures. It costs 109 tokens per session (3,175 once invoked), scanned A, original, MIT.

A tool for creating and checking a byte pattern that identifies an instruction containing a structure-member offset. A byte pattern is a sequence used to locate the same machine-code instruction in another binary.

In plain words
What is it for?
Use it with IDA Pro when you have an instruction such as `mov [rcx+1A8h], eax` and need a unique signature for it.
Why use it?
It helps locate the relevant instruction without relying on a whole function staying unchanged, while ensuring the important offset remains part of the match.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is HLND2T/CS2_VibeSignatures's own configuration. It tells Claude Code how to work on CS2_VibeSignatures itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything CS2_VibeSignatures configures →

Reuse

Borrowing it

Nothing to install: this file belongs to HLND2T/CS2_VibeSignatures. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/HLND2T/CS2_VibeSignatures/main/.claude/skills/generate-signature-for-structoffset/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/HLND2T/CS2_VibeSignatures

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-signature-for-structoffset

README.md
[![agentmods](https://agentmods.dev/badge/skills/hlnd2t/cs2_vibesignatures/generate-signature-for-structoffset/github.svg)](https://agentmods.dev/skills/hlnd2t/cs2_vibesignatures/generate-signature-for-structoffset)
Your own site
<a href="https://agentmods.dev/skills/hlnd2t/cs2_vibesignatures/generate-signature-for-structoffset"><img src="https://agentmods.dev/badge/skills/hlnd2t/cs2_vibesignatures/generate-signature-for-structoffset/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-signature-for-structoffset

Your own site · 80×15
<a href="https://agentmods.dev/skills/hlnd2t/cs2_vibesignatures/generate-signature-for-structoffset"><img src="https://agentmods.dev/badge/skills/hlnd2t/cs2_vibesignatures/generate-signature-for-structoffset.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,175 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00109 $0.03175
Opus 5 $0.00055 $0.01588
Sonnet 5 $0.00022 $0.00635
Haiku 4.5 $0.00011 $0.00317

Measured 10d ago against content hash 31bbc7a9322a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

generate-signature-for-structoffset scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/generate-signature-for-structoffset/SKILL.md · 336 lines

How it starts

The opening of the file, as written. The whole thing — 336 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate Signature for Struct Offset

Generate a unique hex byte signature that locates an instruction containing a specific struct member offset (for example: mov [rcx+1A8h], eax, cmp dword ptr [rdi+0B0h], 0).

Core Concept

For struct-offset signatures, we signature the instruction containing the struct offset, not the function body itself.

Hard requirements:

  1. The target instruction must be fully fixed (no wildcard bytes at all).
  2. The displacement bytes carrying struct_offset in the target instruction must be explicitly included (not wildcarded).
  3. Instructions other than the target instruction may use wildcarding.
  4. Signature length grows by complete instruction boundaries and stops at the shortest unique prefix.

Strategy:

  • Forward-only expansion: Expand only forward (after target instruction). The signature may extend beyond the current function boundary into CC padding or the next function. offset_sig_disp is always 0 — the signature always starts at the target instruction.

Prerequisites

  • Target instruction address (the instruction that contains the struct offset)
  • Expected struct_offset value (e.g. 0x1A8)
  • IDA Pro MCP connection

Method

1. Generate and Validate Signature (Single Step)

Use a single py_eval call that:

  • Validates the input instruction contains the expected struct_offset displacement.
  • Collects instruction bytes from the target instruction forward, tests uniqueness.
  • Forward-only expansion (no backward expansion — offset_sig_disp is always 0).
  • Enforces no wildcard on the target instruction.
  • Computes both VA and RVA for the target instruction.
  • Outputs the shortest unique signature as struct_sig with metadata.
mcp__ida-pro-mcp__py_eval code="""
import idaapi, ida_bytes, idautils, ida_ua, ida_segment, json

def main():
    target_inst = <inst_addr>
    target_struct_offset = <struct_offset>   # e.g. 0x1A8 from "mov [rcx+1A8h], eax"
    min_sig_bytes = 6
    max_sig_bytes = 96
    max_instructions = 64

    # --- Binary search wrapper (IDA 9.0+ find_bytes -> older bin_search fallback) ---
    def raw_bin_search(ea, max_ea, data, mask, flags=0):
        if hasattr(ida_bytes, 'find_bytes'):
            return ida_bytes.find_bytes(data, ea, range_end=max_ea, mask=mask, flags=flags)
        return ida_bytes.bin_search(ea, max_ea, data, mask, len(data), flags)

    f = idaapi.get_func(target_inst)
    if not f:
        print(json.dumps({
            "inst_va": hex(target_inst),
            "error": "target instruction is not inside a known function",
            "status": "failed"
        }))
        return

    insn0 = idautils.DecodeInstruction(target_inst)
    if not insn0 or insn0.size <= 0:
        print(json.dumps({
            "inst_va": hex(target_inst),
            "error": "failed to decode target instruction",
            "status": "failed"
        }))
        return

    raw0 = ida_bytes.get_bytes(target_inst, insn0.size)
    if not raw0:
        print(json.dumps({
            "inst_va": hex(target_inst),
            "error": "failed to read target instruction bytes",
            "status": "failed"
        }))
        return

    def find_struct_disp_matches(insn, raw, expected):
        hits = []
        for op in insn.ops:
            ot = int(op.type)
            if ot == int(idaapi.o_void):
                continue
            if ot not in (int(idaapi.o_displ), int(idaapi.o_mem), int(idaapi.o_imm)):
                continue

            for attr in ("offb", "offo"):
                off = int(getattr(op, attr, 0))
                if off <= 0 or off >= insn.size:
                    continue

                sizes = []
                dsz = ida_ua.get_dtype_size(getattr(op, "dtype", getattr(op, "dtyp", 0)))
                if dsz > 0:
                    sizes.append(dsz)
                for s in (1, 2, 4, 8):
                    if s not in sizes:
                        sizes.append(s)

                for sz in sizes:
                    if off + sz > insn.size:
                        continue
                    unsigned_val = int.from_bytes(raw[off:off + sz], "little", signed=False)
                    signed_val = int.from_bytes(raw[off:off + sz], "little", signed=True)
                    expected_mod = expected & ((1 << (8 * sz)) - 1)
                    if unsigned_val == expected_mod or signed_val == expected:
                        hits.append((off, sz, unsigned_val, signed_val))

        uniq = []
        seen = set()
        for h in hits:
            key = (h[0], h[1])
            if key not in seen:
                seen.add(key)
                uniq.append(h)
        return uniq

    disp_hits = find_struct_disp_matches(insn0, raw0, target_struct_offset)
    if not disp_hits:
        print(json.dumps({
            "inst_va": hex(target_inst),
            "inst_bytes": " ".join(f"{b:02X}" for b in raw0),
            "struct_offset": hex(target_struct_offset),
            "error": "target instruction does not contain the expected struct offset",
            "status": "failed"
        }))
        return

    # Prefer the largest matching displacement size so we lock the full offset bytes.
    disp_hits.sort(key=lambda x: (x[1], -x[0]), reverse=True)
    disp_off, disp_size, _, _ = disp_hits[0]

    seg = ida_segment.get_segm_by_name(".text")
    if seg:
        search_start, search_end = seg.start_ea, seg.end_ea
    else:
        search_start, search_end = idaapi.cvar.inf.min_ea, idaapi.cvar.inf.max_ea

    # --- Helper: wildcard non-target instructions ---
    def wildcard_instruction(addr, insn_obj, raw_bytes):
        wild = set()
        for op in insn_obj.ops:
            ot = int(op.type)
            if ot == int(idaapi.o_void):
                continue
            if ot in (int(idaapi.o_imm), int(idaapi.o_near), int(idaapi.o_far), int(idaapi.o_mem), int(idaapi.o_displ)):
                offb = int(getattr(op, "offb", 0))
                if offb > 0 and offb < insn_obj.size:
                    dsz = ida_ua.get_dtype_size(getattr(op, "dtype", getattr(op, "dtyp", 0)))
                    if dsz <= 0:
                        dsz = insn_obj.size - offb
                    for i in range(offb, min(insn_obj.size, offb + dsz)):
                        wild.add(i)

                offo = int(getattr(op, "offo", 0))
                if offo > 0 and offo < insn_obj.size:
                    dsz2 = ida_ua.get_dtype_size(getattr(op, "dtype", getattr(op, "dtyp", 0)))
                    if dsz2 <= 0:
                        dsz2 = insn_obj.size - offo
                    for i in range(offo, min(insn_obj.size, offo + dsz2)):
                        wild.add(i)

        # Branch/call rel targets are volatile.
        b0 = raw_bytes[0]
        if b0 in (0xE8, 0xE9, 0xEB):
            for i in range(1, insn_obj.size):
                wild.add(i)
        elif b0 == 0x0F and insn_obj.size >= 2 and (raw_bytes[1] & 0xF0) == 0x80:
            for i in range(2, insn_obj.size):
                wild.add(i)
        elif 0x70 <= b0 <= 0x7F:
            for i in range(1, insn_obj.size):
                wild.add(i)

        tokens = []
        for idx in range(insn_obj.size):
            tokens.append("??" if idx in wild else f"{raw_bytes[idx]:02X}")
        return tokens

    # --- Helper: test uniqueness of a token list, expecting match at expected_addr ---
    def test_unique(tokens, expected_addr):
        if all(t == "??" for t in tokens):
            return False
        data = bytes(0 if t == "??" else int(t, 16) for t in tokens)
        mask = bytes(0x00 if t == "??" else 0xFF for t in tokens)
        flags = ida_bytes.BIN_SEARCH_FORWARD | ida_bytes.BIN_SEARCH_NOBREAK

        matches = []
        ea = raw_bin_search(search_start, search_end, data, mask, flags)
        while ea != idaapi.BADADDR and len(matches) < 2:
            matches.append(ea)
            ea = raw_bin_search(ea + 1, search_end, data, mask, flags)

        return len(matches) == 1 and matches[0] == expected_addr

    # ====================================================================
    # Forward-only expansion (signature starts at target_inst)
    # May extend beyond the current function into CC padding or next function.
    # ====================================================================
    limit_end = target_inst + max_sig_bytes
    fwd_tokens = []
    fwd_boundaries = []
    cursor = target_inst
    inst_count = 0
    target_inst_len = None

    while (
        cursor < search_end
        and cursor < limit_end
        and len(fwd_tokens) < max_sig_bytes
        and inst_count < max_instructions
    ):
        insn = idautils.DecodeInstruction(cursor)
        if not insn or insn.size <= 0:
            break
        raw = ida_bytes.get_bytes(cursor, insn.size)
        if not raw:
            break

        if cursor == target_inst:
            # Target instruction: fully fixed, no wildcards.
            target_inst_len = insn.size
            for idx in range(insn.size):
                if len(fwd_tokens) < max_sig_bytes:
                    fwd_tokens.append(f"{raw[idx]:02X}")
        else:
            toks = wildcard_instruction(cursor, insn, raw)
            for t in toks:
                if len(fwd_tokens) < max_sig_bytes:
                    fwd_tokens.append(t)

        fwd_boundaries.append(len(fwd_tokens))
        cursor += insn.size
        inst_count += 1

    if target_inst_len is None:
        print(json.dumps({
            "inst_va": hex(target_inst),
            "error": "no signature bytes collected",
            "status": "failed"
        }))
        return

    min_boundary = max(min_sig_bytes, target_inst_len)

    # Try expanding at each instruction boundary until unique
    phase1_sig = None
    phase1_boundary = 0
    for boundary in fwd_boundaries:
        if boundary < min_boundary:
            continue
        prefix = fwd_tokens[:boundary]
        if test_unique(prefix, target_inst):
            phase1_sig = " ".join(prefix)
            phase1_boundary = boundary
            break

    if phase1_sig:
        print(json.dumps({
            "struct_sig": phase1_sig,
            "sig_bytes": phase1_boundary,
            "struct_sig_va": hex(target_inst),
            "offset_sig_disp": 0,
            "struct_inst_length": target_inst_len,
            "struct_disp_offset": disp_off,
            "struct_disp_size": disp_size,
            "struct_offset": hex(target_struct_offset),
            "status": "success"
        }))
        return

    # Forward-only expansion exhausted without finding a unique signature.
    print(json.dumps({
        "struct_sig_va": hex(target_inst),
        "struct_offset": hex(target_struct_offset),
        "first_inst_bytes": " ".join(f"{b:02X}" for b in raw0),
        "total_fwd_tokens": len(fwd_tokens),
        "sig_full_fwd": " ".join(fwd_tokens),
        "error": "no unique signature found with forward-only expansion",
        "status": "failed"
    }))

main()
"""

Read the full file on GitHub · 336 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 336 lines · 109 tokens per session scan A 31bbc7a9322a

Subscribe to this mod's changes

generate-signature-for-structoffset is a skill published in the GitHub repository HLND2T/CS2_VibeSignatures (65 stars, last pushed today), licensed MIT. It adds 109 tokens to every session and 3,175 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens