※ 引述《windlune (qe)》之銘言:
: VB可以寫自解檔嗎? 有人有看過類似的資料嗎? 有的話可以貼出來讓我做參考嗎@@?
主要概念就是
[自解檔]
執行檔開啟自己,跳到執行檔的尾端(資料啟始處),讀出資料
[產生自解檔]
自解檔 = 執行檔(無資料的自解檔)+資料
ex. [自解檔 Sfx.exe]
Private Sub Form_Load()
Me.AutoRedraw = True
Const ExeSize As Long = 9728 '編譯後的自解檔大小(無資料)
Dim Buff As String
Dim f As Integer
f = FreeFile
Open App.Path & "\" & App.EXEName & ".exe" For Binary As #f '開啟自己
Seek #f, ExeSize + 1 '跳到資料啟始處
Buff = Space(LOF(f) - ExeSize - 1)
Get #f, , Buff
Close #f
Print Buff
End Sub
編譯出執行檔後可以用一個文字檔試試
開啟 cmd.exe(命令提示字元),用copy指令來將資料加入執行檔,來產生一個新的
執行檔(自解檔),copy/b Sfx.exe+Data.txt Data.exe
當然實際情況要看你怎麼去運用
不知道會不會寫的很亂XDDD
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.26.228.44