找回密码
 加入
搜索
查看: 4029|回复: 8

[AU3基础] 求助代码迷惑支持中文的方法[已解决]

  [复制链接]
发表于 2012-1-17 00:51:12 | 显示全部楼层 |阅读模式
本帖最后由 半芯竹 于 2012-1-17 16:44 编辑
#PRE_Run_Obfuscator=y                                        ;代码迷惑
MsgBox(0, "AutoIt中文论坛", 'AutoIt中文论坛欢迎你,Welcome!')
生成EXE文件之后,只显示英文,中文不显示,就算加 Local 和DIM 先定义内容也一样不显示。
如果在INI文件里定义内容的话,再使用INIREAD读取调用后,可以正常显示中文。
希望有更好的办法增加对中文的支持。
发表于 2012-1-17 01:28:33 | 显示全部楼层
这个是硬伤呀!AU3代码迷惑开发的时候没有考虑中文问题,所以基本上只能等更新了。
发表于 2012-1-17 09:52:37 | 显示全部楼层
生成EXE文件之后,只显示英文,中文不显示,就算加 Local 和DIM 先定义内容也一样不显示。
如果在INI文件 ...
半芯竹 发表于 2012-1-17 00:51


这个现在不支持的
看了开发作者言,基本上后续版本也没有把支持象中文这样的语言包含在Todo之内

所以最好的办法就是代码里不要有任何中文,都用读取Ini来代替需要的中文显示
发表于 2012-1-17 10:17:34 | 显示全部楼层
执行以下代码,读取包含中文字符串的AU3文件.
另存为新文件后,代码迷惑,编译.

只对简单的中文字符串处理,请大家多提供点不同形态的字符串.
$file = FileOpenDialog("GBK2Bin", @ScriptDir, "Au3 File(*.au3)")
If @error Then Exit
$SoureCode = FileRead($file)
$NeedChange = StringRegExp($SoureCode, '["' & "'].*?[\x{4e00}-\x{9fa5}]+.*?[" & '"' & "']", 3)
For $i = 0 To UBound($NeedChange) - 1
        $Bin = StringToBinary(StringRegExpReplace($NeedChange[$i], '^["' & "'](.*?[\x{4e00}-\x{9fa5}]+.*?)[" & '"' & "']$", "$1"))
        $SoureCode = StringReplace($SoureCode, $NeedChange[$i], "BinaryToString('" & $Bin & "')", 1, 1)
Next

Local $var = FileSaveDialog("另存为.", @ScriptDir, "AU3脚本 (*.au3)", 2)
If Not @error Then
        If Not StringRegExp($var, '.+\.au3$', 0) Then $var = $var & ".au3"
        $fileopen = FileOpen($var, 2)
        FileWrite($fileopen, $SoureCode)
EndIf

评分

参与人数 3金钱 +45 收起 理由
txm + 10 见解很不错,但复杂点儿的中文字符串就有些 ...
afan + 25
半芯竹 + 10 非常感谢。辛苦了3mile

查看全部评分

发表于 2012-1-17 10:31:12 | 显示全部楼层
转成二进制的方法不错呵呵学习学习
 楼主| 发表于 2012-1-17 13:01:14 | 显示全部楼层
回复 4# 3mile


    果然是高手,非常感谢,待晚上再试试,现在抱着小孩不方便……累啊。。。。
 楼主| 发表于 2012-1-17 17:44:14 | 显示全部楼层
回复 4# 3mile


    -### Obfuscation Error: Found Call() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: _SQLite_Startup
D:\autoit3\include\SQLite.au3(208,1) Warning for line:Local $vInlineVersion = Call('__SQLite_Inline_Version')

-### Obfuscation Error: Found Call() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: _SQLite_GetTable2d
D:\autoit3\include\SQLite.au3(699,1) Warning for line:$iCbRval = Call($sCallBack, $aDataRow)

-### Obfuscation Error: Found Call() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.
>### current Func: _SQLite_GetTable2d
D:\autoit3\include\SQLite.au3(715,1) Warning for line:$iCbRval = Call($sCallBack, $aDataRow)

-#############################################################################################
-#### Obfuscator Found   3 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
+> Obfuscator v1.0.29.3 finished obfuscating 9450 lines, stripped 14423 comment lines. created:C:\Documents and Settings\Administrator\桌面\时间控制\new lock_Obfuscated.au3
=lock.
发表于 2012-1-25 23:32:04 | 显示全部楼层
希望早日能支持中文!
发表于 2012-6-3 12:56:56 | 显示全部楼层
见解很不错,但复杂点儿的中文字符串就有些问题了,比如:
_GUICtrlEdit_AppendText($Edit9, @YEAR & "-" & @MON & "-" & @MDAY & $tecs & " " & "测试文本" & @CRLF)
转换后:
_GUICtrlEdit_AppendText($Edit9, @YEAR & BinaryToString('0x2D22202620404D4F4E202620222D22202620404D444159202620247465637320262022202220262022B2E2CAD4CEC4B1BE') & @CRLF)

一些宏也被转换了,真正要转换的就只有“测试文本”几个字就可以了,还望修正,谢谢!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-10 23:22 , Processed in 0.084817 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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