XTrap Error

Posts 1–8 of 8 · Page 1 of 1
XTrap Error
Hi Community,
I need Help.

Every Time, when I inject my CF Hack I become this Error: "Some functions of the operating system has been corrupted. Please, close any program which is affecting game client and restart the system".

Can someone say what I made false?


user44
You need to code the same way as crossfire does.
If you do that, crossfire doesn't ban your hack becouse crossfire can't detect it.

There is a special way to do:
  1. loops
  2. look if cshell is loaded
  3. hotkey's


I found them already and it works perfect. My source works now already for +- 1 month
So I also do that

For DLLMain I use this Code:

Code:
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
    DisableThreadLibraryCalls(hDll);
    
    if ( dwReason == DLL_PROCESS_ATTACH ) {
		CreateThread(0,0,(LPTHREAD_START_ROUTINE)StartHack,0,0,0);
    }

    return true;
}
And for StartHack I used this:
Code:
DWORD WINAPI loadddd(LPVOID) {
	while(GetModuleHandleA("CShell.dll") == NULL) { 
		Sleep(150); 
	}

	Sleep(100); 
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3D_Hook, NULL, NULL, NULL);
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)HACKthread, NULL, NULL, NULL);
    return 0;
}
But it dont work
That doesn't work indeed

Crossfire will detect the Cshell cheak,

It is also usefull tho remove every protection from an addie with VirtualProtect if you want to write somting to it.

You can make a function to do that for you like this:

Code:
#include <Windows.h>

/*
Usefull functions

BOOL WINAPI VirtualProtect(
  __in   LPVOID lpAddress,
  __in   SIZE_T dwSize,
  __in   DWORD flNewProtect,
  __out  PDWORD lpflOldProtect
);
*/

void WriteMem(int address, BYTE datatowrite[], int sizetowrite) {
	DWORD oldprotection; //The protection will be stored in here 

    VirtualProtect((LPVOID)address, sizetowrite, PAGE_EXECUTE_READWRITE, &oldprotection); //will remove the protection
    memcpy((LPVOID)address, (const void*)datatowrite, sizetowrite); //place the data to the address
    VirtualProtect((LPVOID)address, sizetowrite, oldprotection, &oldprotection); //will restore the protection

	return;
}

void WriteNOPs(int address, int nops) {
    DWORD nop = 0x90;
    DWORD oldprotection;

    VirtualProtect((LPVOID)address, nops, PAGE_EXECUTE_READWRITE, &oldprotection);

    for(int x = 0; x < nops; ++x) {
        memcpy((void*)(address+x), &nop, 1);
	}

    VirtualProtect((LPVOID)address, nops, oldprotection, &oldprotection);

	return;
}
Or you can use VirtualProtect in your code when you need it. It is also posable but a function is the best way.

Your problem, look if a class or somting else exists in cshell:

I cheak it this way:

Code:
DWORD Cshell = (DWORD)GetModuleHandleA("Cshell.dll"); //Cshell
DWORD weaponc = *(DWORD*)(Cshell+0xA2A7E8); //ECX

if ( weaponc ) {
//memory editing here
}
You need to run this in a loop, else there will be no hacks that will be applied. Use also a sleep above the loop, else cshell will be cheakt to soon.
First I want to thank your for your help!

But anyting I´m still making wrong..

Code:
#include<windows.h>


//#define WeaponMgr       0xA2A7E8
#define NoReload        0x2424

void WriteMem(int address, BYTE datatowrite[], int sizetowrite) {
	DWORD oldprotection; //The protection will be stored in here 

    VirtualProtect((LPVOID)address, sizetowrite, PAGE_EXECUTE_READWRITE, &oldprotection); //will remove the protection
    memcpy((LPVOID)address, (const void*)datatowrite, sizetowrite); //place the data to the address
    VirtualProtect((LPVOID)address, sizetowrite, oldprotection, &oldprotection); //will restore the protection

	return;
}

void WriteNOPs(int address, int nops) {
    DWORD nop = 0x90;
    DWORD oldprotection;

    VirtualProtect((LPVOID)address, nops, PAGE_EXECUTE_READWRITE, &oldprotection);

    for(int x = 0; x < nops; ++x) {
        memcpy((void*)(address+x), &nop, 1);
	}

    VirtualProtect((LPVOID)address, nops, oldprotection, &oldprotection);

	return;
}




DWORD WINAPI Hacks(LPVOID)
{
    bool reload = false;

    while(1)
	{
		DWORD Cshell = (DWORD)GetModuleHandleA("Cshell.dll"); //Cshell
		DWORD weaponc = *(DWORD*)(Cshell+0xA2A7E8); //ECX

		if(GetAsyncKeyState(VK_F5)&1) { reload = true; Beep(512, 100); 
	}

	//no reload
	if(reload)
	{
	    if ( weaponc ) {
	        for(int i=0; i<445; i++)
		{
		    if((*(DWORD*)((*(DWORD*)(Cshell+weaponc))+(4*i))) != NULL)
		        *(float*)((*(DWORD*)((*(DWORD*)(Cshell+weaponc))+(4*i))) + NoReload) = 100;
		}
	    }
	}
	}

	Sleep(100);
    }


DWORD WINAPI Wait(LPVOID)
{
	CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Hacks, NULL, NULL, NULL);
    return 0;
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
    DisableThreadLibraryCalls(hDll);
    
    if ( dwReason == DLL_PROCESS_ATTACH )
    {
        MessageBoxA(0, "Just NoReload with F5 ",". . . ", 0);
	

	CreateThread(0,0,(LPTHREAD_START_ROUTINE)Wait,0,0,0);
    }
    return 1;
}
user44
DWORD WINAPI Wait(LPVOID) is useless, you can use Wait to do the hacks later, like this:

Code:
DWORD WINAPI Wait(LPVOID)
{
    Sleep(9000);
    CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Hacks, NULL, NULL, NULL);
    return 0;
}
And Weaponc = Cshell+weaponc, so you need to rewrite this:

Code:
if((*(DWORD*)((*(DWORD*)(Cshell+weaponc))+(4*i))) != NULL)
*(float*)((*(DWORD*)((*(DWORD*)(Cshell+weaponc))+(4*i))) + NoReload) = 100;
Weaponc + 4*i = the weapon, you can make a pointer to the DWORD*
the weapon + 0x2424 = reload time,you can make a pointer to the DWORD*

I think that crossfire will detect this:

Code:
while(1)
Write a loop at a different way. A way were you can break out

And why you don't make a thread for the hacks, and a thread for the hotkey's? Then you can do the hotkey cheak realtime and then you don't need to wait for the hacks.

And why you make the hotkey part that way? Now you only can enable.

I see that you don't use the function that I posted, but it is useless here, If you want to change the weapon names you need to use it. But if I were you I let them in your project. They can be usefull some time
@nonameav Can I chat with you in Skype, MSN, ICQ or Yahoo? I am a bit confused and will be happy when you can write your address via PM...
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us