Not working

Posts 1–4 of 4 · Page 1 of 1
Not working
hey guys, there's a problem when i'm trying to inject hack

here's the source code:

Code:
#include <windows.h>

DWORD WINAPI MainThread(LPVOID param)
{
	while (1)       
	{
		DWORD CShell     = (DWORD)GetModuleHandleA("CShell.dll");
        DWORD noreload = 1;
		DWORD nochange = 1;
		DWORD wallhack = 1;
		DWORD pWeaponMgr = *(DWORD*)(CShell+0xAB2940);

        if (pWeaponMgr)         
		{
			for (int i=0; i<650; i++)
			{
				DWORD pWeapon = *(DWORD*)(pWeaponMgr+i*4);
				if (pWeapon)
				{
					if (noreload)
						*(FLOAT*)(pWeapon+0x26C4) = 100.0f;
					else
						*(FLOAT*)(pWeapon+0x26C4) = 1.0f;

					if (nochange)
						*(FLOAT*)(pWeapon+0x26C8) = 100.0f;
					else
						*(FLOAT*)(pWeapon+0x26C8) = 1.0f;
				}
			}
		}
		if (wallhack)
			memcpy((VOID*)0x6CE76C, "\x00\x00\x00\x00\x00\x00", 6);
		else
			memcpy((VOID*)0x6CE76C, "\x01\x01\x01\x01\x01\x01", 6);

		Sleep(100);
	}
} 

BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
	if (dwReason == DLL_PROCESS_ATTACH)
	{
		DisableThreadLibraryCalls(hDll);
		CreateThread(NULL, NULL, MainThread, NULL, NULL, NULL);
		MessageBox(0, "Inject Successfull.","Injected", MB_OK | MB_ICONINFORMATION);
	}
	return true;
}
every time I try to inject, crossfire crashes...
is there anything wrong with this source code?

sorry for my bad english
Check Offsets and try to make some functions not auto on
Injected ingame or by starting cf?
outdated offsets and code leeched = will never work lol
Check your offsets, and instead of using hex like this: 0xAB2940 define WeaponMgr so when your updating, it'll be easier. And while(1) is detected a while now so use while(true). And it doesn't really matter but it should be this:

Code:
bool noreload = true;
	   bool nochange = true;
	   bool wallhack = true;


And when i first started coding, i had the same error, but it was because something was wrong with my dllmain.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us