找回密码
 加入
搜索
查看: 1627|回复: 3

[原创] Heaventools 语言包分析程序

[复制链接]
发表于 2019-11-26 21:30:53 | 显示全部楼层 |阅读模式
此程序主要用来分析语言包的结构, 方便手动精简语言或汉化语言。



下载:
附表:
Heaventools 主页: http://www.heaventools.com/

Resource Tuner
http://www.heaventools.com/download/rtsetup.exe

ResTuner Console
http://www.heaventools.com/download/rtc_setup.exe


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +99 收起 理由
haijie1223 + 99 赞一个!

查看全部评分

 楼主| 发表于 2019-11-26 21:35:53 | 显示全部楼层
附上源码:
#NoTrayIcon
FileInstall("D:\Program Files\Resource Tuner\ZlibUIN.exe", @TempDir & "\ZlibUIN.exe")
Local $smessage = "请选择一个 Heaventools 语言包"
Local $sfileopendialog = FileOpenDialog($smessage, @ScriptDir & "", "语言包(langpack.dat)|所有文件(*.*)")
If @error Then Exit
$decompress = @TempDir & "\langpack.txt"
Run(@TempDir & "\ZlibUIN.exe", @TempDir, @SW_HIDE)
$title = "Zlib Tools"
WinWait($title)
WinActivate($title)
ControlSetText($title, "", "[CLASS:obj_EDIT; INSTANCE:1]", $sfileopendialog)
ControlSetText($title, "", "[CLASS:obj_EDIT; INSTANCE:2]", $decompress)
ControlClick($title, "", "[CLASS:obj_BUTTON; INSTANCE:3]")
Sleep(500)
ProcessClose("ZlibUIN.exe")
Local $number = _readbinary($decompress, 0, 4, True)
$h = 60 + 20 * ($number + 1) + 10
Local $hgui = GUICreate("Heaventools 语言包分析程序", 338, $h)
GUICtrlCreateLabel("语言包: ", 10, 10, 56, 20)
GUICtrlCreateLabel(_abbreviation($decompress, 46), 58, 10, 380, 20)
GUICtrlCreateLabel("序列    偏移   语言                      代码   长度", 10, 50, 312, 20)
Local $x = 70, $y = 1, $z
For $i = 4 To 4 + ($number - 1) * 16 Step 16
        $j = _readbinary($decompress, $i, 16, False)
        $j = StringTrimLeft($j, 2)
        $offset = Number(Binary("0x" & StringMid($j, 1, 8)))
        $langlen = Number(Binary("0x" & StringMid($j, 9, 8)))
        $langtxt = _decode(_readbinary($decompress, 4 + $number * 16 + $offset, $langlen, False), 2)
        $langcode = Number(Binary("0x" & StringMid($j, 17, 8)))
        $lang_lang = Number(Binary("0x" & StringMid($j, 25, 8)))
        GUICtrlCreateLabel(StringFormat("%2i   %7i  %-19s", $y, $offset, $langtxt), 15, $x, 230, 20)
        GUICtrlCreateLabel(StringFormat("%4i  %6i", $langcode, $lang_lang), 255, $x, 72, 20)
        $y += 1
        $x += 20
        $z = 4 + $number * 16 + $offset + $langlen + $lang_lang
Next
GUICtrlCreateLabel(StringFormat("%7i", $z), 45, $x, 100, 20)
GUISetState(@SW_SHOW, $hgui)
While 1
        Switch GUIGetMsg()
                Case -3
                        ExitLoop
        EndSwitch
WEnd
GUIDelete($hgui)

Func _readbinary($file, $begin, $amount, $tf)
        $ado_stream = ObjCreate("ADODB.Stream")
        $ado_stream.type = 1
        $ado_stream.open
        $ado_stream.loadfromfile($file)
        $ado_stream.position = $begin
        $read = $ado_stream.read($amount)
        $ado_stream.close
        If $tf Then
                Return Number($read)
        Else
                Return $read
        EndIf
EndFunc

Func _abbreviation($text, $len)
        If StringLen($text) > $len Then
                Return StringLeft($text, ($len - 6) / 2) & "..." & StringRight($text, ($len - 6) / 2)
        Else
                Return $text
        EndIf
EndFunc

Func _decode($expression, $flag)
        Return BinaryToString(Binary($expression), $flag)
EndFunc
发表于 2019-11-27 10:54:49 | 显示全部楼层

好工具,学习中!
发表于 2023-9-11 23:08:29 | 显示全部楼层
谢谢LZ,看看能不能分析Resource Tuner 2.23的语言包,
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-19 08:20 , Processed in 0.082426 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表