Skip to content

Instantly share code, notes, and snippets.

@gocha
Last active December 13, 2022 17:05
Show Gist options
  • Save gocha/5e19e335745d94e8e86050f492b7a3cb to your computer and use it in GitHub Desktop.
Save gocha/5e19e335745d94e8e86050f492b7a3cb to your computer and use it in GitHub Desktop.
chdpm 命令の総当り実行による暗号化DPMの読み込み (HSP 3.7 β4)
; HSP 3.7 β4 実行ファイルから切り出した暗号化済み DPM からファイルを保存する
#bootopt notimer 1
dialog "dpm", 16
if stat == 0: end
dpmpath = refstr
dpmkey = 1
exist dpmpath
if strsize == -1: dialog "File not found": end
dir_prev = dir_cur
dpmdir = getpath(dpmpath, 32)
dpmname = getpath(dpmpath, 8)
; chdpm 命令は絶対パスでファイルを読み込むことができない(と思う)
chdir dpmdir
*find_key
chdpm_err = 0
onerror gosub *catch_chdpm_err
chdpm dpmname, dpmkey, 1
if chdpm_err == 0: goto *main
onerror 0
dpmkey = dpmkey + 1
await 0
if dpmkey \ 16 == 0: title "dpmkey = " + dpmkey
goto *find_key
*catch_chdpm_err
chdpm_err = err
if chdpm_err != 12: dialog "#Error " + chdpm_err + " in line 0": end 1
return
*main
chdir dir_prev
title "dpmkey = " + dpmkey
dialog "暗号化キーは " + dpmkey + " です。"
bcopy "start.ax", "./start.ax"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment