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
- 参考文档agents/openai.yaml244 B
- 参考文档references/linker-fake-load-principles.md3.9 KB
- 脚本scripts/linker_static_unwrap.py11.3 KB
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
- Parse ELF64 little-endian AArch64 header and PHDRs.
- Find fake LOAD candidate:
p_type == PT_LOADp_offset == 0p_filesz > file_size- high
p_vaddrsuch as0xffff0000or hugep_filesz e_entryfalls insidep_vaddr .. p_vaddr + p_filesz
- Translate true entry:
true_entry_file_offset = e_entry - fake.p_vaddr + fake.p_offset
- Disassemble AArch64 stub at real file entry.
- Recover repeated decrypt calls:
- key usually arrives in
w3/x3as an immediate byte. - target pointer and size are often loaded through PC-relative
ldrliterals intox2andx1. - each
blafter those loads applies XOR to a runtime range.
- key usually arrives in
- Map target VAs through normal LOADs, not the fake one, then XOR file bytes.
- Carve embedded
ELFblobs and inspect sections/PHDRs/UPX markers. - 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:
- Run the target in a controlled directory.
- Monitor
/proc/<pid>/mapsfor file-backed or anonymous executable mappings. - Dump relevant mappings through
/proc/<pid>/memas root. - Prefer parent-child dumpers for short-lived children.
- 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
alice
Alice 六类技能总路由。用户输入 Alice 或要求查看 Alice 技能菜单时,严格输出固定菜单;输入攻/防模式、六类入口或直接描述任务时,按类别→领域→模块渐进路由。
alice-reverse
逆向分析渐进路由(二进制 / 移动端 / 协议 / 取证 / 保护机制 / 运行时观测)。触发词:二进制/移动端/反编译/Frida/IDA/Ghidra/PE/ELF/APK/协议/取证;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。
alice-pentest
web安全渐进路由(Web / API / 资产发现 / 漏洞验证 / 云与网络安全)。触发词:Web/API/资产发现/端口/漏洞验证/云与网络安全;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。
alice-game
游戏攻防渐进路由(游戏客户端 / 内存 / 图形 / 反作弊 / 安全研究)。触发词:游戏客户端/内存/图形/偏移/反作弊/模拟器/覆盖层;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。
alice-crack
卡密授权渐进路由(卡密 / 激活 / 授权验证 / 许可证管理 / 本地授权分析)。触发词:卡密/激活/授权验证/license/机器码/试用状态;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。
alice-assist
技能指令渐进路由(技能路由 / 评分 / 吸收 / 迁移 / 自动化 / 文档与平台集成)。触发词:技能创建/吸收/评分/迁移/自动化/文档/平台指令;先选领域索引,再按任务匹配度与评分选模块,禁止一次读取全部领域。