如果将配置信息写入EXE文件,有实例,但不成功,我不是做木马。
时间:2011-08-05
来源:互联网
写了公司的一些小软件,每一个软件都有,一些固定的值,但不能用INI文件保存,只好,写到EXE里
在EXE里固定读取三个常量。
用生成器把这三个常量替换值。如下是网上的列子。
VB code
VB code
以上Seek #1的替换操作,请问他的&H1829 &H1859是如何定位的,
给我测试他好像定位是一个按钮,我把按钮删除,就无法替换成功,请问在我的程序如果定这个值。
在EXE里固定读取三个常量。
用生成器把这三个常量替换值。如下是网上的列子。
VB code
On Error Resume Next Dim ip() As Byte Dim port() As Byte Dim password() As Byte If LenB(Text1.Text) > 40 Then MsgBox "字符超出长度", vbOKOnly + 16, "提示" Exit Sub End If If Val(Text2.Text) <= 0 Or Val(Text2.Text) > 65535 Then MsgBox "端口错误", vbOKOnly + 16, "提示" Exit Sub End If If Len(Text3.Text) > 6 Then MsgBox "密码字符超出长度", vbOKOnly + 16, "提示" Exit Sub End If ip = Text1.Text port = Text2.Text password = Text3.Text Kill App.Path & "\1.EXE" FileCopy App.Path & "\1.DAT", App.Path & "\1.EXE" ReDim Preserve ip(LenB(Text1.Text) - 1) ReDim Preserve port(LenB(Text2.Text) - 1) ReDim Preserve password(LenB(Text3.Text) - 1) Open App.Path & "\1.exe" For Binary Access Write As #1 Seek #1, &H1829 Put #1, , ip Close #1 Open App.Path & "\1.exe" For Binary Access Write As #1 Seek #1, &H1859 Put #1, , port Close #1 Open App.Path & "\1.exe" For Binary Access Write As #1 Seek #1, &H1869 Put #1, , password Close #1 MsgBox "1.exe已经配置成功", vbOKOnly + 48, "提示"
VB code
Option Explicit Const ip As String = " " '20个空格 Const port As String = " " '五个空格 Const password As String = " " '六个空格 Private Sub Command1_Click() If Len(Trim(ip)) = 0 Then MsgBox "未配置正确", vbOKOnly + 16, "提示" Exit Sub End If MsgBox "ip" & Trim(ip) MsgBox "port" & Trim(port) MsgBox "password" & Trim(password) End Sub
以上Seek #1的替换操作,请问他的&H1829 &H1859是如何定位的,
给我测试他好像定位是一个按钮,我把按钮删除,就无法替换成功,请问在我的程序如果定这个值。
作者: janly 发布时间: 2011-08-05
等着用的,自己顶
作者: janly 发布时间: 2011-08-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28