Ultimate C++ Guide
Page 1 of 1
Ultimate C++ Guide
Hacktimus Prime
How to make MapleStory Hacks
Source code
What do you need to have:
1. Microsoft Visual C++(Download)
2.Cheat Engine(Download)
3. MapleStory(You probably already have it)
What do you need to know:
1. A little bit of c++
2. Global knowledge of MapleStory
3. How to use Microsoft Visual C++ to make windows forms
What I suggest you know:
1. A good amount of c++
2. A good amount of auto assembly
3. How to use cheat engine
What will this teach you:
1. Some c++ hacking basics
2. Some asm basics
3. How to make a MapleStory trainer
Here we go
STEP 1 THE GUI:
1. Open up Microsoft visual studio c++
2. Press on file->new->project
3. Select windows forms application
4. Name your project and press create
5. Now you will have your windows form project
6. Now customize the form to look however you want your trainer to look
STEP 2 THE HACKS AND CHEAT ENGINE:
1. Open up Cheat Engine
2. Open up MapleStory
3. Login to MapleStory
4. Put the hacks you would like to include to your trainer into cheat engine
How to do 4:
41.Select MapleStory as a process
42. Open up memory view
43. press ctrl+a
44. A window with a text field should come up
45. copy and paste your auto assembly code(Im going to be using a Full Godmode script)
Fullgodmode:
- Code:
[Enable]
00961B6C:
db 0F 84
[Disable]
00961B6C:
db 0F 85
47. Under cheat engine you should now have a script on ur cheat table
5. Now test ur hack and make sure it works
How to do 5:
51. Open up MapleStory
52. Login and go on a account/character you dont care about
53. Press the checkbox under "active"
54. Your hack should work if you put in the script correctly
6. If your hack worked then go on to the next part
STEP 3 ADDING ACTIVITY TO THE GUI(you need some c++ knowledge for this part)
1. Load up your Microsoft Visual c++ project that has your gui
2. Open up the form that you are using(if you are using forms)
3. Add a checkbox set the text to "Full Godmode"
4. Go to events(the lightning bolt under properties), goto the "Check changed" field, double click it
5. You should now be looking at some code something like
- Code:
private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
}
};
STEP 4 CONVERTING THE AUTO ASSEMBLY SCRIPTS TO C++(WriteProcessMemory method)
NOTE: this isnt the only way to convert auto assembly scripts to c++
This step isnt going to be written in steps because I have to cover so much code and how to do it. In this I will be teaching how to convert a very easy auto assembly script(full godmode) to c++ using the WriteProcessMemory in bytes method.
Auto Assembly script:
- Code:
[Enable]
00961B6C:
db 0F 84
[Disable]
00961B6C:
db 0F 85
- Code:
0F 84
- Code:
00961B6C
- Code:
db
- Code:
0F 84
- Code:
0F 85
Now to start converting.
The first thing we need to do in c++ is just make a quick function(e.g void()) im going to name mine
"Fullgodmode"
- Code:
void Fullgodmode() {
}
Now to initialize the address in c++ for quick access.
- Code:
DWORD address = 0x00961B6C;
the 0x part:
Your probably wondering why there is a 0x infront of the address, well that is because in c++ everything that has to do with hex values(bytes, address's etc) has to have a 0x infront of it to declare that it is a hex type.
now that we have our address we need to declare the bytes that are being changed. We are going to do this by making a unsigned char that holds the bytes for when the hack is enabled and disabled. This is what it looks like.
- Code:
unsigned char fgmOn[8] = "\x0F\x94";
unsigned char fgmOff[8] = "\x0F\x95";
Your Fullgodmode() function should look like this now
- Code:
void Fullgodmode() {
DWORD address = 0x00961B6C;
unsigned char fgmOn[8] = "\x0F\x94";
unsigned char fgmOff[8] = "\x0F\x95";
}
Im going to be covering the easiest way to get the MapleStory process(Through the window)
First of all we have to get the MapleStory window handle,
- Code:
HWND mapleWindow = FindWindow(0, "MapleStory");
- Code:
if (mapleWindow == 0) {
MessageBox(0, "Cannot find MapleStory open", "MapleStory Hack", 0);
ExitProcess(0);
}
Now this is a confusing part, we need to get the process id of the MapleStory window and then get the process handle from the process id. We do this by first making a DWORD called pID(process id) and then calling the function GetWindowThreadProcessId(HWND hWnd, DWORD processID) then once we do that we make a handle named hProc(handle process) this is what we need. We will get the process by calling OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
All together it looks like this
- Code:
DWORD pID;
GetWindowThreadProcessId(mapleWindow, &pID);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
- Code:
void Fullgodmode() {
DWORD address = 0x00961B6C;
unsigned char fgmOn[8] = "\x0F\x94";
unsigned char fgmOff[8] = "\x0F\x95";
HWND mapleWindow = FindWindow(0, "MapleStory");
if (mapleWindow == 0) {
MessageBox(0, "Cannot find MapleStory open", "MapleStory Hack", 0);
ExitProcess(0);
} else {
DWORD pID;
GetWindowThreadProcessId(mapleWindow, &pID);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
}
}
I am going to explain WriteProcessMemory() very thouroghly(I fail I know I spelt that wrong) because it can be used for alot more then you think. When I first learned about it I thought you could just write a new integer or text to an address. Turns out you can do so much more.
About writeprocessmemory:
- Code:
WriteProcessMemory(HANDLE proc, LPVOID address, LPVOID value, SIZE_T size, SIZE_T *numberofbyteswritten);
Next were going to cover the LPVOID address part. For this part we put in our DWORD address or if you want you can just put in 0x00961B6C instead if you want. If you put in the DWORD address we made earlier you have to cast it as an LPVOID because it is a DWORD right now so it should look like this
- Code:
WriteProcessMemory(hProc, (LPVOID)address, LPVOID value, SIZE_T size, SIZE_T *numberofbyteswritten);
- Code:
WriteProcessMemory(hProc, (LPVOID)address, (LPVOID)9999999, SIZE_T size, SIZE_T *numberofbyteswritten);
- Code:
WriteProcessMemory(hProc, (LPVOID)address, fgmOn, SIZE_T size, SIZE_T *numberofbyteswritten);
now writeprocessmemory should look like this
- Code:
WriteProcessMemory(hProc, (LPVOID)address, fgmOn, 2, NULL);
Now we are done converting that simple auto assembly script to c++ your Fullgodmode function should now look like this.
- Code:
void Fullgodmode() {
DWORD address = 0x00961B6C;
unsigned char fgmOn[8] = "\x0F\x94";
unsigned char fgmOff[8] = "\x0F\x95";
HWND mapleWindow = FindWindow(0, "MapleStory");
if (mapleWindow == 0) {
MessageBox(0, "Cannot find MapleStory open", "MapleStory Hack", 0);
ExitProcess(0);
} else {
DWORD pID;
GetWindowThreadProcessId(mapleWindow, &pID);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
WriteProcessMemory(hProc, (LPVOID)address, fgmOn, 2, NULL);
}
}
STEP 5 EXTRA TRAINER STUFF
This step is just going to be all about packing up your trainer and linking everything together.
First thing were going to do is fix the Fullgodmode function so that it also turns full godmode off. We can do this by adding a bool to it like so
- Code:
void Fullgodmode(bool on) {}
This is what it will look like.
- Code:
void Fullgodmode(bool on) {
DWORD address = 0x00961B6C;
unsigned char fgmOn[8] = "\x0F\x94";
unsigned char fgmOff[8] = "\x0F\x95";
HWND mapleWindow = FindWindow(0, "MapleStory");
if (mapleWindow == 0) {
MessageBox(0, "Cannot find MapleStory open", "MapleStory Hack", 0);
ExitProcess(0);
} else {
DWORD pID;
GetWindowThreadProcessId(mapleWindow, &pID);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
if (on) {
WriteProcessMemory(hProc, (LPVOID)address, fgmOn, 2, NULL);
} else {
WriteProcessMemory(hProc, (LPVOID)address, fgmOff, 2, NULL);
}
}
}
Next part is adding the functionality so that when the checkbox is checked it runs the Fullgodmode function. In our checkbox changed event(private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e)) we need to run the fullgodmode function but we also need to check if the checkbox is checked or not. We can check this by accessing the checkbox class and checking if its checked.
- Code:
this->checkBox1->Checked = false;
- Code:
Fullgodmode(this->checkBox1->Checked);
- Code:
private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
Fullgodmode(this->checkBox1->Checked);
}
};
Congratulations you have made a trainer.
Computer broke, got bored, decided to spend around an hour writing a tutorial on my iphone while my computer was getting fixed hope it helps some ppls
HACKTIMUS PRIME
*NEW* C++ Hacking Functions!
This part of the guide is for mostly the people that already know c++ and want to know some of the usefull hacking functions and how to use them.
WriteProcessMemory:
Write process memory can write information to a selected address: WriteProcessMemory
How to get Process ID/Process handle:
- Code:
HWND hWnd = FindWindow(0, "MapleStory");//get the window for maplestory
DWORD pID;//dword that holds the process id
GetWindowThreadProcessId(hWnd, &pID);//gets the process id which is used for getting the process handle
HANDLE procHandle = OpenProcess(PROCESS_ALL_ACCESS, pID);//gets you a process handle for maplestory using the process id we got
- Code:
bool ExitMapleStory() {
HWND hWnd = FindWindow(0, "MapleStory");//get maplestory window
if (hWnd == 0) {
return false;//return false if maplestory is not found
} else {
DWORD pID;//process id
GetWindowThreadProcessId(hWnd, &pID);//getting the process id
HANDLE pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);//opening the process
PostThreadMessage(pID, WM_CLOSE, 0, 0);//posting a message to close maplestory
WaitForSingleObject(pHandle, 2000);//wait for 2 seconds waiting for maplestory to close
DWORD exit = 0;//exit code
GetExitCodeProcess(pHandle, &exit);//get the exit code
if (exit == STILL_ACTIVE) {
TerminateProcess(pHandle, 0);//if maplestory doesnt exit destroy the process
}
CloseHandle(pHandle);//close the process handle
return true;
}
}
More c++ quick functions coming soon -Hacktimus Prime
NEW Making a hack in a Dll!!!!!
This part is going to be on making a dll that exports hack functions to be called from your trainer. The reason for this is so that we may inject the dll into maplestory so we dont need to use WriteProcessMemory we can just put it into the memory using memcpy. So what I want you to do is open up Microsoft Visual c++ and create an empty project.
Now make a new source file and call it main.cpp. This will be our cpp that holds all of our exported functions. Now I want you to follow these steps.
1. Right click your project
2. Press on properties
3. Go to General
4. Change Common Language Runtime Support to "No Common Language Runtime Support"
5. Next set the Character Set to "Use Multi-Byte Character Set"
6. Now change Configuration Type to "Dynamic Library(.dll)"
Now you have a simple dll program, but if you compile it you will get errors because you do not have an entry point. Copy and paste the code below into your main.cpp file.
- Code:
#include <windows.h> //include the files you need
#include <string.h>
#include <iostream>
#include <fstream>
using namespace std; //using the proper namespace
BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved) { //the dll main entry point just like int main()
switch ( dwReason ) { //the switch to check for the dll calls
case DLL_PROCESS_ATTACH: //if the dll is attached
DisableThreadLibraryCalls(hModule); //it calls this method to disable library calls
break;
case DLL_PROCESS_DETACH: //when the program exits and the dll is detached
ExitProcess(0); //it exits the process to make a smoother exit
break;
case DLL_THREAD_ATTACH://these are never really called
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE; //return true because it is a bool
}
Now we want to add in a script, for this im going to use my own not working teleport script :/ this script doesnt work but il just use it as an example:
- Code:
extern "C" __declspec(dllexport) void Teleport() {//first we declare it as an external C script so that we may call it easily, next we declare that //it will be exported
MessageBox(0, "Teleport is on", "Teleport", 0);//call a message box to let us know that teleport is on
__asm {//start our inline asm
mov [esi+0x3B94],0x00
mov eax,[0x00CBE0A8]
cmp dword ptr [eax+0x9C8],0x0c
jne teleNormal
teleNormal:
cmp dword ptr [esi+0x00003B94],0x01
jmp dword ptr [teleHack2]
}
}
- Code:
mov eax,[00493823]
- Code:
mov eax,[0x00493823]
- Code:
mov [esi+3B94],00
- Code:
mov [esi+0x3B94],0x00
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum