如果将配置信息写入EXE文件,有实例,但不成功,小弟我不是做木马

如果将配置信息写入EXE文件,有实例,但不成功,我不是做木马。
写了公司的一些小软件,每一个软件都有,一些固定的值,但不能用INI文件保存,只好,写到EXE里

在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是如何定位的,
给我测试他好像定位是一个按钮,我把按钮删除,就无法替换成功,请问在我的程序如果定这个值。




------解决方案--------------------
探讨
假如那exe是VB写的,那楼主你还是洗洗睡吧,VB编写的exe都是奇葩。。。