The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
VB NTE
By Guest on 20th May 2019 12:50:06 AM | Syntax: TEXT | Views: 23



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. 'VB.NET Module
  2. 'Author : Cless
  3. 'How to use Read/Write Pointer
  4. 'Example Read
  5. '       Me.Text = ReadPointerInteger(Game exe name, &HPointer,&HOffset).ToString()
  6. '
  7. '       Me.Text = ReadPointerInteger("gta_sa", &HB71A38,&H540).ToString()
  8. '       Or
  9. '       Me.Text = ReadPointerInteger("gta_sa", &HB71A38,&H540,&H544).ToString()
  10. 'Example Write
  11. '       WritePointerInteger(Game exe name,&HPointer,Value,&HOffset)
  12. '
  13. '       WritePointerInteger("gta_sa",&HB71A38,1000,&H540)
  14. '       Or
  15. '       WritePointerInteger("gta_sa",&HB71A38,1000,&H540, &H544)
  16.  
  17. Module Trainer
  18.     Private Declare Function ReadMemoryByte Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Byte
  19.     Private Declare Function ReadMemoryInteger Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Integer, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Integer
  20.     Private Declare Function ReadMemoryFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Single, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Single
  21.     Private Declare Function ReadMemoryDouble Lib "kernel32" Alias "ReadProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Double, Optional ByVal Size As Integer = 8, Optional ByRef Bytes As Integer = 0) As Double
  22.  
  23.     Private Declare Function WriteMemoryByte Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Byte, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Byte
  24.     Private Declare Function WriteMemoryInteger Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Integer, Optional ByVal Size As Integer = 4, Optional ByRef Bytes As Integer = 0) As Integer
  25.     Private Declare Function WriteMemoryFloat Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Single, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Single
  26.     Private Declare Function WriteMemoryDouble Lib "kernel32" Alias "WriteProcessMemory" (ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Double, Optional ByVal Size As Integer = 2, Optional ByRef Bytes As Integer = 0) As Double
  27.  
  28.     Public Function ReadByte(ByVal EXENAME As String, ByVal Address As Integer) As Byte
  29.         Dim Value As Byte
  30.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  31.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  32.             If Handle <> 0 Then
  33.                 ReadMemoryByte(Handle, Address, Value)
  34.             End If
  35.         End If
  36.         Return Value
  37.     End Function
  38.  
  39.     Public Function ReadInteger(ByVal EXENAME As String, ByVal Address As Integer) As Integer
  40.         Dim Value As Integer
  41.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  42.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  43.             If Handle <> 0 Then
  44.                 ReadMemoryInteger(Handle, Address, Value)
  45.             End If
  46.         End If
  47.         Return Value
  48.     End Function
  49.  
  50.     Public Function ReadFloat(ByVal EXENAME As String, ByVal Address As Integer) As Single
  51.         Dim Value As Single
  52.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  53.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  54.             If Handle <> 0 Then
  55.                 ReadMemoryFloat(Handle, Address, Value)
  56.             End If
  57.         End If
  58.         Return Value
  59.     End Function
  60.  
  61.     Public Function ReadDouble(ByVal EXENAME As String, ByVal Address As Integer) As Double
  62.         Dim Value As Double
  63.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  64.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  65.             If Handle <> 0 Then
  66.                 ReadMemoryByte(Handle, Address, Value)
  67.             End If
  68.         End If
  69.         Return Value
  70.     End Function
  71.  
  72.     Public Function ReadPointerByte(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Byte
  73.         Dim Value As Byte
  74.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  75.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  76.             If Handle <> 0 Then
  77.                 For Each I As Integer In Offset
  78.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  79.                     Pointer += I
  80.                 Next
  81.                 ReadMemoryByte(Handle, Pointer, Value)
  82.             End If
  83.         End If
  84.         Return Value
  85.     End Function
  86.  
  87.     Public Function ReadPointerInteger(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Integer
  88.         Dim Value As Integer
  89.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  90.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  91.             If Handle <> 0 Then
  92.                 For Each I As Integer In Offset
  93.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  94.                     Pointer += I
  95.                 Next
  96.                 ReadMemoryInteger(Handle, Pointer, Value)
  97.             End If
  98.         End If
  99.         Return Value
  100.     End Function
  101.  
  102.     Public Function ReadPointerFloat(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Single
  103.         Dim Value As Single
  104.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  105.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  106.             If Handle <> 0 Then
  107.                 For Each I As Integer In Offset
  108.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  109.                     Pointer += I
  110.                 Next
  111.                 ReadMemoryFloat(Handle, Pointer, Value)
  112.             End If
  113.         End If
  114.         Return Value
  115.     End Function
  116.  
  117.     Public Function ReadPointerDouble(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Double
  118.         Dim Value As Double
  119.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  120.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  121.             If Handle <> 0 Then
  122.                 For Each I As Integer In Offset
  123.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  124.                     Pointer += I
  125.                 Next
  126.                 ReadMemoryDouble(Handle, Pointer, Value)
  127.             End If
  128.         End If
  129.         Return Value
  130.     End Function
  131.  
  132.     Public Sub WriteByte(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Byte)
  133.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  134.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  135.             If Handle <> 0 Then
  136.                 WriteMemoryByte(Handle, Address, Value)
  137.             End If
  138.         End If
  139.     End Sub
  140.  
  141.     Public Sub WriteInteger(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Integer)
  142.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  143.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  144.             If Handle <> 0 Then
  145.                 WriteMemoryInteger(Handle, Address, Value)
  146.             End If
  147.         End If
  148.     End Sub
  149.  
  150.     Public Sub WriteFloat(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Single)
  151.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  152.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  153.             If Handle <> 0 Then
  154.                 WriteMemoryFloat(Handle, Address, Value)
  155.             End If
  156.         End If
  157.     End Sub
  158.  
  159.     Public Sub WriteDouble(ByVal EXENAME As String, ByVal Address As Integer, ByVal Value As Double)
  160.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  161.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  162.             If Handle <> 0 Then
  163.                 WriteMemoryDouble(Handle, Address, Value)
  164.             End If
  165.         End If
  166.     End Sub
  167.  
  168.     Public Sub WritePointerByte(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Byte, ByVal ParamArray Offset As Integer())
  169.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  170.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  171.             If Handle <> 0 Then
  172.                 For Each I As Integer In Offset
  173.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  174.                     Pointer += I
  175.                 Next
  176.                 WriteMemoryByte(Handle, Pointer, Value)
  177.             End If
  178.         End If
  179.     End Sub
  180.  
  181.     Public Sub WritePointerInteger(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Integer, ByVal ParamArray Offset As Integer())
  182.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  183.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  184.             If Handle <> 0 Then
  185.                 For Each I As Integer In Offset
  186.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  187.                     Pointer += I
  188.                 Next
  189.                 WriteMemoryInteger(Handle, Pointer, Value)
  190.             End If
  191.         End If
  192.     End Sub
  193.  
  194.     Public Sub WritePointerFloat(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Single, ByVal ParamArray Offset As Integer())
  195.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  196.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  197.             If Handle <> 0 Then
  198.                 For Each I As Integer In Offset
  199.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  200.                     Pointer += I
  201.                 Next
  202.                 WriteMemoryFloat(Handle, Pointer, Value)
  203.             End If
  204.         End If
  205.     End Sub
  206.  
  207.     Public Sub WritePointerDouble(ByVal EXENAME As String, ByVal Pointer As Integer, ByVal Value As Double, ByVal ParamArray Offset As Integer())
  208.         If Process.GetProcessesByName(EXENAME).Length <> 0 Then
  209.             Dim Handle As Integer = Process.GetProcessesByName(EXENAME)(0).Handle
  210.             If Handle <> 0 Then
  211.                 For Each I As Integer In Offset
  212.                     ReadMemoryInteger(Handle, Pointer, Pointer)
  213.                     Pointer += I
  214.                 Next
  215.                 WriteMemoryDouble(Handle, Pointer, Value)
  216.             End If
  217.         End If
  218.     End Sub
  219. End Module



  • Recent Pastes