Thats not quite what I had in mind. :P
I would be looking for a function that can do this:
In the string: "WAdddDWFS" could replace all the d's with a certain character, but the D's aren't always in the same spot.
Here is my project so far, I got all the pragma stuff from my friend Dave, who knows more C++ then I do, the rest is by me.
Code:
#pragma comment(lib, "msvcrt.lib")
#pragma comment(linker, "/NODEFAULTLIB:LIBCD")
#pragma comment(linker,"/SECTION:.text,EWR /IGNORE:4078")
#pragma comment(linker,"/OPT:NOWIN98")
#pragma comment(linker,"/MERGE:.rdata=.text /MERGE:.data=.text")
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
F6 = 117
F7 = 118
F11 = 122
*/
HWND winHandle;
DWORD prcID;
long memLocation;
HANDLE prcHandle;
long i;
char strTemp[255];
void main()
{
printf("-------------------------\n| Blazes StarCraft Hack |\n-------------------------\n");
GetWindowThreadProcessId(FindWindow(NULL, "Brood War"), &prcID);
if (prcID == 0)
{
printf("Error : Could not find BroodWar Process.\nSuggestion: Start BroodWar\n\n");
system("pause");
exit(0);
}
prcHandle = OpenProcess(0x1F0FFF, false, prcID);
printf("Loaded Successfully\n");
while(1)
{
if (GetAsyncKeyState(117) != 0)
{
for(i = 0x1000094; i <= 0xFF00094; i += 0x10000)
{
ReadProcessMemory(prcHandle, (LPVOID)i, &strTemp, 5, NULL);
if (strcmp(strTemp, "start") == 0)
{
memLocation = i;
printf("Found TextBox Address\n");
}
}
}
if (GetAsyncKeyState(118) != 0 && memLocation != 0)
{
ReadProcessMemory(prcHandle, (LPVOID)memLocation, &strTemp, 254, NULL);
//Need Replace Function here!
WriteProcessMemory(prcHandle, (LPVOID)memLocation, &strTemp, strlen(strTemp), NULL);
printf("Wrote color message sucessfully");
}
if (GetAsyncKeyState(122) != 0)
{
break;
}
Sleep(100);
}
printf("\nThank you for using the program. :)\n");
system("pause");
}