Thumbs upBasic DLL

Posts 1–6 of 6 · Page 1 of 1
Basic DLL
Code:
/*

Basic DLL

*/

#include <windows.h>
#include <stdio.h>

// Pointers

#define pointer 0x00000000
#define offset1 0x00000000

// Global variables


bool activated = false;
unsigned long ClientOffset;
//unsigned long ingame = 0x1B8B054;
bool* ingame;
HANDLE setting;

void set()
{
	unsigned long address;
	//unsigned long old_p;

	while (true)
	{
		if (*ingame)
		{
			address = ClientOffset + pointer;

			if (IsBadReadPtr((void*)address, 4) != NULL) continue;
			address = *(unsigned long*)address + offset1;
			
			// Set the address

			if (IsBadWritePtr((void*)address, 4) == NULL)
				*(int*)address = 0;

			//VirtualProtect((void*)address, 4, PAGE_READONLY, &old_p);
		}

		Sleep(1000);// every death it resets, so it is OK
	}
}

void reset()
{
	unsigned long address = ClientOffset + pointer;
	if (IsBadReadPtr((void*)address, 4) != NULL) return;// It is already disabled
	address = *(unsigned long*)address + offset1;
	if (IsBadWritePtr((void*)address, 4) != NULL) return;

	// Here you reset the address

	*(int*)address = 0;// int = 4 bytes
}

void is_activated()
{
	while (true)
	{
		if (GetAsyncKeyState(VK_END) &0x8000)
		{
			if (*ingame)
			{
				if (!activated)
				{
					ResumeThread(setting);

					activated = true;

					Beep(1000, 100);
				}
				else
				{
					SuspendThread(setting);
					reset();
					activated = false;

					Beep(750, 300);
				}
			}
			
			Sleep(900);// If he pressed the key longer than 30ms then this will stop him from toggling it again, hopefully
		}
		else Sleep(30);//Not to overload the CPU. He can't press the key shorter than 15ms. 30ms on average
	}
}

void main()
{
	Beep(1000, 100);

	// Could be injected earlier than expected

	while (!(ClientOffset = (unsigned long)GetModuleHandle(NULL)))
		Sleep(100);
	
	ingame = (bool*)(ClientOffset + 0x1B8B054);

	HANDLE checking;

	try
	{
		if ((checking = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)is_activated, NULL, CREATE_SUSPENDED, NULL)) == NULL)
			throw "Couldn't create a thread to execute within the virtual address space of the calling process.(2)";

		if ((setting = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)set, NULL, CREATE_SUSPENDED, NULL)) == NULL)
			throw "Couldn't create a thread to execute within the virtual address space of the calling process.(3)";
	}
	catch ( LPCSTR error )
	{
		MessageBox(NULL, error, "Error", MB_OK | MB_ICONERROR);
		return;
	}
	
	//if (SetThreadPriority(setting, THREAD_PRIORITY_BELOW_NORMAL) == NULL) // It can take resources so we need to protect the user from lags
	//	MessageBox(NULL, "Couldn't set thread priority.\nBut the program can still continue.", "Error", MB_OK | MB_ICONERROR);

	bool in_progress = false;

	while (true)
	{
		// Checks if he is in game
		
		if (*ingame)
		{
			// Want the hack or not want the hack?
			
			if (!in_progress)
			{
				ResumeThread(checking);
				in_progress = true;
			}
		}
		else if (in_progress)
		{
			SuspendThread(checking);// No need to check out of game
			in_progress = false;//Checking ain't in progress

			if (activated)
				if (SuspendThread(setting) != -1)
					activated = false;
		}
		
		Sleep(2000);//Not to overload the CPU
	}

	//char buf[255];
	//sprintf_s(buf, "%d", address);
	//MessageBox(NULL, buf, "ERROR", MB_OK | MB_ICONERROR);
}

bool WINAPI DllMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved)
{
	DisableThreadLibraryCalls(hDLLInst);

	if (fdwReason == DLL_PROCESS_ATTACH)
	{
		if (CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)main, NULL, 0, NULL) == NULL) // Creating a new thread in the process "AVA"
		{
			MessageBox(NULL, "Couldn't create a thread to execute within the virtual address space of the calling process.", "Error", MB_OK | MB_ICONERROR);
			return false;
		}
	}
	else if (fdwReason == DLL_PROCESS_DETACH)
	{
		// No need for anything here
		
	}
	
	return true;
}

All Credits go to : @jabberw0ock
Quote Originally Posted by Frought View Post
you're the leecher
You're the leecher
There are some parts of my base
Quote Originally Posted by [H]aaBX View Post
You're the leecher
There are some parts of my base
Oh , idk

but if you want to know see the credits and see this thread : http://www.mpgh.net/forum/284-allian...basic-dll.html

The Guys who say i'm leeching then his the leecher , you too
Thanx For Sharing . Good Job

Any Way @[H]aaBX ( Leecher ..
Quote Originally Posted by [2]ExiotX View Post
calling me leecher ? egyptian , you must know who i am and you will kiss meh leggs for a forgiven.
anyway reported for leecher word happy ban :d

edit : i has ur ip and i can ddos you
proofs ur ip = 197.163.72.20
bitch please, no one in egypt has a static ip /fthat
Quote Originally Posted by giniyat101 View Post
bitch please, no one in egypt has a static ip /fthat
it's not static - also there's but static is like not static xD
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?