mardi 30 septembre 2014

Copy offset to notepad when hex value is "xx" in .bin file


Vote count:

0




So I have a .bin file (16.5mb) that I would like to search through finding Hex values that I will pre-define in a textbox and copy the offset where the hex value is located into notepad for later use. And repeat this for the entire file.


So far I can load the .bin with button1, textbox1 and OFD. I would rather search only for the Hex value I specify with textbox2 and button2. If it is easier or faster to search for bytes I can enter the hex in as byte equivalent.


I found this which is similar= VB.Net Get Offset Address but no luck configuring it to my needs. Searching for Hex values would be ideal. This looks helpful however.



Dim pos As Integer = 0 ' <== THIS IS THE OFFSET
Dim length As Integer = reader.BaseStream.Length
Do While pos < length
' Read the integer.
Dim value As Byte = reader.ReadByte()
If value = CByte(&H41) Then
Return pos
Exit Do
End If
' Add length of integer in bytes to position.
pos += 1
Loop
End Using


Can someone suggest a good way of accomplishing this? Please and Thank you.



asked 1 min ago







Copy offset to notepad when hex value is "xx" in .bin file

Aucun commentaire:

Enregistrer un commentaire