Simple menu

PollWas that useful?
28 votes
Posts 1–15 of 65 · Page 1 of 5
Simple menu
Today, i will release another tutorial
it is about making a menu
i will use windows menu for that, if u need d3d menu then code your own hook please.

lets get started



Step 1: creating the gui

Important note: you may not find some options in your C++ Express then you will have to upgrade to Visual studio
but if you are good enough you can edit resources.h and resources.rc from the attachments instead of creating them
for more info read the attached files


Right click your project and pick Add -> Resource



then, highlight dialog and press new



you can also try Add -> Existing item and select the attached files if you don't find Resource option (read the red line above)

remove ok and cancel buttons and customize your dialog
for example i made this changes:
Code:
Caption:giniyat101
Minimize Box:True
then add some check boxes and a button

and change the properties like what you want (you dont need to do exact what i did)

checkbox1:
Code:
ID:IDC_NORELOAD
Caption: No reload
checkbox2:
Code:
ID:IDC_NOCHANGE
Caption: No change
button1:
Code:
ID:IDC_BTNDO
Caption:Apply
my result:



Step2: Modify your code
first , add these after #include <windows.h>
Code:
#include "resource.h"
#define IsChecked(ID) (IsDlgButtonChecked(hDlg, ID) == BST_CHECKED)
HWND hDlg = NULL;
bool noReload = false;
bool noChange = false;
then, add these functions to your project
Code:
INT_PTR WINAPI DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg) 
	{
		case WM_INITDIALOG:
		{

		}
		break;

		case WM_COMMAND:
		{
			int button = LOWORD(wParam);
			if (button == IDC_BTNDO)
			{
				noReload = IsChecked(IDC_NORELOAD);
				noChange = IsChecked(IDC_NOCHANGE);
			}
		}
		break;

		default:
		{
			return FALSE;
		}
	}
			
	return TRUE;

}

void guiThread(HMODULE hDll)
{
	hDlg = CreateDialog(hDll, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
	ShowWindow(hDlg, SW_SHOW);
	MSG Msg = {0};
	while(GetMessage(&Msg, NULL, 0, 0) > 0)
	{
		if(!IsDialogMessage(hDlg, &Msg))
		{
			TranslateMessage(&Msg);
			DispatchMessage(&Msg);
		}
	}
}
ofc noReload and noChange are the variables, IDC_BTNDO is the button , and IDC_NORELOAD & IDC_NOCHANGE are the check boxes

don't forget to create the thread in DllMain!

Code:
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)guiThread , hDll, NULL, NULL);
and we are done


example project:
Code:
#include <windows.h>
#include "resource.h"
#include "exports.h"
#include <d3d9.h>
#include <d3dx9.h>

#pragma comment(lib, "d3dx9.lib")

#define IsChecked(ID) (IsDlgButtonChecked(hDlg, ID) == BST_CHECKED)
HWND hDlg = NULL;

bool noReload = false;
bool noChange = false;

class cWeaponList{
public:
	char spacer00[2];
	unsigned short WeaponClass;
	unsigned int WeaponIndex;
	char WeaponName[12];
	char spacer02[1288];
	float SpreadMin[9];
	char spacer03[324];
	float SpreadMax[9];
	char spacer04[324];
	float WeaponRange;
	unsigned short MaxAmmo;
	unsigned short AmmoPerMagazine;
	unsigned short NanoMaxAmmo;
	unsigned short NanoAmmoPerMagazine;
	float AmmoDamage;
	float UnlimitedAmmo;
	int TargetSlot;
	int SubType;
	float DamageFactorByDistance;
	float DamageVariationFactor;
	float ShotsPerMinute;
	char spacer05[24];
	unsigned char ShotsPerAmmo;
	char spacer06;
	unsigned short WeaponPrice;
	unsigned short AmmoPrice;
	bool ReloadSingleAmmo;
	char spacer07[3];
	float BoomDuration;
	char spacer08[478];
	float KnifeNormalRange[4];
	float KnifeYawPitch[2];
	float KnifeNormalAnimationRate[3];
	float KnifeBigshotRange[4];
	float KnifeBigshotYawPitch[2];
	float KnifeBigshotAnimationRate[3];
	char spacer9[64];
	unsigned char FireMode;
	char spacer10[3];
	unsigned char ZoomMode;
	char spacer11[3];
	unsigned char ZoomAttributes;
	char spacer12[3];
	unsigned char ReloadAttributes;
	char spacer13[3];
	unsigned char KnifeAttributes;
	char spacer14[3];
	bool IsDroppedWhenDie;
	char spacer15[11];
	float StunTime;
	int SubWeaponIndex;
	float DamageRatioPerNode;
	char spacer16[236];
	float KnifeNormalAmmoDamage[3];
	float KnifeBigShotAmmoDamage[3];
	char spacer17[28];
	float SmokeAlpha;
	char spacer18[3384];
	D3DXVECTOR3 BulletPosOffset;
	char spacer19[2848];
	float SpeedPenalty[3];
	char spacer20[4];
	float FireAnimationMultiplier[3];
	char spacer21[164];
	int DelayOneShootTime[3];
	char spacer22[276];
	float ThrowVelAngleGravityAirResTime[3];
	char spacer23[4];
	unsigned char BoomType;
	unsigned char BoomDurationDamage;
	char spacer24[2];
	float BoomDamageCheckInterval;
	float SideEffectDamage;
	float SideEffectTimeGap;
	float DamagePenaltyTimeAndMoveRate[2];
	float NanoDamagePenaltyTimeAndMoveRate[2];
	float WallShotDamageRatio;
	char spacer25[48];
	float ReloadAnimRatio;
	float ChangeWeaponAnimRatio;
	char spacer26[188];
	bool HaveKnife;
	char spacer27[39];
	float KnockBack;
};

INT_PTR WINAPI DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg) 
	{
		case WM_INITDIALOG:
		{

		}
		break;

		case WM_COMMAND:
		{
			int button = LOWORD(wParam);
			if (button == IDC_BTNDO)
			{
				noReload = IsChecked(IDC_NORELOAD);
				noChange = IsChecked(IDC_NOCHANGE);
			}
		}
		break;

		default:
		{
			return FALSE;
		}
	}
			
	return TRUE;

}

void hackThread()
{
	DWORD CShell = NULL;
	do
	{
		CShell = (DWORD)GetModuleHandleA("CShell.dll");
	} while (!CShell);

	while (1)
	{
		DWORD pWeaponMgr = *(DWORD*)(CShell+0xA974A0);
		if (pWeaponMgr)
		{
			for (int i=0; i<600; i++)
			{
				cWeaponList* pWeapon = *(cWeaponList**)(pWeaponMgr+i*4);
				if (pWeapon)
				{
					pWeapon->ReloadAnimRatio = 1.0f + 99.0f * noReload;
					pWeapon->ChangeWeaponAnimRatio = 1.0f + 99.0f * noChange;
				}
			}
		}
		Sleep(100);
	}
}

void guiThread(HMODULE hDll)
{
	hDlg = CreateDialog(hDll, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
	ShowWindow(hDlg, SW_SHOW);
	MSG Msg = {0};
	while(GetMessage(&Msg, NULL, 0, 0) > 0)
	{
		if(!IsDialogMessage(hDlg, &Msg))
		{
			TranslateMessage(&Msg);
			DispatchMessage(&Msg);
		}
	}
}

BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
	if (dwReason == DLL_PROCESS_ATTACH)
	{
		DisableThreadLibraryCalls(hDll);
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)hackThread, NULL, NULL, NULL);
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)guiThread , hDll, NULL, NULL);
		
	}

	return TRUE;
}
credits @~FALLEN~ for the class

you can find exports.h here:
http://www.mpgh.net/forum/242-crossf...nddrv-dll.html

http://virusscan.jotti.org/nl/scanre...13442dccbe2c09
http://www.viruschief.com/report.htm...49853cc153ba77

hope you liked this tut please press thanks, and add me in the credits

If you are having problems with some include files get platform sdk from here:
http://www.microsoft.com/download/en...s.aspx?id=6510

and place the include and lib files from platform sdk folder to c++ folder

you can also download visual studio from here:
http://www.microsoft.com/visualstudi...imate/overview
resources.rar1 KB · 232 downloads Scanning…
Good Job
~Approved
good job nice ^^
Nice Tut Thanks !!
Very usefull!
Nice job
anyone tested it?
Amazing Tutorial , thank you Ahmed
@giniyat101 this is VB Menu? i dont understand...i didnt rly read it well
i will put you in credits bec of Wep class
Quote Originally Posted by Assassin's Creed View Post
@giniyat101 this is VB Menu? i dont understand...i didnt rly read it well
i will put you in credits bec of Wep class
it is c++ and learn 2 read the class is @~FALLEN~'s
Quote Originally Posted by giniyat101 View Post
it is c++ and learn 2 read the class is @~FALLEN~'s
I meant how to use the wep class...i mean BPI is easy ...i didnt rly try to make a wep class...but u made it easier for me
umm...i just took a fast look...and once i saw the "loader" form my eyes puzzled xD
thxs dude ur the best
ofc i will add u in credits
but you can put the source code of this program?
Quote Originally Posted by eppi View Post
but you can put the source code of this program?
isnt this a source?
Posts 1–15 of 65 · Page 1 of 5

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us