I've got a problem with my code. I put the offset value into listbox, then I read it and seek it in file. I use the following code.
Dim bw As New BinaryWriter(File.Open(filename, FileMode.Open, FileAccess.ReadWrite))
Try
For j As Integer = 0 To ListBox2.Items.Count - 1
czytana = ListBox2.Items.Item(j)
tablica = czytana.Split(" ") ' czytana is in format OFFSET: BYTE BYTE, offset is a hex addr
tablica(0) = tablica(0).Replace(":", "") 'I remove : from "OFFSET:"
bw.BaseStream.Seek("&H" + tablica(0), SeekOrigin.Begin) ' in ex. I got tablica(0)=000CFDD6, and I want to get &HCFDD6, but what I get is &H000CFDD6
'some part of code in here which does its job properly
Next j
Catch ex As Exception
MsgBox(ex.Message)
End Try
bw.Close()
the problem is: I need to use tablica(0) as an offset, tablica(1) and tablica(2) as bytes. What I want to do is open the file, select the offset and replace with tablica(2). czytana got a format "tablica(0): tablica(1) tablica(2).
Does somebody mind helping? :)
From your comments, I understand that you have the following inputs:
Your code should look like:
Where: