Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
- Label1.Text = "Searching for offset"
- Dim input As New FileStream(OFD.FileName, FileMode.Open)
- Dim bytes(CInt(input.Length - 1)) As Byte
- Dim xFileSize As Integer = input.Read(bytes, 0, CInt(input.Length)) - 30
- input.Close()
- Dim i As Integer = 0
- Dim xOpenFile As BinaryReader = New BinaryReader(File.Open(OFD.FileName, FileMode.Open))
- Label2.Text = "Current offset: " & xOpenFile.BaseStream.Position
- While i < xFileSize
- xOpenFile.BaseStream.Position = i
- Label2.Text = "Current offset: " & xOpenFile.BaseStream.Position
- Dim xValue As String = BitConverter.ToString(xOpenFile.ReadBytes(32)).Replace("-", Nothing)
- i = i + 1
- If xValue = "63E83FFF00000000060000000000000000000300000000000109090F00000000" Then
- Dim xOffset As String = xOpenFile.BaseStream.Position
- Label1.Text = "Finished, offset found @ " & xOffset
- Else
- Label1.Text = "Finished, unable to find offset"
- End If
- End While
- xOpenFile.Close()
- End Sub
Add Comment
Please, Sign In to add comment