Scripts to generate name.key from keys.h (matching name.zip -> //name) and add/update both name.key and dl-1425.bin in each target zip.
- Bash script:
make_keys_and_update_zips.sh - PowerShell script:
make_keys_and_update_zips.ps1
Place these in the same folder:
keys.hdl-1425.bin- target
*.zipfiles
For each zip:
- Get
namefromname.zip - Find the line in
keys.hending with//name - Parse
{ 0x.., 0x.., ... }and write binaryname.key - Add/update
name.keyanddl-1425.bininside the zip
If no matching //name line exists in keys.h, that zip is skipped with a warning.
make_keys_and_update_zips.ps1 uses only PowerShell + .NET.
No external commands are required (grep, rg, python, zip are not needed).
Process all zips:
.\make_keys_and_update_zips.ps1Process selected zips:
.\make_keys_and_update_zips.ps1 hsf2.zip vsavj.zip- target count (
対象 zip: N 件) - progress (
[i/N] Processing: xxx.zip) - success/warning lines
- final summary (
Done: total=... updated=... skipped=... failed=...)
make_keys_and_update_zips.sh requires grep, python3, and zip.
./make_keys_and_update_zips.sh
./make_keys_and_update_zips.sh hsf2.zip vsavj.zipkeys file not found:keys.his missingdl bin not found:dl-1425.binis missingkeys.hに //name が見つからない: no key line for that zip inkeys.h
- Existing entries with the same name are replaced.
name.keyis generated next to each zip file.
keys.h の //name コメント (name.zip -> name) に対応するキーを name.key として生成し、dl-1425.bin と一緒に zip へ追加/更新するスクリプトです。
- Bash 版:
make_keys_and_update_zips.sh - PowerShell 版:
make_keys_and_update_zips.ps1
同じフォルダに以下を置いてください。
keys.hdl-1425.bin- 対象の
*.zip
各 zip ごとに以下を実行します。
name.zipからnameを取得keys.hから//nameで終わる行を検索- 行内の
{ 0x.., 0x.., ... }をバイナリ化してname.keyを作成 name.keyとdl-1425.binを zip に追加/更新
keys.h に対応行がない zip は警告を出してスキップします。
make_keys_and_update_zips.ps1 は PowerShell + .NET のみで動作します。
外部コマンド (grep / rg / python / zip) は不要です。
実行例:
.\make_keys_and_update_zips.ps1
.\make_keys_and_update_zips.ps1 hsf2.zip vsavj.zip出力:
- 対象件数 (
対象 zip: N 件) - 進捗 (
[i/N] Processing: xxx.zip) - 成功/警告
- 最終集計 (
Done: total=... updated=... skipped=... failed=...)
make_keys_and_update_zips.sh は grep, python3, zip が必要です。
実行例:
./make_keys_and_update_zips.sh
./make_keys_and_update_zips.sh hsf2.zip vsavj.zipkeys file not found:keys.hがないdl bin not found:dl-1425.binがないkeys.hに //name が見つからない: その zip のキー行が未定義
- zip 内に同名エントリがある場合は置き換えます。
name.keyは zip の隣に生成されます。