AGENT SKILL

linker-fake-load-unwrapper

Use when analyzing Android AArch64 ELF files protected by a special linker-style fake PT_LOAD wrapper, impossible high-address LOAD segments, entry-point translation such as e_entry minus fake p_vaddr, XOR runtime decryptors, embedded ELF carving, shell-looking ELF second stages, or when a user mentions linker 加固/脱壳/通杀. Provides static and dynamic workflows, tools, and principles for recovering the real runtime image.

License 许可
GPL-3.0
最近更新
2026-09-30
Stars
★ 64
Forks
19

01 前言 Front Matter

name
linker-fake-load-unwrapper
description
Use when analyzing Android AArch64 ELF files protected by a special linker-style fake PT_LOAD wrapper, impossible high-address LOAD segments, entry-point translation such as e_entry minus fake p_vaddr, XOR runtime decryptors, embedded ELF carving, shell-looking ELF second stages, or when a user mentions linker 加固/脱壳/通杀. Provides static and dynamic workflows, tools, and principles for recovering the real runtime image.
x-alice-class
assist

02 资源文件 3

03 SKILL.md 正文

Linker Fake-Load Unwrapper

Core idea

This protector abuses ELF program headers so the visible entry and memory layout look abnormal. Do not guess fixed offsets. Derive the real file entry from PHDR evidence, decode the entry stub, recover XOR ranges/key, then reconstruct the runtime image.

Fast path

python <skill-dir>\scripts\linker_static_unwrap.py <target> --out-dir <out>

Expected outputs:

  • <target>.linker_xor_runtime.bin — reconstructed runtime image.
  • linker_static_unwrap_report.json — PHDRs, fake LOAD, true entry offset, XOR ranges, carved embedded ELFs, interesting strings.
  • embedded_elfs/ — candidate inner ELF payloads/interpreters.

The script intentionally refuses to proceed if it cannot find the fake LOAD or recover XOR ranges; do not hardcode offsets unless you first write down why the PHDR-derived method fails.

Static analysis procedure

  1. Parse ELF64 little-endian AArch64 header and PHDRs.
  2. Find fake LOAD candidate:
    • p_type == PT_LOAD
    • p_offset == 0
    • p_filesz > file_size
    • high p_vaddr such as 0xffff0000 or huge p_filesz
    • e_entry falls inside p_vaddr .. p_vaddr + p_filesz
  3. Translate true entry:
    • true_entry_file_offset = e_entry - fake.p_vaddr + fake.p_offset
  4. Disassemble AArch64 stub at real file entry.
  5. Recover repeated decrypt calls:
    • key usually arrives in w3/x3 as an immediate byte.
    • target pointer and size are often loaded through PC-relative ldr literals into x2 and x1.
    • each bl after those loads applies XOR to a runtime range.
  6. Map target VAs through normal LOADs, not the fake one, then XOR file bytes.
  7. Carve embedded ELF blobs and inspect sections/PHDRs/UPX markers.
  8. Validate runtime by string diff, embedded ELF parse, and dynamic dump comparison when possible.

Dynamic confirmation procedure

Use dynamic dumping when:

  • Capstone cannot recover stub ranges.
  • The key/ranges are computed instead of literal-loaded.
  • The runtime later decrypts another stage.
  • Static runtime and device behavior disagree.

On Android:

  1. Run the target in a controlled directory.
  2. Monitor /proc/<pid>/maps for file-backed or anonymous executable mappings.
  3. Dump relevant mappings through /proc/<pid>/mem as root.
  4. Prefer parent-child dumpers for short-lived children.
  5. Compare dump SHA256/strings/ELF offsets with static runtime.

Validation gates

A result is not “done” until these checks can fail and pass:

  • Original hash recorded.
  • Fake LOAD and true entry offset recorded.
  • XOR ranges/key recorded or dynamic replacement evidence recorded.
  • Runtime image exists and has hash.
  • Embedded ELF offsets or absence thereof documented.
  • If business logic is expected, stack/heap/memfd plaintext search performed.

Reference routing

Read references/linker-fake-load-principles.md for the detailed protector model, failure modes, dynamic fallback, and reporting template.

04 同仓库更多 Skills

alicewe1
alicewe1/alice_skill

alice

Alice 六类技能总路由。用户输入 Alice 或要求查看 Alice 技能菜单时,严格输出固定菜单;输入攻/防模式、六类入口或直接描述任务时,按类别→领域→模块渐进路由。

★ 64
alicewe1
alicewe1/alice_skill

alice-reverse

逆向分析渐进路由(二进制 / 移动端 / 协议 / 取证 / 保护机制 / 运行时观测)。触发词:二进制/移动端/反编译/Frida/IDA/Ghidra/PE/ELF/APK/协议/取证;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。

★ 64
alicewe1
alicewe1/alice_skill

alice-pentest

web安全渐进路由(Web / API / 资产发现 / 漏洞验证 / 云与网络安全)。触发词:Web/API/资产发现/端口/漏洞验证/云与网络安全;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。

★ 64
alicewe1
alicewe1/alice_skill

alice-game

游戏攻防渐进路由(游戏客户端 / 内存 / 图形 / 反作弊 / 安全研究)。触发词:游戏客户端/内存/图形/偏移/反作弊/模拟器/覆盖层;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。

★ 64
alicewe1
alicewe1/alice_skill

alice-crack

卡密授权渐进路由(卡密 / 激活 / 授权验证 / 许可证管理 / 本地授权分析)。触发词:卡密/激活/授权验证/license/机器码/试用状态;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。

★ 64
alicewe1
alicewe1/alice_skill

alice-assist

技能指令渐进路由(技能路由 / 评分 / 吸收 / 迁移 / 自动化 / 文档与平台集成)。触发词:技能创建/吸收/评分/迁移/自动化/文档/平台指令;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。

★ 64