how can i access other program memory ?
a. anyprog
b. from dll(plugin of the program)

bye
thanks
eko
Posted on 2004-07-24 20:37:01 by eko
a. interprocess memory access is done through VirtualAllocEx, WriteProcessMemory and ReadProcessMemory. You must have a valid handle to the other process with VM_READ/WRITE/OPERATION rights. You can obtain this (if your permissions are adequate) when you open a process handle using OpenProcess. You can see an example in my LVDesktop9xNT example on my website.

b. The DLL's base address is it's module handle, you can either export the memory location as a label or calculate it as an offset from the base address. Generally it is much easier just to export the label.
Posted on 2004-07-25 08:04:03 by donkey
thanks

have another question




CreateMemory proc howmany:DWORD

invoke GetProcessHeap
mov hHeap,eax
mov ecx,howmany
mov blocksnumber,ecx
imul ecx,sizeof block
invoke HeapAlloc,eax,HEAP_ZERO_MEMORY, ecx;x*sizeof block ; x* (size of mystruct pointer)
mov [BlockStructPtr ],eax ;the actual structure 'object' as I call it
ret
CreateMemory endp

CleanMemory proc

;invoke GetProcessHeap
invoke HeapFree,hHeap, NULL, BlockStructPtr
ret

CleanMemory endp

ReSizeMemory proc more:DWORD
mov ecx,more
mov blocksnumber,ecx
;invoke GetProcessHeap
;mov ecx,blocksnumber
imul ecx,sizeof block
invoke HeapReAlloc, hHeap,HEAP_GENERATE_EXCEPTIONS or HEAP_ZERO_MEMORY,BlockStructPtr, ecx
or eax,eax
jnz _noerror
invoke CleanMemory
PrintText "ERROR ReSizeMemory"
_noerror:
ret

ReSizeMemory endp


my problem is the ReSize Memory function sometime it gives "Invalid access to memory location."

anyideas why?

bye
thanks
eko
Posted on 2004-07-25 19:54:09 by eko