Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PLEASE HELP: WriteProcessMemory AV

5 views
Skip to first unread message

oknp

unread,
Apr 13, 2001, 9:54:00 PM4/13/01
to
PLEASE HELP... THANKS!!

reading a byte from a remote process is ok but got an access violation when
trying to write it back. hp (the remote process) was opened with
PROCESS_ALL_ACCESS. image_base was obtained from MapAndLoad.


ReadProcessMemory(hp,(LPCVOID)image_base,&byte,1,&dwRead); // OK
WriteProcessMemory(hp,(LPVOID)image_base,&byte,1,&dwWrite); // failed with
ERROR_NOACCESS (Invalid access to memory location)

oknp

unread,
Apr 13, 2001, 10:30:37 PM4/13/01
to
ok i found the problem. i walked the process virtual address space and found
out the access protection of the pages in the region for allocation base
started at 0x400000 (image_base) is PAGE_READONLY.

let me tell you want i want to do:
i want to run the code of process, say P1, in the context of another
process, say P2. the way i am trying to do this is:
1. createprocess P1, CREATE_SUSPEND
2. createprocess P2, CREATE_SUSPEND
3. copy P1's process address space to P2's process addr space
4. resumethread (p2.mainthread)

any idea whether this is possible?

thanks...

"oknp" <ok...@hotmail.com> wrote in message
news:9b8aei$kg...@imsp212.netvigator.com...

Joe Durusau

unread,
Apr 16, 2001, 9:53:50 AM4/16/01
to
I wouldn't expect any system to let you do that sort of thing.
After all, if the system let you write back to another process, what is
to
say that the other process has no special privs that would let it damage
the system? If there is some executable that you want to run in your
process,
you can do that. But I don;t think that any system is going to let you
pull out segments of code and execute them sleectively in another
process.

Speaking only for myself,

Joe Durusau

Navin Pai

unread,
Apr 20, 2001, 1:24:28 AM4/20/01
to
This is definitely possible
if under windows nt/2k use api "CreateRemoteThread()". this function lets u
create ur thread in another processes address space ....
windows9x/me ignores this api

navin

"oknp" <ok...@hotmail.com> wrote in message

news:9b8cli$il...@imsp212.netvigator.com...

0 new messages