Solved problem write byte in process

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

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
View attachment 1910
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.)
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods