Hi,
I have a read process memory function, which is in a Do ... Loop.
-
Do
-
On Error Resume Next
-
ReadProcessMemory(pHandle, (&H8723E9 + current_byte), Data, 1, 0&)
-
Text = Text + Chr(Data)
-
current_byte = current_byte + 1
-
Loop Until current_byte = 17
-
CloseHandle(pHandle)
-
-
TextBox1.Text = Text
-
It is currently reading a string saying: test-test-test-test-test
What I want is to keep the current character it reads, and add the new one after it. "Text = Text + Chr(Data)".
When I take this out and say "Text = Chr(Data)", then have Text display as MsgBox(Text), it works fine, I see character after character appear, but when I use the above code, then TextBox1.Text is left empty.
What I thought of using was a string/character array, but I have no idea how to use that with my code. I did do an attempt:
-
Dim Text() as String = Nothing
-
ReDim Text(0 to 17)
-
-
Do
-
On Error Resume Next
-
ReadProcessMemory(pHandle, (&H8723E9 + current_byte), Data, 1, 0&)
-
Text(1) = Text(1) + Chr(Data)
-
current_byte = current_byte + 1
-
Text(1) = Text(+1)
-
Loop Until current_byte = 17
-
CloseHandle(pHandle)
-
-
TextBox1.Text = Text
-
But this didnt work either. I also tried using a global variable instead of a local one, but no result either.
Another small problem Im having is that the readprocessmemory skips the very first character, always.
Anyone know how to solve these issues?
Any help appreciated.
Evolution445