• 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Formbox executing an offset
#1
1. open a new project and call it mw2 mp trainer or something like that what you prefer-> forms application or whatever the name is
goto the tab window [...]explorer -> right click "add" - "module"

VB Code
  1. Module Module1
  2.  
  3. #region "Declarations"
  4.  
  5. Private Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
  6. Private Declare Function WriteProcessMemory 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
  7. Private Declare Function WriteFloatMemory 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 Integer
  8. Private Declare Function ReadFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByRef buffer As Single, ByVal size As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
  9. Private Declare Function ReadProcessMemory 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
  10. Private Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer
  11.  
  12. Private string1 As Long
  13. Private string2 As Integer
  14. Private RBuff1 As Long
  15. Private RBuff2 As Single
  16. Private RBuff3 As Integer
  17.  
  18. #end region
  19.  
  20. #Region "Check Process/ReadDll"
  21.  
  22. Private Function readdll(ByVal modulename As String)
  23. Dim procmodule As ProcessModule
  24. Dim constant1 As Integer
  25. Dim constant2 As Long
  26. Dim constant3 As Process() = Process.GetProcessesByName("iw4mp")
  27. If constant3.Length = 0 Then
  28. Return 0
  29. End If
  30. For Each procmodule In constant3(0).Modules
  31. If modulename = procmodule.ModuleName Then
  32. constant1 = procmodule.BaseAddress
  33. End If
  34. Next
  35. constant2 = constant1
  36. Return constant2
  37. End Function
  38.  
  39. Public Function IsProcessOpen(ByVal name As String) As Boolean
  40.  
  41. For Each clsProcess As Process In Process.GetProcesses
  42.  
  43. If clsProcess.ProcessName.Contains(name) Then
  44.  
  45.  
  46. Return True
  47.  
  48. End If
  49. Next
  50. ' Do nothing
  51. Return False
  52. End Function
  53.  
  54.  
  55. #end region
  56.  
  57. #Region "Hacks"
  58.  
  59. 'WriteMemory
  60. Private Function WriteMemory(ByVal Address As Integer, ByVal Value As Long, ByVal Bytes As Integer)
  61. Dim iw4mpLookUp As Process() = Process.GetProcessesByName("iw4mp")
  62. If iw4mpLookUp.Length = 0 Then
  63. End
  64. End If
  65. Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, iw4mpLookUp(0).Id)
  66. WriteProcessMemory(processHandle, Address, Value, Bytes, Nothing)
  67. CloseHandle(processHandle)
  68.  
  69. Return Nothing
  70. End Function
  71.  
  72. 'WriteFloat
  73. Private Function WriteFloat(ByVal Address As Integer, ByVal Value As Single)
  74. Dim iw4mpLookUp As Process() = Process.GetProcessesByName("iw4mp")
  75. If iw4mpLookUp.Length = 0 Then
  76. End
  77. End If
  78. Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, iw4mpLookUp(0).Id)
  79. WriteFloatMemory(processHandle, Address, Value, 4, Nothing)
  80. CloseHandle(processHandle)
  81.  
  82. Return Nothing
  83. End Function
  84.  
  85. 'NOP
  86. Private Function NOP(ByVal Address As Integer, ByVal value As Integer)
  87. Dim iw4mpLookUp As Process() = Process.GetProcessesByName("iw4mp")
  88. If iw4mpLookUp.Length = 0 Then
  89. End
  90. End If
  91. Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, iw4mpLookUp(0).Id)
  92. WriteProcessMemory(processHandle, Address, value, 1, Nothing)
  93. CloseHandle(processHandle)
  94.  
  95. Return Nothing
  96. End Function
  97.  
  98. #End region
  99.  
  100. #Region "Functions"
  101.  
  102. Public Function WriteMemory(ByVal address As String, ByVal value As Long, ByVal bytes As Byte)
  103. If IsProcessOpen("iw4mp") Then
  104.  
  105. string1 = readdll("cshell.dll")
  106. string2 = "&H" & Hex(string1 + address)
  107. WriteMemory(string2, value, bytes)
  108. End If
  109. Return Nothing
  110. End Function
  111.  
  112. Public Function floath4x(ByVal address As String, ByVal value As Long)
  113. If IsProcessOpen("iw4mp") Then
  114.  
  115. string1 = readdll("cshell.dll")
  116. string2 = "&H" & Hex(string1 + address)
  117. WriteFloat(string2, value)
  118. End If
  119. Return Nothing
  120. End Function
  121.  
  122. Public Function noph4x(ByVal address As String, ByVal value As Long)
  123. If IsProcessOpen("iw4mp") Then
  124. string1 = readdll("cshell.dll")
  125. string2 = "&H" & Hex(string1 + address)
  126. NOP(string2, value)
  127.  
  128.  
  129. End If
  130. Return Nothing
  131. End Function
  132.  
  133. #end region
  134. End Module[/php]
  135.  
  136. 2. add the form box
  137.  
  138. [php]public class form1
  139. private sub button1_click(byval sender as system.object, byval e as system.eventargs)
  140. handles button1.click
  141. WriteMemory(&H12BC89C, 2516000, 4) 'Exp code //click for level 70
  142. end sub
  143. end class


u need to switch those offsets from c to vb, that means 0x -> &h

for example:
VB Code
  1. WriteMemory(&H645CDF8, 0, 4) 'Party_hostmigration
  2. WriteMemory(&H645CE08, 0, 4) 'Party_hostmigration
  3.  
  4. WriteMemory(&H645CB78, 1, 4) 'Party_connecttimeout
  5. WriteMemory(&H645CB88, 1, 4) 'Party_connecttimeout
  6.  
  7. WriteMemory(&H645E518, 0, 4) 'Badhost_endgameifisuck
  8. WriteMemory(&H645E528, 0, 4) 'Badhost_endgameifisuck


VB Code
  1. Public Class Form1
  2. <DllImport("kernel32.dll")> _
  3. Public Shared Function WriteProcessMemory( _
  4. ByVal hProcess As IntPtr, _
  5. ByVal lpBaseAddress As IntPtr, _
  6. ByVal lpBuffer As Byte(), _
  7. ByVal nSize As UInt32, _
  8. ByRef lpNumberOfBytesWritten As UInt32 _
  9. ) As Boolean
  10. End Function
  11.  
  12. Dim hProcess As Process() = Process.GetProcessesByName("iw4mp")
  13.  
  14. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  15. WriteProcessMemory(hProcess(0).Handle, &H4393E0, New Byte() {255}, 4, 0)
  16. End Sub
  17. End Class
[-] The following 1 user says Thank You to d0h! for this post:
  • Helios
  Reply
#2
Use [php] codetags please.
  Reply
#3
fixed, but it destroyed the size of the thread
  Reply
#4
Um you don't have to use modules if you installed Blubbs DLL unless your doing something else I can't really see code I'm on my iPod
[-] The following 1 user says Thank You to Cgallagher for this post:
  • TheUniverse
  Reply
#5
well not everybody has to use "blubbs" dll Wink
  Reply
#6
Just Download it of MPGH

or upload it here doh
  Reply
#7
Using a dll to use WPM is really a failure. If you need to do that you didn't get the idea of using the Windows API to keep your code small (unlike embedding a 3rd Party DLL)
  Reply
#8
Oh ok thx super for the info
  Reply
#9
Thanks so much guys i was looking for this a long time ago!!!Big Grin
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Current Map Offset Deviler86 7 1,306 09-03-2012, 09:47
Last Post: Pozzuh
  Read Client Offset Value or Text zraile 1 1,028 04-06-2012, 03:00
Last Post: Nukem
  [Request] blackops SP offset's rotceh_dnih 2 1,132 11-27-2011, 02:52
Last Post: rotceh_dnih
  [Release] Offset-Refinder aosma8 3 1,374 03-04-2011, 06:39
Last Post: aosma8

Forum Jump:


Users browsing this thread: 1 Guest(s)