re-zig

re-zig is a skill for Claude Code from dslsdzc/rev-skills. It costs 57 tokens per session (2,543 once invoked), scanned A, original, Apache-2.0.

A guide to examining compiled Zig programs, including how Zig-specific error handling, panics, compile-time code, and C interfaces appear in machine code. Reverse engineering means studying a compiled program to understand its behaviour.

In plain words
What is it for?
Use it to identify Zig binaries, trace panic and error paths, inspect C ABI boundaries, and compare compiled output with a Zig build when needed.
Why use it?
Compiled programs often hide the original source structure, and Zig has patterns that differ from C and C++ programs. Recognising those patterns helps avoid misreading the binary.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to identify Zig binaries, trace panic and error paths, inspect C ABI boundaries, and compare compiled output with a Zig build when needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dslsdzc/rev-skills/re-zig
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dslsdzc/rev-skills --skill re-zig
Clone the repo
git clone --depth 1 https://github.com/dslsdzc/rev-skills

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 re-zig

README.md
[![agentmods](https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-zig.svg)](https://agentmods.dev/skills/dslsdzc/rev-skills/re-zig)
Your own site
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-zig"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-zig.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,543 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.00057 $0.02543
Opus 5 $0.00028 $0.01272
Sonnet 5 $0.00011 $0.00509
Haiku 4.5 $0.00006 $0.00254

Measured 4d ago against content hash 49da98571d7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

re-zig 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 4d 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/re-zig/SKILL.md · 121 lines

How it starts

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

Zig 逆向

何时使用 / 何时不用

  • 用:Zig 产物(无 C++ RTTI/异常表、panic 函数链特征、_start → main 启动形态),需要还原错误处理路径、C ABI 边界、comptime 展开后的行为
  • 用:Zig/C 混合产物中区分 Zig 侧代码(无 RTTI 侧 + Zig 符号模式)
  • 不用:C/C++ 产物(走 [[re-cpp-abi]];有 RTTI/异常表即非 Zig 单方产物)
  • 不用:只需函数逻辑(直接反编译技能)

工具准备

readelf / llvm-nm(符号与节分析)

  • 安装与验证见 [[re-cpp-abi]] 工具准备
  • 用途: readelf -S 查异常表节;readelf -s/llvm-nm 查符号与可见性(Zig 业务函数多为 LOCAL 符号)

llvm-objdump / objdump(反汇编)

  • 安装与验证见 [[re-cpp-abi]] 工具准备
  • 用途: 定位 panic 调用点、catch/orelse 的错误码比较(cmpw + 分支)

Ghidra / IDA(反编译底座)

  • 安装与验证见 [[re-ghidra]] / [[re-ida]]
  • Zig 产物无类型信息(无 DWARF 时),配合行为分析(见步骤 3/4)

strings(字符串池/错误名)

  • 系统自带;验证: strings --version
  • 用途: @errorName 错误名字符串、panic 消息、格式串定位

zig 编译器(可选,对照编译)

  • 官方 tarball / brew install zig / Windows 官方安装器;验证: zig version
  • 用途: 同版本编译对照产物,验证 panic 链/错误联合布局(版本差异大,见 [[layout]])

操作步骤

按顺序执行,每步产物存档(路径 + sha256,见 [[re-triage]])。

  1. 产物识别

    readelf -s sample | grep -iE 'panicking|panicExtra|defaultPanic|zig' | head
    readelf -S sample | grep gcc_except_table   # 应无输出(Zig 产物常带 .eh_frame,不能作判别)
    readelf -s sample | grep __gxx_personality_v0   # 应无匹配
    readelf -s sample | grep -wE '_start|main'      # 启动形态
    
    • Zig 特征:panic 函数链(debug.panicExtra/debug.panicking 等,版本相关)、std 符号模式(std.debug.print 等)、无 C++ RTTI/异常表(对比 [[re-cpp-abi]] 的 RTTI/异常密集特征)
    • 判别组合:无 .gcc_except_table + 无 __gxx_personality_v0 + 无 _ZTV*(RTTI vtable)→ 无 C++ 异常机制;.eh_frame 两者都有,不能单独作判据
    • 与 C 混合编译:Zig 符号与 C 符号共存(见步骤 5 边界)
  2. 符号可见性与启动路径

    readelf -s sample | grep -E 'GLOBAL|LOCAL' | grep -cE 'FUNC'
    readelf -s sample | grep -wE '_start|main' | head
    
    • 启动路径:_start(GLOBAL)→ 运行时初始化(std.start)→ main(LOCAL);Zig 的 main 是普通函数,入口经 std.start 包裹(exit 处理在包裹层)
    • 符号可见性:Zig 默认只导出 _start 与显式 export 的函数,业务函数是 LOCAL 符号(debug/ReleaseSafe 符号表仍在,ReleaseFast 可 strip)——nm 看得到不等于导出,hook/注入面按导出表算
    • comptime 展开产物:编译期计算已内联/展开——无对应源码结构,按行为分析(见坑 1)
  3. panic/错误处理路径

    readelf -s sample | grep -iE 'panic' | head        # panic 链符号(版本相关命名)
    
    • panic 链:@panic/断言失败 → panic 函数(打印 + abort)——定位 panic 调用点可找输入校验/不变量;panic 处理函数本身是"打印+退出",调用点才是业务校验
    • 错误联合(error union):!T 类型,布局按载荷大小分两种(小载荷 8 字节槽、错误码在高位;大载荷错误码在前、载荷按对齐内联——[[layout]] 有实测表);调用点检查 orelse/catch 分支(编译为错误码比较 + 分支)
    • 分析:错误路径是逆向重点(校验逻辑、失败分支)——错误码比较点即分支条件,错误名可经 @errorName 字符串池还原
    • 错误名还原:@errorName(e) 的字符串在 __zig_tag_name_* 符号/字符串池——strings 里错误名与代码路径直接对应,是错误语义的第一手线索

Read the full file on GitHub · 121 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 121 lines · 57 tokens per session scan A 49da98571d7e

Subscribe to this mod's changes

re-zig is a skill published in the GitHub repository dslsdzc/rev-skills (46 stars, last pushed 9d ago), licensed Apache-2.0. It adds 57 tokens to every session and 2,543 once invoked, about $0.0003 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-09-03.

Related

Other skills, from other repositories

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware in Ghidra by parsing Go buildinfo and pclntab structures, recovering stripped/obfuscated function names (e.g. via GoResolver), and extracting embedded module/dependency strings and types from Go binaries. Use when analyzing a Go-language malware sample, deobfuscating a…

Youngmaidainon/Agent-Level-Up · 95 tokens

go-rust-reverse

Use for reverse engineering stripped Go and Rust binaries including runtime recognition, pclntab/moduel data recovery, panic strings, and idiomatic decompilation recovery.

Asaiuta/reverse-workbench-skill · 38 tokens

rust-check

Run cargo check on the current Rust project to find compile errors.

Hmbown/CodeWhale · 15 tokens

stack-trace-rust-probe

Internal helper for meta-stack-trace-investigator. Use when a Rust panic or backtrace needs Rust-specific Result/Option checks, cargo test guidance, and patch targets.

opensquilla/opensquilla · 42 tokens

hotpath_init

Configure hotpath profiling in a Rust project. Adds the hotpath dependency with feature-gated setup, instruments main with hotpath::main, functions with measure/measureall, and wraps channels, mutexes, rwlocks, streams, futures, reqwest clients, axum routers and byte-level I/O with hotpath macros. Use when the user…

pawurb/hotpath-rs · 88 tokens

Reverse Engineering & Binary Analysis

Binary analysis, assembly interpretation, disassembly, decompilation, firmware RE, and protocol reverse engineering.

Masriyan/Claude-Code-CyberSecurity-Skill · 26 tokens