Write Memory to Process..

Posted on 2012-08-23
Last Modified: 2012-08-28
HWND hWnd = FindWindow(0, "WindowName"); 

DWORD proc_id; 
GetWindowThreadProcessId(hWnd, &proc_id); 
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id); 

BYTE newdata[]={0x72, 0x65, 0x64, 0x70, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 

DWORD newdatasize = sizeof(newdata); 
WriteProcessMemory(hProcess, (LPVOID)0x5C6600, &newdata, newdatasize, NULL);

Open in new window

Correct or wrong? Because I get these external symbol errors?

Edit: I may have solved my question but I'll keep this up just incase not.
Question by:RevJoker
    LVL 86

    Assisted Solution

    Hmmm, which "external symbol errors"? Apart from that, the code seems OK, given that the the address constants are valid and accessible and that your process has the privileges to perform the API calls in question.
    LVL 1

    Accepted Solution

    I need to call and add some dependencies, so It'll know what it is.
    LVL 1

    Author Closing Comment

    I found the answer myself..

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now