Ok, well I am new to VB, but have a general idea of it, and im trying to make a program that does the following (and it fairly simple)

button 1 = Open
button 2 = search and replace
textbox = text to search for

replace = a given, non changeable number..

so i want to replace all instances of

67632 with 10000000, but lets say another user has
67631, and needs it replaced with 10000000
how can I make this work?

Ok. Three questions.
What does button1 open?
How far have you come yourself?
Have you tried searching for the solution, either here or on Google?

it opens a hex file... except the hex files can sometimes have different file names, unless you rename them all to the default, and change them back?
but i have everything except for the search and replace done, cause i cant get it to work

I understand.
Can you post your code for the search and replace?
Perhaps we can take a look and see what the problem is.

unfortunately, all the information on my flash drive became corrputed (including the source coding for my programs)

I will remake it from scratch tonight and post back

Ok, I am almost done rebuilding it, and this time I added a file menu containing

File...
Open
Save
Exit

edit again:

ok... i need to build a search and replace function that will parse the file path/location of the file they opened, and allow them to INPUT a hex code, and then have the program replace ALL instances of that hex code with another USER DEFINED hex variable


or is this a job for C#?

ok.. i recovered a fraction of the source for my last program

Dim fs As System.IO.FileStream
Dim bw As System.IO.BinaryWriter
fs = New System.IO.FileStream(OFD1.FileName, IO.FileMode.OpenOrCreate) 'uses the opened file
bw = New System.IO.BinaryWriter(fs) 'writes to the opened file

fs.Position = &H12CC0 'here, this is close to what i want. except, i need it to search for the displayed "hex" instead of the offset
bw.write("1") 'writes "01" at the offset 00012CC0 (used in int8 to write into the hex)

fs.Position = &H12CC1 'moves over 1 offset to 12CC1
bw.write("-103") 'writes the int8 code "-103" equaling "99" in the hex

fs.Close
bw.Close

MsgBox("Finished")

http://www.microvern.pcriot.com/Untitled.jpg

as you can see in the picture, i told it to write -103, which enters 99 into the offset, except i need it to search for the value, because the offset can be different in any file. and then a replace option

Ok. Try and see if this works.
If I'm right, it will replace all occurences of the given "find" string within the file.

Private Sub FindAndReplace(ByVal FileName As String, ByVal find As String, ByVal replace As String)
        Dim fs As IO.FileStream
        fs = New IO.FileStream(FileName, IO.FileMode.OpenOrCreate)

        Dim buffer() As Byte
        Using br As New IO.BinaryReader(fs)
            buffer = br.ReadBytes(fs.Length)
        End Using
        fs.Close()

        fs = New IO.FileStream(FileName, IO.FileMode.Create)
        Dim text As String = System.Text.Encoding.UTF8.GetString(buffer).Replace(find, replace)
        Using bw As New IO.BinaryWriter(fs)
            buffer = System.Text.Encoding.UTF8.GetBytes(text)
            bw.Write(buffer)
        End Using

        MessageBox.Show("Finished", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
    End Sub

will i need to tie a textbox to this or what

Gee, I don't know.
If you, somewhere, on the form need to select a value to search for and, somewhere else, a value to replace it.
Consider how you would go about doing it.

Take your code snippet for example.
How would you get the value &H12CC0 if you didn't hard-code it?
Same goes for the line bw.write("1"), where would that value come from?

Obviously.
But if they weren't. How would they get there?

In order to speed this up a bit.
The answer to your question is Yes, you will need to have some kind of entry control, like a textbox.
One textbox where you enter what to search for, and one textbox where you enter the replacement value.