CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Posts
    46

    ReadProcessMemory() Function

    do you have to provide the address where you want to read or are there any means of getting memory addresses location used by the process to read?

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: ReadProcessMemory() Function

    Your question is about well documented ReadProcessMemory. Can I ask you, what part of the article looks not clear to you?

    lpBaseAddress [in]

    A pointer to the base address in the specified process from which to read. Before any data transfer occurs, the system verifies that all data in the base address and memory of the specified size is accessible for read access, and if it is not accessible the function fails.
    Best regards,
    Igor

  3. #3
    Join Date
    Aug 2009
    Posts
    46

    Re: ReadProcessMemory() Function

    Yes my question is, How would you know about the memory used by process and derive the base address from it?

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: ReadProcessMemory() Function

    If you explain what you intend to accomplish, possible you'll be advised on that.
    Best regards,
    Igor

  5. #5
    Join Date
    Aug 2009
    Posts
    46

    Re: ReadProcessMemory() Function

    I want to read the icon position on my desktop in win32 application because someone advised me to read the listview memory within the explorer.exe so I was trying to figured out how the readprocessmemory function works.

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: ReadProcessMemory() Function

    The main thing with the scenario you described is that list view control must be provided with some address in explorer process address space to let it be able to write the data.

    So, having this in mind, you have to follow the main pattern of how normal application works: allocate some memory enough for write operation inside the remote process (by means of VirtualAllocEx), provide that address in a message to list view control, and after successful call, read remote memory to your process. And do not forget to free the allocated remote memory (VirtualFreeEx).
    Best regards,
    Igor

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured