re-address-space

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

A guide to converting addresses between a program file, its virtual memory location, and its runtime location. It explains PIE and ASLR, which can move a program's load address, plus firmware and reverse-engineering tool offsets.

In plain words
What is it for?
Use it to calculate file-offset, RVA, and virtual-address conversions, determine runtime bases for PIE or ASLR programs, and align addresses across tools.
Why use it?
It helps explain why the same code address differs between a file, a debugger, memory maps, and tools such as Ghidra or angr.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to calculate file-offset, RVA, and virtual-address conversions, determine runtime bases for PIE or ASLR programs, and align addresses across tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dslsdzc/rev-skills/re-address-space
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-address-space
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-address-space

README.md
[![agentmods](https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-address-space/github.svg)](https://agentmods.dev/skills/dslsdzc/rev-skills/re-address-space)
Your own site
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-address-space"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-address-space/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 re-address-space

Your own site · 80×15
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-address-space"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-address-space.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,090 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.00097 $0.02090
Opus 5.5 $0.00039 $0.00836
Sonnet 5.5 $0.00019 $0.00418
Haiku 4.5 $0.00010 $0.00209

Measured 2mo ago against content hash 3095987971a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

re-address-space 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 2mo 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-address-space/SKILL.md · 101 lines

How it starts

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

地址空间换算(PIE / ASLR / 基址 / RVA-VA)

入口判定(Decision Gate)

地址相关问题
├── 静态文件(无运行态): VA/RVA/文件偏移换算 ──→ 本技能(步骤 1-2)
├── 运行态(进程/内存): 基址确定(PIE/ASLR)──→ 本技能(步骤 3)+ /proc/pid/maps
├── 跨工具对齐(Ghidra 显示 vs 运行时 vs angr)──→ 本技能(步骤 4)
└── 固件加载地址 vs 链接地址差 ──→ 本技能(步骤 5)

何时使用 / 何时不用

  • 用:任何「这个地址对不上」问题——反编译器显示地址 ≠ 运行时地址 ≠ find 到的地址
  • 用:PIE/ASLR 二进制需要换算运行时基址(frida Process.getModuleByName(...).base / gdb info proc mappings / maps 文件)
  • 用:RVA/VA 互转、文件偏移与虚拟地址互转、固件加载地址与链接地址差
  • 不用:只是读 ELF 头/节表(走 [[re-format-elf]])
  • 不用:运行时内存布局细查(走 [[re-memdump]] / [[re-gdb]])

工具准备

所有工具先验证再使用。全部为静态/轻量命令,可免沙箱。

readelf / objdump(binutils)—— 文件侧基址与段信息

  • Linux: apt install binutils / dnf install binutils / pacman -S binutils(多数预装)
  • 验证: readelf --version;objdump --version

gdb —— 运行态基址(跨 OS,见 [[re-gdb]])

  • 安装与验证见 [[re-gdb]] 工具准备

python3 —— 换算脚本

  • 安装与验证见 [[re-python]] 工具准备

操作步骤

  1. 确定文件侧基址(静态):

    readelf -l target | grep LOAD        # 首个 LOAD 段 p_vaddr 即链接基址(ET_EXEC 固定;ET_DYN/PIE 为 0 起相对)
    readelf -h target | grep Type        # EXEC(固定基址)/ DYN(PIE,运行时才定基址)
    
    • 链接基址(link-time base):取最低 PT_LOAD 的 p_vaddr(页对齐)——不要假设 PIE/ET_DYN 的 p_vaddr 必为 0,格式没这条要求;PIE 下常见 0,但也可能非 0(如 0x1000 起的布局)。load_bias = 运行时映射起点 − 最低 p_vaddr(见步骤 3)
    • 文件偏移 ↔ VA:VA = p_vaddr + (file_offset - p_offset)(按段匹配,别用全文件线性换算)
  2. RVA / VA 换算:

    RVA = VA - ImageBase(PE 语境)
    VA  = RVA + ImageBase
    
    • ELF 无统一 ImageBase 概念——用「链接基址 + 段偏移」;PE 用节表(RVA → 文件偏移按节)
    • 32/64 位宽度影响地址表示,不影响换算逻辑
  3. 运行态基址(PIE / ASLR):

    cat /proc/<pid>/maps | head -5        # 加载基址 = 首个映射(r--p,file offset 0x0)起点(Linux)
    gdb -p <pid> -ex 'info proc mappings' -ex detach   # 或 gdb 侧(跨平台)
    
    • 布局差异(separate-code):gcc 默认 PIE 下首个 LOAD 是 R-- 段(p_vaddr=0),代码段在其后(p_vaddr=0x1000 起);老式布局(无 separate-code)首个 LOAD 即 R E(p_vaddr=0)——取加载基址用首个映射(r--p)起点;若用首个 r-xp 起点须减去该段自身 p_vaddr,两种布局结果才一致
    • frida:Process.getModuleByName("libtarget.so").base(Frida 17+:静态 Module.findBaseAddress / Module.getBaseAddress 已移除,旧版本文法见 [[re-frida-script-author]])
    • 运行时地址 = 链接地址 + load bias——bias = 运行时基址 - 链接基址;PIE 每次运行 bias 不同(ASLR),脚本必须动态取
    • 换算:runtime_addr = link_addr + bias(如链接 0x1000 的符号在运行时 0x1000 + 0x7f0000000000)

Read the full file on GitHub · 101 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. 2mo ago Changed 3095987971a3
  2. 3mo ago First seen · 101 lines · 97 tokens per session scan A 783d10fe54e3

Subscribe to this mod's changes

re-address-space is a skill published in the GitHub repository dslsdzc/rev-skills (275 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 97 tokens to every session and 2,090 once invoked, about $0.0004 per session on Opus 5.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

re-address-space compared with skills from other repositories

re-address-space next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
re-address-spacedslsdzc/rev-skillsSkill2751mo agoApache-2.0A97Claude Code
deobfuscating-powershell-obfuscated-malwareYoungmaidainon/Agent-Level-UpSkill43mo agoMITA90Claude Code, Codex
conducting-malware-incident-responseYoungmaidainon/Agent-Level-UpSkill43mo agoMITA78Claude Code, Codex
analyzing-golang-malware-with-ghidraMikaru0Mystic/sectinelSkill135mo agoApache-2.0A40Claude Code
analyzing-golang-malware-with-ghidraYoungmaidainon/Agent-Level-UpSkill43mo agoMITA95Claude Code, Codex
analyzing-network-covert-channels-in-malwareYoungmaidainon/Agent-Level-UpSkill43mo agoMITA90Claude Code, Codex
analyzing-heap-spray-exploitationYoungmaidainon/Agent-Level-UpSkill43mo agoMITA46Claude Code, Codex