// 临时工具:以 signed 模式(flags bit1,壳侧跳过整文件 CRC)注入验证壳 // 用法: packsigned package main import ( "fmt" "os" "verification-platform-backend/internal/protect" ) func main() { if len(os.Args) != 4 { fmt.Fprintln(os.Stderr, "用法: packsigned ") os.Exit(2) } src, err := os.ReadFile(os.Args[1]) if err != nil { panic(err) } cfg, err := os.ReadFile(os.Args[3]) if err != nil { panic(err) } arch, err := protect.DetectArch(src) if err != nil { panic(err) } out, info, err := protect.PatchSigned(src, cfg, arch, true) if err != nil { panic(err) } if err := os.WriteFile(os.Args[2], out, 0o644); err != nil { panic(err) } fmt.Printf("产物 %s %d 字节 入口 0x%x→0x%x crcVfy=%08x crcFile=%08x\n", os.Args[2], info.OutSize, info.EntryOld, info.EntryNew, info.CrcVfy, info.CrcFile) }