c++ .dll hShell deklarieren

01/16/2011 11:54 maxi39#1
Hey,

ich hab grad mal einfach ein paar code schnippsel zusammen gewürfelt.
Einmal auser crossfire section:

Code:
DWORD pWeaponsPtr = *(DWORD*)(hShell + 0x90A4B8);
        if (pWeaponsPtr)
        {
            for (int i = 0; i < 512; i++)
            {
                DWORD pWeapon = *(DWORD*)(pWeaponsPtr + i * 4);
                if (pWeapon)
                    continue;

                *(float*)(pWeapon + 0x754) = 0.0f;
            }
        }

und

aus der gamehacking section (von Killerdluxe)

Code:
#include <windows.h>

DWORD Addr_Base = 0x6CA388;
DWORD Offset[2] = {0x318, 0x128};

void HackThread(){
	MessageBoxA(NULL, "Blablablabla", "Hack", MB_OK);
	while(true){
		if(GetAsyncKeyState(VK_F5)){
			DWORD Address = *(DWORD*)(Addr_Base);
			Address = *(DWORD*)(Address + Offset[0]);
			DWORD Value = *(DWORD*)(Address + Offset[1]);

			if(Value == 1){
				*(DWORD*)(Address + Offset[1]) = 0;
			}else{
				*(DWORD*)(Address + Offset[1]) = 1;
			}
			Sleep(250);
		}

		Sleep(50);
	}
}

BOOL WINAPI DllMain(HINSTANCE HMODULE, DWORD dwReason, LPVOID lpvReserved){
	if(dwReason == DLL_PROCESS_ATTACH)
		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
	return true;
}

und zusammen :



Code:
#include <windows.h>


void HackThread(){
	MessageBoxA(NULL, "Blablablabla", "Hack", MB_OK);
	while(true){
		if(GetAsyncKeyState(VK_F5)){
			DWORD pWeaponsPtr = *(DWORD*)(hShell + 0x90A4B8);
        if (pWeaponsPtr)
        {
            for (int i = 0; i < 512; i++)
            {
                DWORD pWeapon = *(DWORD*)(pWeaponsPtr + i * 4);
                if (pWeapon)
                    continue;

                *(float*)(pWeapon + 0x754) = 0.0f;
            }
        }
		}

		Sleep(50);
	}
}

BOOL WINAPI DllMain(HINSTANCE HMODULE, DWORD dwReason, LPVOID lpvReserved){
	if(dwReason == DLL_PROCESS_ATTACH)
		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
	return true;
}
Nur leider kommt dann das : error C2065: 'hShell': nichtdeklarierter Bezeichner
Ich versteh net wie man hShell deklarieren soll...
01/16/2011 12:26 Medix#2
du verwendest eine variable die du nirgends deklariert hast


dein problem liegt hier:

Quote:
ich hab grad mal einfach ein paar code schnippsel zusammen gewürfelt.
01/16/2011 12:26 Xenox3#3
hShell

#define hShell 0x1234567
DWORD hShell = 0x1234567;

x.x