CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Tech Boards
Computer Programming
Source Code & Tutorial
[Beginner Tutorial] Creating a Custom Trainer for PM Games! [MP/ZM]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Harry" data-source="post: 1202" data-attributes="member: 35"><p>Hello CCM (Nearly typed NGU.... Kill me)</p><p>Today, Ill be making a tutorial on how to make a custom trainer for ANY CoD on PC (Different Offsets)</p><p></p><p>I'll be using 'Call of Duty: Black Ops II - Redacted Pre-Alpha (Christmas Update)'</p><p>What you will need:</p><ol> <li data-xf-list-type="ol">Visual Studio (I use 2013)</li> <li data-xf-list-type="ol">A CoD (Preferable what I'm using)</li> <li data-xf-list-type="ol">Cheat Engine</li> <li data-xf-list-type="ol">This Thread</li> <li data-xf-list-type="ol">This Thread: <a href="http://cabconmodding.com/index.php?threads/tutorial-find-offsets-for-pc-games.54/" target="_blank">http://cabconmodding.com/index.php?threads/tutorial-find-offsets-for-pc-games.54/</a></li> </ol><p>Difficulty:</p><p><strong><u><em>Beginner</em></u></strong></p><p><em>Intermediate</em></p><p><em>Advanced</em></p><p><em>1337 HaXoR</em></p><p></p><p>Lets begin!</p><p>First, open the game, attach using cheat engine and find an offset (Use the thread linked above for how to do that. Thanks '<em>God</em>')</p><p></p><p>Now you need to make a new 'Visual Basic' Console Program like this: (Console Application)</p><p><img src="http://i.imgur.com/NzkVmLN.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </p><p>And click 'OK'</p><p>Now lets begin.</p><p>First, find your offset:</p><p><img src="http://i.imgur.com/652DZN6.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </p><p>(This is Primary Unlimited Ammo on NIGHTLY Redacted)</p><p></p><p>So now lets go to Visual Studio.</p><p>In the script, paste this whole code (Delete anything that's in there)</p><p>[CODE]Module Module1</p><p> Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer</p><p></p><p> Private Declare Function WriteProcessMemory1 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer</p><p> Private Declare Function WriteProcessMemory2 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single</p><p> Private Declare Function WriteProcessMemory3 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long</p><p></p><p> Private Declare Function ReadProcessMemory1 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer</p><p> Private Declare Function ReadProcessMemory2 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single</p><p> Private Declare Function ReadProcessMemory3 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long</p><p></p><p> Const PROCESS_ALL_ACCESS = &H1F0FF</p><p></p><p> Public Function WriteDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Integer, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean</p><p> Try</p><p> Dim lvl As Integer = Address</p><p> For i As Integer = 1 To Level</p><p> lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1)</p><p> Next</p><p> WriteInteger(Process, lvl, Value, nsize)</p><p> Return True</p><p> Catch ex As Exception</p><p> Return False</p><p> End Try</p><p> End Function</p><p></p><p> Public Function ReadDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Integer</p><p> Try</p><p> Dim lvl As Integer = Address</p><p> For i As Integer = 1 To Level</p><p> lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1)</p><p> Next</p><p> Dim vBuffer As Integer</p><p> vBuffer = ReadInteger(Process, lvl, nsize)</p><p> Return vBuffer</p><p> Catch ex As Exception</p><p></p><p> End Try</p><p> End Function</p><p></p><p> Public Function WriteDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Single, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean</p><p> Try</p><p> Dim lvl As Integer = Address</p><p> For i As Integer = 1 To Level</p><p> lvl = ReadFloat(Process, lvl, nsize) + Offsets(i - 1)</p><p> Next</p><p> WriteFloat(Process, lvl, Value, nsize)</p><p> Return True</p><p> Catch ex As Exception</p><p> Return False</p><p> End Try</p><p> End Function</p><p></p><p> Public Function ReadDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Single</p><p> Try</p><p> Dim lvl As Integer = Address</p><p> For i As Integer = 1 To Level</p><p> lvl = ReadFloat(Process, lvl, nsize) + Offsets(i - 1)</p><p> Next</p><p> Dim vBuffer As Single</p><p> vBuffer = ReadFloat(Process, lvl, nsize)</p><p> Return vBuffer</p><p> Catch ex As Exception</p><p></p><p> End Try</p><p> End Function</p><p></p><p> Public Function WriteDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Long, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean</p><p> Try</p><p> Dim lvl As Integer = Address</p><p> For i As Integer = 1 To Level</p><p> lvl = ReadLong(Process, lvl, nsize) + Offsets(i - 1)</p><p> Next</p><p> WriteLong(Process, lvl, Value, nsize)</p><p> Return True</p><p> Catch ex As Exception</p><p> Return False</p><p> End Try</p><p> End Function</p><p></p><p> Public Function ReadDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Long</p><p> Try</p><p> Dim lvl As Integer = Address</p><p> For i As Integer = 1 To Level</p><p> lvl = ReadLong(Process, lvl, nsize) + Offsets(i - 1)</p><p> Next</p><p> Dim vBuffer As Long</p><p> vBuffer = ReadLong(Process, lvl, nsize)</p><p> Return vBuffer</p><p> Catch ex As Exception</p><p></p><p> End Try</p><p> End Function</p><p></p><p> Public Sub WriteNOPs(ByVal ProcessName As String, ByVal Address As Long, ByVal NOPNum As Integer)</p><p> Dim C As Integer</p><p> Dim B As Integer</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Sub</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Sub</p><p> End If</p><p></p><p> B = 0</p><p> For C = 1 To NOPNum</p><p> Call WriteProcessMemory1(hProcess, Address + B, &H90, 1, 0&)</p><p> B = B + 1</p><p> Next C</p><p> End Sub</p><p></p><p> Public Sub WriteXBytes(ByVal ProcessName As String, ByVal Address As Long, ByVal Value As String)</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Sub</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Sub</p><p> End If</p><p></p><p> Dim C As Integer</p><p> Dim B As Integer</p><p> Dim D As Integer</p><p> Dim V As Byte</p><p></p><p> B = 0</p><p> D = 1</p><p> For C = 1 To Math.Round((Len(Value) / 2))</p><p> V = Val("&H" & Mid$(Value, D, 2))</p><p> Call WriteProcessMemory1(hProcess, Address + B, V, 1, 0&)</p><p> B = B + 1</p><p> D = D + 2</p><p> Next C</p><p></p><p> End Sub</p><p></p><p> Public Sub WriteInteger(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Integer, Optional ByVal nsize As Integer = 4)</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Sub</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Sub</p><p> End If</p><p></p><p> Dim hAddress, vBuffer As Integer</p><p> hAddress = Address</p><p> vBuffer = Value</p><p> WriteProcessMemory1(hProcess, hAddress, CInt(vBuffer), nsize, 0)</p><p> End Sub</p><p></p><p> Public Sub WriteFloat(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Single, Optional ByVal nsize As Integer = 4)</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Sub</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Sub</p><p> End If</p><p></p><p> Dim hAddress As Integer</p><p> Dim vBuffer As Single</p><p></p><p> hAddress = Address</p><p> vBuffer = Value</p><p> WriteProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0)</p><p> End Sub</p><p></p><p> Public Sub WriteLong(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Long, Optional ByVal nsize As Integer = 4)</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Sub</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Sub</p><p> End If</p><p></p><p> Dim hAddress As Integer</p><p> Dim vBuffer As Long</p><p></p><p> hAddress = Address</p><p> vBuffer = Value</p><p> WriteProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0)</p><p> End Sub</p><p></p><p> Public Function ReadInteger(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Integer</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Function</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Function</p><p> End If</p><p></p><p> Dim hAddress, vBuffer As Integer</p><p> hAddress = Address</p><p> ReadProcessMemory1(hProcess, hAddress, vBuffer, nsize, 0)</p><p> Return vBuffer</p><p> End Function</p><p></p><p> Public Function ReadFloat(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Single</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Function</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Function</p><p> End If</p><p></p><p> Dim hAddress As Integer</p><p> Dim vBuffer As Single</p><p></p><p> hAddress = Address</p><p> ReadProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0)</p><p> Return vBuffer</p><p> End Function</p><p></p><p> Public Function ReadLong(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Long</p><p> If ProcessName.EndsWith(".exe") Then</p><p> ProcessName = ProcessName.Replace(".exe", "")</p><p> End If</p><p> Dim MyP As Process() = Process.GetProcessesByName(ProcessName)</p><p> If MyP.Length = 0 Then</p><p> MessageBox.Show(ProcessName & " isn't open!")</p><p> Exit Function</p><p> End If</p><p> Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id)</p><p> If hProcess = IntPtr.Zero Then</p><p> MessageBox.Show("Failed to open " & ProcessName & "!")</p><p> Exit Function</p><p> End If</p><p></p><p> Dim hAddress As Integer</p><p> Dim vBuffer As Long</p><p></p><p> hAddress = Address</p><p> ReadProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0)</p><p> Return vBuffer</p><p> End Function</p><p></p><p>End Module</p><p>[/CODE]</p><p></p><p>Now make a new form (You should know how to do this....)</p><p>Drag and drop 1 button and 1 label.</p><p>Rename the label to '99999' and the button to 'Ammo':</p><p><img src="http://i.imgur.com/CABiRCF.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </p><p>Double click on the button and paste this code:</p><p>[CODE] Dim ammount As String = LabelX.Text</p><p> Try</p><p> WriteInteger("Program", &H[Offset], ammount)</p><p> WriteInteger("Program", &H[Offset], ammount)</p><p> Catch ex As Exception</p><p> End Try[/CODE]</p><p></p><p>So, how to write this code?</p><p>Program = Process name (ie: BO2 = t6mp)</p><p>Offset = &H (This is ALWAYS needed for BO2, as far as I know)then the offset (ei: Address (Offset) = 02340BD4 = &H2340BD4 (No '0'))</p><p></p><p>So lets put this into 'MY/Your ' code:</p><p>[CODE] Dim ammount As String = Label1.Text</p><p> Try</p><p> WriteInteger("t6mp", &H2340BD4, ammount)</p><p> WriteInteger("t6mp", &H2340BD4, ammount)</p><p> Catch ex As Exception</p><p> End Try[/CODE]</p><p></p><p>Label1 being the label we placed on the form (If you renamed it, change it here too.</p><p></p><p></p><p>AND THATS IT!</p><p></p><p>(WARNING!)</p><p>If you get an error about messageboxes, click the line thats says 'Import' and that should fix it ^.^</p><p></p><p>Q&A:</p><p>Leave them below</p><p></p><p><strong>PLEASE SHOW ME WHAT YOU MAKE! I WANNA SEE SOME SICK DESIGNS!</strong></p><p><strong></strong></p><p>If This Helped You, Be Sure To Like So Keep Me Going ^.^</p></blockquote><p></p>
[QUOTE="Harry, post: 1202, member: 35"] Hello CCM (Nearly typed NGU.... Kill me) Today, Ill be making a tutorial on how to make a custom trainer for ANY CoD on PC (Different Offsets) I'll be using 'Call of Duty: Black Ops II - Redacted Pre-Alpha (Christmas Update)' What you will need: [LIST=1] [*]Visual Studio (I use 2013) [*]A CoD (Preferable what I'm using) [*]Cheat Engine [*]This Thread [*]This Thread: [URL]http://cabconmodding.com/index.php?threads/tutorial-find-offsets-for-pc-games.54/[/URL] [/LIST] Difficulty: [B][U][I]Beginner[/I][/U][/B] [I]Intermediate Advanced 1337 HaXoR[/I] Lets begin! First, open the game, attach using cheat engine and find an offset (Use the thread linked above for how to do that. Thanks '[I]God[/I]') Now you need to make a new 'Visual Basic' Console Program like this: (Console Application) [IMG]http://i.imgur.com/NzkVmLN.png[/IMG] And click 'OK' Now lets begin. First, find your offset: [IMG]http://i.imgur.com/652DZN6.png[/IMG] (This is Primary Unlimited Ammo on NIGHTLY Redacted) So now lets go to Visual Studio. In the script, paste this whole code (Delete anything that's in there) [CODE]Module Module1 Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer Private Declare Function WriteProcessMemory1 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer Private Declare Function WriteProcessMemory2 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single Private Declare Function WriteProcessMemory3 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long Private Declare Function ReadProcessMemory1 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer Private Declare Function ReadProcessMemory2 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single Private Declare Function ReadProcessMemory3 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long Const PROCESS_ALL_ACCESS = &H1F0FF Public Function WriteDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Integer, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean Try Dim lvl As Integer = Address For i As Integer = 1 To Level lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1) Next WriteInteger(Process, lvl, Value, nsize) Return True Catch ex As Exception Return False End Try End Function Public Function ReadDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Integer Try Dim lvl As Integer = Address For i As Integer = 1 To Level lvl = ReadInteger(Process, lvl, nsize) + Offsets(i - 1) Next Dim vBuffer As Integer vBuffer = ReadInteger(Process, lvl, nsize) Return vBuffer Catch ex As Exception End Try End Function Public Function WriteDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Single, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean Try Dim lvl As Integer = Address For i As Integer = 1 To Level lvl = ReadFloat(Process, lvl, nsize) + Offsets(i - 1) Next WriteFloat(Process, lvl, Value, nsize) Return True Catch ex As Exception Return False End Try End Function Public Function ReadDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Single Try Dim lvl As Integer = Address For i As Integer = 1 To Level lvl = ReadFloat(Process, lvl, nsize) + Offsets(i - 1) Next Dim vBuffer As Single vBuffer = ReadFloat(Process, lvl, nsize) Return vBuffer Catch ex As Exception End Try End Function Public Function WriteDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Long, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean Try Dim lvl As Integer = Address For i As Integer = 1 To Level lvl = ReadLong(Process, lvl, nsize) + Offsets(i - 1) Next WriteLong(Process, lvl, Value, nsize) Return True Catch ex As Exception Return False End Try End Function Public Function ReadDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Long Try Dim lvl As Integer = Address For i As Integer = 1 To Level lvl = ReadLong(Process, lvl, nsize) + Offsets(i - 1) Next Dim vBuffer As Long vBuffer = ReadLong(Process, lvl, nsize) Return vBuffer Catch ex As Exception End Try End Function Public Sub WriteNOPs(ByVal ProcessName As String, ByVal Address As Long, ByVal NOPNum As Integer) Dim C As Integer Dim B As Integer If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Sub End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Sub End If B = 0 For C = 1 To NOPNum Call WriteProcessMemory1(hProcess, Address + B, &H90, 1, 0&) B = B + 1 Next C End Sub Public Sub WriteXBytes(ByVal ProcessName As String, ByVal Address As Long, ByVal Value As String) If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Sub End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Sub End If Dim C As Integer Dim B As Integer Dim D As Integer Dim V As Byte B = 0 D = 1 For C = 1 To Math.Round((Len(Value) / 2)) V = Val("&H" & Mid$(Value, D, 2)) Call WriteProcessMemory1(hProcess, Address + B, V, 1, 0&) B = B + 1 D = D + 2 Next C End Sub Public Sub WriteInteger(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Integer, Optional ByVal nsize As Integer = 4) If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Sub End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Sub End If Dim hAddress, vBuffer As Integer hAddress = Address vBuffer = Value WriteProcessMemory1(hProcess, hAddress, CInt(vBuffer), nsize, 0) End Sub Public Sub WriteFloat(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Single, Optional ByVal nsize As Integer = 4) If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Sub End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Sub End If Dim hAddress As Integer Dim vBuffer As Single hAddress = Address vBuffer = Value WriteProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0) End Sub Public Sub WriteLong(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Long, Optional ByVal nsize As Integer = 4) If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Sub End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Sub End If Dim hAddress As Integer Dim vBuffer As Long hAddress = Address vBuffer = Value WriteProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0) End Sub Public Function ReadInteger(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Integer If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Function End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Function End If Dim hAddress, vBuffer As Integer hAddress = Address ReadProcessMemory1(hProcess, hAddress, vBuffer, nsize, 0) Return vBuffer End Function Public Function ReadFloat(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Single If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Function End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Function End If Dim hAddress As Integer Dim vBuffer As Single hAddress = Address ReadProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0) Return vBuffer End Function Public Function ReadLong(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Long If ProcessName.EndsWith(".exe") Then ProcessName = ProcessName.Replace(".exe", "") End If Dim MyP As Process() = Process.GetProcessesByName(ProcessName) If MyP.Length = 0 Then MessageBox.Show(ProcessName & " isn't open!") Exit Function End If Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP(0).Id) If hProcess = IntPtr.Zero Then MessageBox.Show("Failed to open " & ProcessName & "!") Exit Function End If Dim hAddress As Integer Dim vBuffer As Long hAddress = Address ReadProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0) Return vBuffer End Function End Module [/CODE] Now make a new form (You should know how to do this....) Drag and drop 1 button and 1 label. Rename the label to '99999' and the button to 'Ammo': [IMG]http://i.imgur.com/CABiRCF.png[/IMG] Double click on the button and paste this code: [CODE] Dim ammount As String = LabelX.Text Try WriteInteger("Program", &H[Offset], ammount) WriteInteger("Program", &H[Offset], ammount) Catch ex As Exception End Try[/CODE] So, how to write this code? Program = Process name (ie: BO2 = t6mp) Offset = &H (This is ALWAYS needed for BO2, as far as I know)then the offset (ei: Address (Offset) = 02340BD4 = &H2340BD4 (No '0')) So lets put this into 'MY/Your ' code: [CODE] Dim ammount As String = Label1.Text Try WriteInteger("t6mp", &H2340BD4, ammount) WriteInteger("t6mp", &H2340BD4, ammount) Catch ex As Exception End Try[/CODE] Label1 being the label we placed on the form (If you renamed it, change it here too. AND THATS IT! (WARNING!) If you get an error about messageboxes, click the line thats says 'Import' and that should fix it ^.^ Q&A: Leave them below [B]PLEASE SHOW ME WHAT YOU MAKE! I WANNA SEE SOME SICK DESIGNS! [/B] If This Helped You, Be Sure To Like So Keep Me Going ^.^ [/QUOTE]
Verification
Post reply
Forums
Tech Boards
Computer Programming
Source Code & Tutorial
[Beginner Tutorial] Creating a Custom Trainer for PM Games! [MP/ZM]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top