this is a snippet of my code...

----------

For MemRegion = baseAddr To endAddr Step 4096
RetVal = ReadProcessMemory(hProcess, MemRegion, ReadBuffer, 4096, 0&)

If RetVal Then
FoundLocation = InStr(ReadBuffer, SearchString)
If FoundLocation Then Exit For
End If

Next MemRegion

----------

readbuffer is dimed as ..... "Dim ReadBuffer As String * 4096" .... everything else is fine....

what im trying to do is read 4kb (default pagefile size) chunks of memory.... and im looping through a start and end address. those i get with virtualqueryex, and that works fine, but when i use the loop above, vb crashes... something with the readprocessmemory isnt correct...... whats wrong? .. you SHOULD be able to read 4kb chunks, right?