feat(tools): fw_info/fw_pack 镜像解析重打包(CRC32验证+字节级往返),112 测试全绿
This commit is contained in:
1 parent
0e2a6a351f
commit
7079053dde
10 files changed
+987
-1
No files matched your search
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
"""fw_pack: 体→完整镜像(重算 CRC)。用法: fw_pack.py body.bin out.img [flags_hex]"""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from fw import pack_image
|
||||
|
||||
if __name__ == "__main__":
|
||||
body = Path(sys.argv[1]).read_bytes()
|
||||
flags = int(sys.argv[3], 16) if len(sys.argv) > 3 else 0x01AA
|
||||
Path(sys.argv[2]).write_bytes(pack_image(body, flags))
|
||||
print(f"OK: {sys.argv[2]} ({len(body)}B body)")
|
||||
Reference in new issue
Block a user