Advertisement
Asfelius

Rest

Jul 16th, 2022
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How do you change the process during runtime?
  2. I've added a function called "SetProcessName" which allows you to do that.
  3.  
  4. Example:
  5. Code:
  6. SetProcessName("iw6sp64_ship")
  7. How do you know what the current process is set to?
  8. Use the "GetCurrentProcessName" function.
  9.  
  10. How do I know if the process/game is open?
  11. There's a function called "UpdateProcessHandle" which returns a boolean saying if the game is active or not.
  12.  
  13. Example (in a timer):
  14. Code:
  15. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  16. If UpdateProcessHandle() Then ' Check if the game is running
  17. ' Do stuff here, like writing/reading memory or telling a user in a Label the game is open.
  18. End If
  19. End Sub
  20.  
  21. How do I read or write memory?
  22. Version 1 of the memory module made things a little complicated for writing memory but this version tries to fix that. To read or write memory, you use the "ReadMemory" or "WriteMemory" functions.
  23.  
  24. ' Reads the value from 0x12345678 as an Integer
  25. Dim myIntValue As Integer = ReadMemory(Of Integer)(&H12345678)
  26.  
  27. ' Reads the value from 0x12345678 as a Single (remember that Single is the same as Float)
  28. Dim myFloatValue As Single = ReadMemory(Of Single)(&H12345678)
  29.  
  30. ' Reads 10 characters at 0x12345678 as an ASCII String
  31. Dim myASCIIStringValue As String = ReadMemory(Of String)(&H12345678, 10, False)
  32.  
  33. ' Reads 10 characters at 0x12345678 as a Unicode String
  34. Dim myUnicodeStringValue As String = ReadMemory(Of String)(&H12345678, 10, True)
  35.  
  36. ' Reads 12 bytes from 0x12345678
  37. Dim myByteData() As Byte = ReadMemory(&H12345678, 12)
  38.  
  39. ' Writes 10 as an Integer to 0x12345678
  40. WriteMemory(Of Integer)(&H12345678, 10)
  41.  
  42. ' Writes 0.5 as a Single/Float to 0x12345678
  43. WriteMemory(Of Single)(&H12345678, 0.5)
  44.  
  45. ' Writes Hello World as an ASCII string to 0x12345678 (the + vbNullChar erases the rest of the old string)
  46. WriteMemory(Of String)(&H12345678, "Hello World" + vbNullChar, False)
  47.  
  48. ' Writes Hello World as a Unicode string to 0x12345678 (the + vbNullChar erases the rest of the old string)
  49. WriteMemory(Of String)(&H12345678, "Hello World" + vbNullChar, True)
  50.  
  51. ' Writes '0x90, 0x90, 0x90, 0x90' as a byte array to 0x12345678
  52. WriteMemory(&H12345678, New Byte() { &H90, &H90, &H90, &H90 })
  53.  
  54. How do I read or write a number into memory if I'm going to get it from a textbox or a string?
  55. Since VB.NET (by default) doesn't care much about types (they are converted automatically), you should be able to get away with this:
  56.  
  57. ' Reads the integer from the address inside TextBox1 (warning: the string must start with &H if its an address/hex value)
  58. Dim myIntValue As Integer = ReadMemory(Of Integer)("&H" + TextBox1.Text)
  59.  
  60. ' Writes the value from TextBox1 into 0x12345678 as an integer
  61. WriteMemory(Of Integer)(&H12345678, TextBox1.Text)
  62.  
  63. ' Writes the value from TextBox1 into 0x12345678 as a single/float
  64. WriteMemory(Of Single)(&H12345678, TextBox1.Text)
  65.  
  66. ' Writes 10 into the address inside TextBox1 as an integer (warning: the string must start with &H if its an address/hex value)
  67. WriteMemory(Of Integer)("&H" + TextBox1.Text, 10)
  68.  
  69. What's the difference between a ASCII and Unicode string?
  70. Unicode strings use 2 bytes for every letter it uses and ASCII only uses 1 byte for every letter. If you find a string in memory with Cheat Engine with the Unicode box unticked then it's a ASCII string. If the Unicode box is ticked then it's a Unicode string.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement