[Tut]How to make a dll trainer
Posted: Thu May 27, 2010 5:24 pm
DO NOT LEECH THIS TO GZN or else it will be deleted.
Well since a lot of you guys asking me on how to make a trainer, I'll just post a tutorial on how to make a simple trainer like I've released. This was a total spoon feed so it will be copy and paste and edit. First, there are few things you need:
1. Microsoft Visual Studio 2010
2. A lil knowledge about Assembly.
Ok, let's start this. Run your Microsoft Visual Studio 2010. Click New Project->Win32 and Enter your Project name. Lets say Trainer. Click Ok and next, choose DLL and Empty project. Now you are in Trainer.cpp blank page. Ok, now go Solution Explorer(You could find it easily a View tab) and you'll see 4 things there:
1. External Dependencies
2. Header Files
3. Resource Files
4. Source Files

Now you need to add in a few files inside these folders to make it work. To add a file, simply right click->Add and choose your extension. For Header Files, choose .h extension. For Source Files, choose .cpp extension. I'm lazy so I posted a screenshot for you all to look at, add all the files inside the screenshot.

Ok, if you follow my simple tutorial, these would be your files to make your first dll trainer. We'll use the most simple example for this tutorial.Super tubi.
Now, Open up your Trainer.h and paste the codes below into it.
This is where you declare the header of your hacks.
After you have done, now we move to the part where everyone loves, GUI. Go back to the Solution Explorer->Right Click at the Resource Files. Add a Resource(not item) and choose Dialog(DO NOT CLICK THE +, click Dialog and click new and you'll bring to a Dialog Box which is like below:

Add in a checkbox at the Dialog Editor(You can found it easily at View->Toolbars) like mine below.

You could resize your Dialog Box and the size you edited will be show up while you inject into the game.
Open up, dllmain.h and paste this inside.
And finally your gui.h
Now go to your Source Files, and open up your dllmain.cpp and paste this
This is the place to call your dll thread to run on.
And your gui.cpp
This is the place you can declare your control on your hacks. For example, if you want to add in more hacks in your trainer, simply add a checkbox and add a check for it.
Well since a lot of you guys asking me on how to make a trainer, I'll just post a tutorial on how to make a simple trainer like I've released. This was a total spoon feed so it will be copy and paste and edit. First, there are few things you need:
1. Microsoft Visual Studio 2010
2. A lil knowledge about Assembly.
Ok, let's start this. Run your Microsoft Visual Studio 2010. Click New Project->Win32 and Enter your Project name. Lets say Trainer. Click Ok and next, choose DLL and Empty project. Now you are in Trainer.cpp blank page. Ok, now go Solution Explorer(You could find it easily a View tab) and you'll see 4 things there:
1. External Dependencies
2. Header Files
3. Resource Files
4. Source Files

Now you need to add in a few files inside these folders to make it work. To add a file, simply right click->Add and choose your extension. For Header Files, choose .h extension. For Source Files, choose .cpp extension. I'm lazy so I posted a screenshot for you all to look at, add all the files inside the screenshot.

Ok, if you follow my simple tutorial, these would be your files to make your first dll trainer. We'll use the most simple example for this tutorial.Super tubi.
Code: Select all
//Tubi(Updated by nerrazzuri msea v93)
[enable]
00488AA6: //75 ? 83 7C 24 ? ? 75 ? 8B ? ? ? ? ? FF 70 ? 83 C0 ? 50
DB 90 90
[disable]
00488AA6: //75 ? 83 7C 24 ? ? 75 ? 8B ? ? ? ? ? FF 70 ? 83 C0 ? 50
jne 00488ADE //byte 75 36
Code: Select all
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include <Windows.h>
#include <tchar.h>
//ADD HACKS BELOW *THIS IS KINDA LIKE A LIST OF THE HACKS YOU ARE ADDING*
void SuperTubi(__in BOOL bEnable);//To add in more hacks, simply copy this line and paste it at the bottom, and change the name SuperTubi to others for example NoKnockBack.
After you have done, now we move to the part where everyone loves, GUI. Go back to the Solution Explorer->Right Click at the Resource Files. Add a Resource(not item) and choose Dialog(DO NOT CLICK THE +, click Dialog and click new and you'll bring to a Dialog Box which is like below:

Add in a checkbox at the Dialog Editor(You can found it easily at View->Toolbars) like mine below.

You could resize your Dialog Box and the size you edited will be show up while you inject into the game.
Open up, dllmain.h and paste this inside.
Code: Select all
#include <Windows.h>
#include <tchar.h>
extern HINSTANCE g_h_main_instance;
Code: Select all
#include <Windows.h>
#include <stdlib.h>
#include <CommCtrl.h>
#include "resource.h"
DWORD WINAPI CreateGUIThread(__in LPVOID lParam);
INT_PTR CALLBACK DialogProc(__in HWND hwndDlg,__in UINT uMsg,__in WPARAM wParam,__in LPARAM lParam);
Code: Select all
#include "dllmain.h"
#include "gui.h"
HINSTANCE g_h_main_instance;
BOOL WINAPI DllMain(__in HINSTANCE hinstDLL, __in DWORD fdwReason, __in LPVOID lpvReserved)
{
switch(fdwReason)
{
case DLL_PROCESS_ATTACH:
g_h_main_instance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
CreateThread(0, 0, CreateGUIThread, 0, 0, 0);
break;
}
return TRUE;
}
And your gui.cpp
Code: Select all
#include "gui.h"
#include "dllmain.h"
#include "Trainer.h"
DWORD WINAPI CreateGUIThread(__in LPVOID lParam)
{
DialogBox(g_h_main_instance, MAKEINTRESOURCE(IDD_DIALOG1), 0, DialogProc);
return 0;
}
INT_PTR CALLBACK DialogProc(__in HWND hwndDlg,__in UINT uMsg,__in WPARAM wParam,__in LPARAM lParam)
{
int checked;
switch(uMsg)
{
case WM_INITDIALOG: //To initiate the dialog box
return TRUE;
case WM_COMMAND: //This is where you run your control. The control will let you connect your hacks with the checkboxes.
switch(LOWORD(wParam))
{
case IDC_CHECK1:
checked = IsDlgButtonChecked(hwndDlg, IDC_CHECK1);//check if the check box is checked.
SuperTubi(checked);//if checkbox checked, read SuperTubi in the Trainer.h and if valid, search the code named under the header SuperTubi in Trainer.cpp
break;
}
break;
case WM_CLOSE:// end your dialog if you click the X button.
EndDialog(hwndDlg, 0);
break;
}
return 0;
}