看了GAL遊戲資源檔黑盒分析,想起以前做的一個提取器,發來大家共用一下

來源:互聯網
上載者:User

看了一個分析文章,想起以前寫的一個初版的提取器,也發來與大家共用下

 

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.