#!/usr/bin/env python3 """rebase v4: 直白版 - 原地改写 dump 的重定位槽, 无嵌套函数. 用法: python3 rebase_v4.py """ from __future__ import annotations import struct, sys def main(): original, dump, base_s, out = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4] base = int(base_s, 16) od = open(original, 'rb').read() dd = bytearray(open(dump, 'rb').read()) # 原文件段表 e_shoff = struct.unpack_from(' len(dd): oob += 1 continue v = struct.unpack_from(' len(dd): oob += 1 continue v = struct.unpack_from('