Guest User

Untitled

a guest
Oct 23rd, 2017
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.23 KB | None | 0 0
  1.     Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
  2.         Label1.Text = "Searching for offset"
  3.         Dim input As New FileStream(OFD.FileName, FileMode.Open)
  4.         Dim bytes(CInt(input.Length - 1)) As Byte
  5.         Dim xFileSize As Integer = input.Read(bytes, 0, CInt(input.Length)) - 30
  6.         input.Close()
  7.         Dim i As Integer = 0
  8.         Dim xOpenFile As BinaryReader = New BinaryReader(File.Open(OFD.FileName, FileMode.Open))
  9.         Label2.Text = "Current offset: " & xOpenFile.BaseStream.Position
  10.         While i < xFileSize
  11.             xOpenFile.BaseStream.Position = i
  12.             Label2.Text = "Current offset: " & xOpenFile.BaseStream.Position
  13.             Dim xValue As String = BitConverter.ToString(xOpenFile.ReadBytes(32)).Replace("-", Nothing)
  14.             i = i + 1
  15.             If xValue = "63E83FFF00000000060000000000000000000300000000000109090F00000000" Then
  16.                 Dim xOffset As String = xOpenFile.BaseStream.Position
  17.                 Label1.Text = "Finished, offset found @ " & xOffset
  18.             Else
  19.                 Label1.Text = "Finished, unable to find offset"
  20.             End If
  21.         End While
  22.         xOpenFile.Close()
  23.     End Sub
Add Comment
Please, Sign In to add comment