看了一個分析文章,想起以前寫的一個初版的提取器,也發來與大家共用下
http://blog.csdn.net/luozhuang/archive/2011/01/28/6167799.aspx
依據該分析文章,所寫的提取指令碼如下,根據文後所附的軟體即可提取了
提取Script代碼
open D:/works/Script/script.dat<br />skip 12<br />read 4 filecount<br />print filecount<br />set i=0<br />set newpos=16<br />loop:<br />seekto newpos<br />read 32 filename<br />print filename<br />read 4 filestart<br />skip 4<br />read 4 filesize<br />set newpos=newpos+48<br />seekto filestart<br />print filestart<br />print filesize<br />read filesize subfile<br />subopen D:/works/script/{i}.tx_<br />subwrite subfile<br />subclose<br />set i=i+1<br />if i<=filecount goto loop
以上代碼裡的檔案目錄是使用絕對路徑,所以大家要修改成你自己的實際路徑.
指令碼代碼說明
指令碼命令
label: 設定標籤,此標籤可以通過if xxx goto label來跳轉
格式:xxxlabel:
open 開啟一個包檔案,就是要解包的檔案,如open c:/abc.cab
格式:open 檔案絕對路徑
close 關閉包檔案
格式:close
seekto 定位到包檔案位置,其中位置可以是常數或變數,預設從檔案頭算起
格式:seekto 位置[ 方式] 位置方式可以取如下值:filebegin檔案頭 filecur當前位置 fileend檔案尾
skip 從當前包檔案位置跳過常數值或變數值
格式:skip 跳過位置
read 從包檔案讀指定位元組數到變數
格式:read 位元組數 變數
print 列印字串或者變數值
格式:print "字串" 或者 print 變數名
set 設定變數,可做簡單計算
格式:set abc=1; set abc=abc+1
if 條件跳轉
格式:if 條件成立 goto label
subopen 儲存檔案,可以用{}將變數括起來,用變數定義名字
格式:subopen 檔案絕對路徑。如subopen c:/subfile{i}.sub
subclose 關閉儲存檔案
格式:subclose
subwrite 輸出變數內容到儲存檔案
格式:subwrite 變數名
大家可以依據他來寫提取360資源和一些沒壓縮的資源檔.
因為當時是寫來玩玩的,所以沒有想把他做成一個發布軟體,所以沒有用到執行線程,運行後會有一段時間介面鎖定,以及指令碼變數沒有做字元操作,無法識別資源裡的檔案名稱,還有一些其他問題,例如執行效率等,都沒有去處理,如果大家覺得有點用,我也可以去完善下,或把代碼發來大家一起研究下.
提取軟體:
:http://download.csdn.net/source/3009363