Results 1 to 7 of 7
  1. #1
    PsychicSounds's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    35
    Reputation
    8
    Thanks
    0
    My Mood
    Doh

    Exclamation Injecting DLL Error?

    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?
    My Youtube
    Check it out for Dubstep, commentarys, hacks, hack tutorials and other stuffs


    List of achievments
    = finished
    = not done

    make a solitaire trainer(shutup) =
    diablo 2 trainer =

  2. #2
    open|Fire's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    fs:[0]
    Posts
    62
    Reputation
    18
    Thanks
    36
    Why not just use WriteProcessMemory?

    and you are not injecting a dll.
    Last edited by open|Fire; 06-04-2011 at 07:44 PM.

  3. #3
    PsychicSounds's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    35
    Reputation
    8
    Thanks
    0
    My Mood
    Doh
    You can use write process memory to write an array of bytes?
    My Youtube
    Check it out for Dubstep, commentarys, hacks, hack tutorials and other stuffs


    List of achievments
    = finished
    = not done

    make a solitaire trainer(shutup) =
    diablo 2 trainer =

  4. #4
    open|Fire's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    fs:[0]
    Posts
    62
    Reputation
    18
    Thanks
    36
    of course you can
    Code:
    WriteProcessMemory(hProcess, (void*)0x00961B6C, &Enable, 6, NULL);
    or
    WriteProcessMemory(hProcess, (void*)0x00961B6C, "\x0F\x84\x59\x21\x00\x00", 6, NULL);

  5. #5
    PsychicSounds's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    35
    Reputation
    8
    Thanks
    0
    My Mood
    Doh
    Well that works DD thanks you but I have one problem and idk what it is.
    When I use cheat engine to write the aob I use
    Code:
    db 0F 84
    So in c++ Im guessing I write the bytes
    Code:
    BYTE bytes[] = {0x0F, 0x84}
    but that does not change it correctly?
    My Youtube
    Check it out for Dubstep, commentarys, hacks, hack tutorials and other stuffs


    List of achievments
    = finished
    = not done

    make a solitaire trainer(shutup) =
    diablo 2 trainer =

  6. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    with the posted code you load the dll in your injectors' process and then create a thread to 0x00000000 in the target process.
    as for the byte string: unsigned char* bytestr = "\x0F\x84";
    Ah we-a blaze the fyah, make it bun dem!

  7. #7
    PsychicSounds's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    35
    Reputation
    8
    Thanks
    0
    My Mood
    Doh
    it works kindof :/ well the kindof is a problem in my code that I know how to fix. Also the reason maplestory was crashing is because 0x00961B6C isnt an address I forgot to takeout the 2 zeros when I came over from cheat engine the real address is 0x961B6C and thank you the new way of writing bytes works
    My Youtube
    Check it out for Dubstep, commentarys, hacks, hack tutorials and other stuffs


    List of achievments
    = finished
    = not done

    make a solitaire trainer(shutup) =
    diablo 2 trainer =