Hi, im trying to make a MapleStory Trainer.
I have my injector which injects the code by doing this:
Code:
void Inject(string dll, string function, int index) {
char wndName[255];
sprintf(wndName, "MapleStory %i", index);
HWND hackWnd = FindWindow(0, wndName);
if (hackWnd == 0) {
MessageBox(0, "Cannot find MapleStory", "Failzor", 0);
}
DWORD pid;
GetWindowThreadProcessId(hackWnd, &pid);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
if (hProcess == 0) {
MessageBox(0, "Cannot find MapleStory Process", "Failzor", 0);
}
HMODULE dllModule = LoadLibrary(dll.c_str());
FARPROC functionStart = GetProcAddress(dllModule, function.c_str());
CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)functionStart, NULL, 0, NULL);
}
and this is the function that is called from the dll:
Code:
extern "C" __declspec(dllexport) void FullGodmodeOn() {
DWORD addy = 0x00961B6C;
BYTE Enable[] = {0x0F, 0x84, 0x59, 0x21, 0x00, 0x00};
memcpy((void*)addy, Enable, sizeof(Enable));
}
When I run the Inject function Maplestory starts lagging and then stops working after about a second.
Is there something wrong with my injection method, my dll or is it just maplestory?