Write and Read Process Memory
I have a question can someone help me please. I'd like to convert this C++ code into VB.
BYTE SearchMem[6] = {0xE9,0x5C,0x01,0x00,0x00,0x90};
Does anyone know how to convert that into VB. Please help me.
[226 byte] By [
rocrfella] at [2007-11-11 10:04:44]

# 3 Re: Write and Read Process Memory
I have another question. When I tried to write an array, I get a mismatch. Can you help me on how to to write an array to memory please.
In C++ i just use Write SearchMem but in VB6 I get an error.
# 4 Re: Write and Read Process Memory
I don't understand what u want exactly ? after initializing the array it's allready writen in the memory , do u mean specify address for each member of the array ? vb haven't the power to use adress like c++ .
Amahdy at 2007-11-11 17:26:21 >

# 5 Re: Write and Read Process Memory
I'm trying to write the array byte into a specific offset.
WriteProcessMemory(hand, (void*)(0x13EDE5), &data, 6, &bytes);
in C++ it will write the byte array into that specific offset, but in VB i'm keep getting type mismatch.
Dim a(1 To 3) As Byte
a(1) = &H38
a(2) = &H46
a(3) = &HD9
Call WriteProcessMemory(pi32.hProcess, &H13EDE5, a, 3, 0&)
I'm trying to write "a" into the &H13EDE5 offset, but it says type mismatch.
is there a code that would make the array shows each of the member? help me out please.
# 6 Re: Write and Read Process Memory
"a" is a literal value, to write it into a specific element of the array you need to convert it to it's ascii value and assign that to the element of the array where you want it. Like So:
a(3) = Asc("a")
Now if you are trying to write the entire contents of the "a" array into the specific memory location and the function needs the address of where the a array starts then you need to pass it the first element a(1). Like So:
Call WriteProcessMemory(pi32.hProcess, &H13EDE5, a(1), 3, 0&)