• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 9 of 9
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      bacicalupo's Avatar
      Join Date
      Aug 2012
      Posts
      2
      Thanks (-->)
      0
      Thanks (<--)
      0

      problem write byte in process

      John Kittz
      please, I need to replace the byte (3E) with the byte (FF)
      Code:
      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
      Click image for larger version. 

Name:	help2.png 
Views:	8 
Size:	35.7 KB 
ID:	1910
      Last edited by bacicalupo; 07-10-2013 at 06:07 AM.

    2. #2
      Global Moderator
      give me my colorz back
      FeelsBadMan
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Quote Originally Posted by bacicalupo View Post
      please, I need to replace the byte (3E) with the byte (FF)
      Code:
      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
      Click image for larger version. 

Name:	help2.png 
Views:	8 
Size:	35.7 KB 
ID:	1910
      Do you want to write into process or file?

    3. #3
      Coder
      v-v
       
      Lurking
       
      Styx™'s Avatar
      Join Date
      Aug 2012
      Posts
      118
      Thanks (-->)
      1
      Thanks (<--)
      27
      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.

    4. #4
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      bacicalupo's Avatar
      Join Date
      Aug 2012
      Posts
      2
      Thanks (-->)
      0
      Thanks (<--)
      0
      hi, write in process

    5. #5
      Coder
      v-v
       
      Lurking
       
      Styx™'s Avatar
      Join Date
      Aug 2012
      Posts
      118
      Thanks (-->)
      1
      Thanks (<--)
      27
      Quote Originally Posted by bacicalupo View Post
      hi, write in process
      Then this function will not help you.

    6. #6
      Global Moderator
      give me my colorz back
      FeelsBadMan
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      As the names of some of the functions say, it writes to files not to processes (WriteFile etc.)

    7. #7
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      emistz's Avatar
      Join Date
      May 2013
      Posts
      71
      Thanks (-->)
      2
      Thanks (<--)
      9

    8. #8
      Global Moderator
      give me my colorz back
      FeelsBadMan
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Quote Originally Posted by emistz View Post
      Is it a .dll which needs to be added to the project?

    9. #9
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      emistz's Avatar
      Join Date
      May 2013
      Posts
      71
      Thanks (-->)
      2
      Thanks (<--)
      9
      Cheats'n'Trainers
      Quote Originally Posted by till0sch97 View Post
      Is it a .dll which needs to be added to the project?
      I don't remember. I think I made it into a statically linked lib to be built into whatever project at compile time.

    Similar Game Hacker Threads

    1. [Tutorial] Define Byte: Direct Byte Manipulation In Game Hacking
      By ChrisFayte in forum Cheat The Game
      Replies: 1
      Last Post: 04-22-2016, 04:17 PM
    2. Replies: 16
      Last Post: 02-25-2015, 05:41 PM
    3. [Help] How to make Kernel Mode Read/Write Process Memory?
      By skythen in forum C/C++
      Replies: 17
      Last Post: 02-21-2015, 08:30 PM
    4. How to secure write process memory
      By marry_poppins in forum Hacking Help
      Replies: 7
      Last Post: 10-30-2014, 12:29 PM
    5. [Help] Write Process Memory Alternative or New Way
      By hackgen in forum GH Tutorials Help
      Replies: 2
      Last Post: 03-15-2014, 02:38 AM

    Tags for this Thread