Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6559749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:22:12+00:00 2026-05-25T13:22:12+00:00

Could someone please help me, I do not know why the ReadProcessMemory function fails

  • 0

Could someone please help me, I do not know why the ReadProcessMemory function fails and GetLastError = 299. Here is my code, I can’t see that im doing anything wrong.

if(ReadProcessMemory(hProcess, (void*)0, IDH_Buffer, sizeof(IMAGE_DOS_HEADER), 0) != true)
        std::cout << "Failed to read from Process, GLE=" << GetLastError()  << "\n";

IDH_Buffer has be assigned, hProcess is non NULL

My App is running as Admin and the app that im trying to read from is a standard usermode application.

Please could you advise me.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:22:12+00:00Added an answer on May 25, 2026 at 1:22 pm

    Quoting from MSDN on Win32 error codes:

    ERROR_PARTIAL_COPY
    299 (0x12B)
    Only part of a ReadProcessMemory or WriteProcessMemory request was completed.

    My guess is the address you specified contained some valid data, but somewhere between that address and (address + length of copy), there was no memory mapped.

    See wikipedia on page table or virtual memory to understand a bit more about how an operating system establishes an address space. In that parlance, somewhere in that memory range there was a page table entry that was not valid.

    Actually, looking at your code… It’s obvious that this won’t work. The BaseAddress parameter is zero. You’re trying to dereference a NULL pointer in the other process’s address space. If the target process itself tried to pull this, it would crash. 🙂 The EXE’s header is not mapped to address 0. If you are trying to read from the EXE file itself, I would suggest simply calling CreateFile on a path obtained by GetModuleFileNameEx.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone please help me in here, I'm just a beginner who want to
Could someone please help explain why I can't get this to work? I properly
could someone please help me out with the (simplified) code below. I'm trying to
I've recently written this with help from SO. Now could someone please tell me
Could someone please tell me which objects types can be tested using Regular Expressions
Could someone help me in setting the background of a CellTable row please, I've
Could someone please demystify interfaces for me or point me to some good examples?
Could someone please explain the best way to connect to an Interbase 7.1 database
Could someone please point me toward a cleaner method to generate a random enum
Could someone please explain? I couldn't find anything on the internet, everything talks about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.