Solved problem write byte in process

Hexui Undetected CSGO Cheats PUBG Accounts

bacicalupo

Newbie
Aug 26, 2012
2
212
0
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
help2.png
 
Last edited:

Styx

Coder
Dank Tier Donator
Nobleman
Aug 14, 2012
117
648
3
You have taken the source from my example assaultcube patch and changed two bytes. This function does NOT write to memory, it was written to patch the file itself.
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
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 & "\crossfire.exe", &H1D2BD4E7, ammoHack)
        Else
            patchFile(Application.StartupPath & "\crossfire.exe", &H1D2BD4E7, ammoDef)
        End If
        If CheckBox2.Checked = True Then
            patchFile(Application.StartupPath & "\crossfire.exe", &H5AB0A, recoilHack)
        Else
            patchFile(Application.StartupPath & "\crossfire.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
help2.png
Do you want to write into process or file?
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
As the names of some of the functions say, it writes to files not to processes (WriteFile etc.)
 

Similar threads

Community Mods