找回密码
 加入
搜索
查看: 1874|回复: 2

[系统综合] [已解决]如何查找替换可执行文件中的文本

[复制链接]
发表于 2013-4-20 10:25:01 | 显示全部楼层 |阅读模式
本帖最后由 userdel 于 2013-4-22 21:57 编辑

我想替换一个exe中的中文本,但是每次生成的文件都无法执行。
代码如下:
$sFileinPath = "D:\1.exe"
$sFileopPath = "F:/1.exe"
$sStr = "opens"
$sStr1 = "open"
$hFile = FileOpen($sFileinPath, 16)
$hFile1 = FileOpen($sFileopPath, 16+2)

$sBinText = FileRead($hFile)
;~$sAscText = BinaryToString($sBinText, 4)
$sFinalText = StringReplace($sBinText, $sStr, $sStr1, 0, 1)
Local $iReplacements = @extended
MsgBox(4096, "替换", "共替换的数量为:" & @CRLF & $iReplacements & " 次.")

FileWrite($hFile1, $sFinalText)
 楼主| 发表于 2013-4-20 16:32:11 | 显示全部楼层
我用Winhex可以查找编辑,后面用python写了段代码也可以,不知道为什么autoit就不行!
 楼主| 发表于 2013-4-22 21:53:59 | 显示全部楼层
研究了数日,终于自己找到方法了!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-29 07:26 , Processed in 0.095864 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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