• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 706
  • Last Modified:

Write Memory to Process..

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.
0
RevJoker
Asked:
RevJoker
  • 2
2 Solutions
 
jkrCommented:
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.
0
 
RevJokerAuthor Commented:
I need to call and add some dependencies, so It'll know what it is.
0
 
RevJokerAuthor Commented:
I found the answer myself..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now