SolvedVB Read String from memory

Posts 14 of 4 · Page 1 of 1
VB Read String from memory
Hello, just tried to Read all players, I tried to add a own Function but it Always throw a NullpointerException could some one help me?
I use the Modul from this site [Removed from author]
No external links.
Also A nullpointer error happens when you don't create an object for the class first.

Code:

MemoryModule memMod = new MemoryModule();
Quote Originally Posted by Kenshin13 View Post
No external links.
Also A nullpointer error happens when you don't create an object for the class first.

Code:

MemoryModule memMod = new MemoryModule();
Usually, Visual Studio won't even let your code be compiled if he need to create an instance of the object, so I believe that's not the problem. Just debug your code.. you're not setting a value appropriately... You should be able to see it if you coded it.
I always get a Null Pointer Exception here
cbFrost2Player1.Text = ReadString(MW3(0), &HA12A70)
I added this to the Modul

Public RBuffString(20) As Byte
Public returnString As String

Public Function ReadString(ByVal ProcessName As Process, ByVal Address As Integer)

Dim GameLookUp As Process() = Process.GetProcessesByName(ProcessName.ProcessName )

If GameLookUp.Length = 0 Then

End

End If

Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)

ReadProcessMemory(processHandle, Address, RBuffString(0), 20, Nothing)

returnString = System.Text.Encoding.ASCII.GetString(RBuffString)


CloseHandle(processHandle)

Return returnString

End Function
I have a button which freez my ammo and he works fine so MW3(0) shoulden't be null
And I don't know why q.q only coded a lot with jave befor

Got it to work
@MarkHC @Nachos solved
Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?