Thanks again zacs7! (second time you've helped me)
Now the code parses correctly with no errors but it doesn't actually output anything :P
Code:
#include <stdio.h>
#include <windows.h>
HANDLE msWin;
DWORD pID = 0;
DWORD buf = 0;
DWORD memAddr = 0x007D4E28;
int main(void)
{
int number = 0000;
printf("Enter the number at which you wish to start at\n");
scanf("%04d", &number);
HWND mWin = FindWindow(NULL, "Untitled - Notepad");
if(mWin) {
printf("Started spamming.\n");
char buff[5];
DWORD wTP = GetWindowThreadProcessId(mWin, &pID);
msWin = OpenProcess(PROCESS_ALL_ACCESS, 0, pID);
for (; number < 9999 ;)
{
Sleep(10);
ReadProcessMemory(msWin, (LPVOID)memAddr, (LPVOID)&buf, 2, NULL);
if ( buf != 0 ) {
printf("Died?");
system("PAUSE");
}
else {
sprintf(buff, "%04d", number);
PostMessage((HWND) msWin, WM_CHAR, (WPARAM) (char *)buff, (LPARAM) 0);
PostMessage((HWND) msWin, WM_CHAR, VK_RETURN,(LPARAM)0);
number =+ 1;
}
}
else {
printf("Victim not found D:\n");
system("PAUSE");
return 0;
}
}
Any ideas?