EXE Edit
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
10 posts
Page 1 of 1
Maybe try it with Hex Edit,there is a Lib to use HexEdit in VB.
Name is HexBox.
Name is HexBox.
hex editors are of course good for this as napster has said
off topic: Napster talk on Dropbox want to talk to you
off topic: Napster talk on Dropbox want to talk to you
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
If you know the offset of the text, you can use a FileStream to change or shorten the text.
How can i use file stream ? I know exactly what text is "in" exe file, i just want to be able to change it !
You could change it with this:
Code: Select all
Dim fs As FileStream = New FileStream("test.exe", FileMode.Open)
fs.Position = &HFFA0 'an example offset of the text
Dim changed As String = "new text" 'must be equal or shorter than the original text
' ASCII encoding is assumed
For i As Integer = 0 To changed.Length - 1
fs.WriteByte(Asc(changed(i)))
Next
fs.Close()
tnx man, but how can i do some thing like this ?
Dim rfs = Read file stream
rfs = rfs.replace(oldstr,newstr)
?
If you can understand me it would be great
Dim rfs = Read file stream
rfs = rfs.replace(oldstr,newstr)
?
If you can understand me it would be great

There are many methods for finding a string in a stream. You could use this to find the offset:
Code: Select all
Dim input As Byte() = File.ReadAllBytes("file.txt")
Dim lookFor As Byte() = Encoding.ASCII.GetBytes("old text")
Dim temp(lookFor.Length - 1) As Byte
Dim offset As Integer = -1
For i As Integer = 0 To input.Length - lookFor.Length
System.Buffer.BlockCopy(input, i, temp, 0, lookFor.Length)
If temp.SequenceEqual(lookFor) Then
Dim dr As DialogResult = MessageBox.Show("Found 'old text' at offset " & i & ", finish search?", "", MessageBoxButtons.YesNo)
If dr = Windows.Forms.DialogResult.Yes Then
offset = i
Exit For
End If
'else keep looking
End If
Next
10 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023