please, I need to replace the byte (3E) with the byte (FF)
C++:
Imports System.io
Public Class Form1
Private ammoDef As Integer() = {&H3E}
Private ammoHack As Integer() = {&HFF}
Private recoilDef As Integer() = {&H8B, &H16, &H8B, &H52, &H14, &H50, &H8D, &H4C, &H24, &H1C, &H51, &H8B, &HCE, &HFF, &HD2}
Private recoilHack As Integer() = {&H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBox1.Checked = True Then
patchFile(Application.StartupPath & "\esample.exe", &H1D2BD4E7, ammoHack)
Else
patchFile(Application.StartupPath & "\esample.exe", &H1D2BD4E7, ammoDef)
End If
If CheckBox2.Checked = True Then
patchFile(Application.StartupPath & "\esample.exe", &H5AB0A, recoilHack)
Else
patchFile(Application.StartupPath & "\esample.exe", &H5AB0A, recoilDef)
End If
End Sub
Private Sub patchFile(ByVal strLocation As String, ByVal hOffset As Integer, ByVal hBytes As Integer())
Dim writeFile As BinaryWriter = New BinaryWriter(File.OpenWrite(strLocation))
For i = 0 To hBytes.Count - 1
writeFile.BaseStream.Position = hOffset + i
writeFile.BaseStream.WriteByte(hBytes(i))
Next
writeFile.Dispose()
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
End Sub
End Class

Last edited: