#!/usr/bin/env python3 """重定位 dump (v3): 用 ORIGINAL .so 的段表定位 .rela.dyn/.init_array (布局一致), 对 DUMP 内同偏移的槽做"运行期地址 -> 链接期偏移"回退 / 导入槽清零. 用法: python3 rebase_dump.py """ from __future__ import annotations import struct, sys R_AARCH64_ABS64 = 257 R_AARCH64_GLOB_DAT = 1025 R_AARCH64_JUMP_SLOT = 1026 R_AARCH64_RELATIVE = 1027 def sections(data): e_shoff = struct.unpack_from(' len(ddata): return v = struct.unpack_from(' {out}") if __name__ == '__main__': main()