K, so i have this project where i need to edit Hexvalues in an .exe file.. i have got pretty far ^^ but i still have 1 problem..
I get it to serch for offsets and insert/replace the string there.. BUT!
However i need to edit alot of things in the .exe and the offsets might change..
Now i would need to get it to find a Hex string and replace it with another.. not using the offset.
Heres my code:
te Sub cmdApply_Click()
FileName = "Test.exe"
If FileName = "" Then Exit Sub
a = FreeFile
Open FileName For Binary As a
Dim MyValue As String
Dim lOffSet As Long
Dim iPos As Integer
MyValue = "2E0A00008945FC837DFC0075138B4D0C518B5508528B4DF8E88506"
lOffSet = &H11D0DE
For iPos = 1 To Len(MyValue) Step 2
Put a, lOffSet + (iPos \ 2), CByte("&H" & Mid$(MyValue, iPos, 2))
Next iPos
Close a
End Sub
Thanx, and you could send any examples to xilemx@tkukoulu.fi
~xilemx
I get it to serch for offsets and insert/replace the string there.. BUT!
However i need to edit alot of things in the .exe and the offsets might change..
Now i would need to get it to find a Hex string and replace it with another.. not using the offset.
Heres my code:
te Sub cmdApply_Click()
FileName = "Test.exe"
If FileName = "" Then Exit Sub
a = FreeFile
Open FileName For Binary As a
Dim MyValue As String
Dim lOffSet As Long
Dim iPos As Integer
MyValue = "2E0A00008945FC837DFC0075138B4D0C518B5508528B4DF8E88506"
lOffSet = &H11D0DE
For iPos = 1 To Len(MyValue) Step 2
Put a, lOffSet + (iPos \ 2), CByte("&H" & Mid$(MyValue, iPos, 2))
Next iPos
Close a
End Sub
Thanx, and you could send any examples to xilemx@tkukoulu.fi
~xilemx