PDA

View Full Version : 1.6.3.4 hook


mlitn
19th October 2004, 09:47
In Loaderdlg.cpp, replace DLLNAME.dll with the desired dll name.
It's ok for me to make public releases with this (unless someone has objections.)


Evilhack part:

Hookworks.cpp:

Replace everything below
Quote:
//*************************** D3D8.dll HOOKS

with:
Quote:
//*************************** D3D8.dll HOOKS
DWORD WINAPI MyDirect3DCreate8(UINT SDKVersion)

{

_asm mov ppDirect3DInterface, ebx;

ppDirect3DInterface += 0x46A4;

MyDirect3DCreate8_t OldFn = (MyDirect3DCreate8_t)D3DHook.Functions[0].OrigFn;

//Set pointer to original device

pD3D8 = (IDirect3D8*)OldFn(SDKVersion);

pMyD3D8 = &MyD3D8;

//Set Keyboard Hooks

hMessageHook = SetWindowsHookEx(WH_GETMESSAGE, MessageProc, NULL, GetCurrentThreadId());

//Unhook core.dll and d3ddrv.dll

UnHookAPICalls(&LoadLibraryHook, GetModuleHandle("Core.dll"));

UnHookAPICalls(&D3DHook, hD3DDrvDll);

//Return pointer to wrapper

return (DWORD)pMyD3D8;

}

//*************************** DINPUT.dll HOOKS

HRESULT WINAPI MyDirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID* ppvOut, LPUNKNOWN punkOuter)

{

ppDirectInputInterface = (DWORD)ppvOut;

MyDirectInput8Create_t OldFn = (MyDirectInput8Create_t)DirectInput8Hook.Functions[0].OrigFn;

HRESULT Result = OldFn(hinst, dwVersion, riidltf, (LPVOID*)&pDInput8, punkOuter);

pMyDInput8 = &MyDInput8;

*ppvOut = pMyDInput8;

//Unhook WinDrv.dll

UnHookAPICalls(&DirectInput8Hook, hWinDrvDll);

return Result;

}

//*************************** KERNEL32.dll HOOKS

DWORD WINAPI MyLoadLibraryW(wchar_t *lpFileName)

{

MyLoadLibraryW_t OldFn = (MyLoadLibraryW_t)LoadLibraryHook.Functions[0].OrigFn;

#ifdef TESTMODE

fwprintf(GameInfo.m_pLogFile, _TEXT("LoadLibraryW: %s\n"), lpFileName);

#endif

DWORD Result = OldFn(lpFileName);

if (wcsstr(lpFileName, _TEXT("D3DDrv")) != 0)

{

HookAPICalls(&D3DHook, (HMODULE)Result);

hD3DDrvDll = (HMODULE)Result;

}

if (wcsstr(lpFileName, _TEXT("WinDrv")) != 0)

{

HookAPICalls(&DirectInput8Hook, (HMODULE)Result);

hWinDrvDll = (HMODULE)Result;

}

return Result;

}

Evilhack.cpp:

Replace everything above:
Quote:
bool CheckForAutoFire()

with:
Quote:
#include "evilhack.h"
#include <winable.h> //for SendInput

#ifdef TESTMODE

#include "mdump.h"

#endif

extern IDirect3DDevice8 *pD3DDevice8; //Original Device pointer

extern NewIDirect3DDevice8 *pMyD3DDevice8; //Wrapped Device pointer

extern IDirect3D8 *pD3D8; //Original Device pointer

extern NewIDirect3D8 *pMyD3D8; //Wrapped Device pointer

extern NewIDirect3D8 MyD3D8;

extern NewIDirectInput8 MyDInput8;

extern IDirectInput8 *pDInput8; //Original Device pointer

externvoid HookDDrawCreate();

externvoid UnHookDDrawCreate();

BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)

{

switch (ul_reason_for_call)

{

case DLL_PROCESS_ATTACH:

{

#ifdef TESTMODE

MessageBox(NULL, "Evilhack has been loaded. You can now attach debugger and then press ok to continue", "info", MB_OK | MB_TOPMOST);

GameInfo.m_pLogFile = fopen("c:\\log.txt", "w");

#endif

//Fixing a bug in loading evilhack.dll path for TESTMODE

#ifdef TESTMODE

staticchar DllPath[MAX_PATH];

FullDllPath = DllPath;

GetModuleFileName((HMODULE)hModule, FullDllPath, MAX_PATH);

#else

FullDllPath = (char*)hModule;

#endif

if (HookAPICalls(&LoadLibraryHook, GetModuleHandle("core.dll")) != true)

MessageBox(NULL, "error attaching evilhack", "error", MB_OK);

//Get Handle to original dll. Its important not to call LoadLibrary here so that the reference counter doesnt get incremented

hOriginalDll = GetModuleHandle("d3d8.dll");

pDirect3DCreate8 = (pDirect3DCreate8_t)GetProcAddress(hOriginalDll, "Direct3DCreate8");

GameInfo.m_Settings.ReadSettings(FullDllPath);

GameInfo.m_Settings.ConvertColors();

GameInfo.m_Settings.ReadIniFiles();

GameInfo.m_LogoStartTime = GetTickCount();

CheckSanity();

}

break;

case DLL_THREAD_ATTACH:

case DLL_THREAD_DETACH:

break;

case DLL_PROCESS_DETACH:

#ifdef TESTMODE

if (GameInfo.m_pLogFile != NULL)

fclose(GameInfo.m_pLogFile);

#endif

if (hMessageHook != NULL)

UnhookWindowsHookEx(hMessageHook);

break;

}

return TRUE;

}

r

Evilconfig part:

Loaderdlg.cpp:

Search for:
Quote:
char StartGameCommand[2048];
add:
Quote:
char EvilhackDll[2048];
Search for:
Quote:
STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory(&si, sizeof(si));

ZeroMemory(&pi, sizeof(pi));

si.cb = sizeof(si);

if (CreateProcess(NULL, StartGameCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))

{

NULL;

#ifndef _DEBUG //keep evilconfig loaded for debug purposes

PostMessage(WM_QUIT, 0, 0);

#endif

}

else

MessageBox("Error creating process", "error", MB_OK);
Replace with:
Quote:
strcpy(EvilhackDll, theApp.m_Settings.m_PathToEvilhack);
strcat(EvilhackDll, "DLLNAME.dll");

if (SpawnProcess(StartGameCommand, EvilhackDll))

PostMessage(WM_QUIT, 0, 0);

else

MessageBox("Error creating process", "error", MB_OK);
Search for:
Quote:
#ifdef _DEBUG
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);

SuspendThread(hProcess);

if (hProcess == NULL)

MessageBox("Couldnt open process", "error", MB_OK);

//Need full path here, just "evilhack.dll" won't do

if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))

MessageBox("Couldnt inject dll", "error", MB_OK);

ResumeThread(hProcess);

CloseHandle(hProcess);

#else

dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());

#endif

CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter

PassCount += 1;

if (PassCount > 1)

{

KillTimer(0);

PostMessage(WM_QUIT, 0, 0);

}

return;

}

}

if (hSnapshot != NULL)

CloseHandle(hSnapshot);

}



CPropertyPage::OnTimer(nIDEvent);

}
Replace with:
Quote:
finish:
#ifdef _DEBUG

HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentEntry.th32ProcessID);

SuspendThread(hProcess);

if (hProcess == NULL)

MessageBox("Couldnt open process", "error", MB_OK);

//Need full path here, just "evilhack.dll" won't do

if (!DetourContinueProcessWithDllA(hProcess, theApp.GetFullDllName()))

MessageBox("Couldnt inject dll", "error", MB_OK);

ResumeThread(hProcess);

CloseHandle(hProcess);

#else

dllinject(CurrentEntry.th32ProcessID, theApp.GetFullDllName());

#endif

CloseHandle(hSnapshot); //Move this here from inside the old CDC 1.5.1 multipass counter

PassCount += 1;

if (PassCount > 1)

{

KillTimer(0);

PostMessage(WM_QUIT, 0, 0);

}

return;

}

}

if (hSnapshot != NULL)

CloseHandle(hSnapshot);

}



CPropertyPage::OnTimer(nIDEvent);

}

itwasfunny
19th October 2004, 12:58
Nice tutorial men

For make quotes you need to put this codes :

After text: [*Quote] -»without the star

before text[/Quote]

Wahts the difrence ( the evilhack modification thread and this)??

gil
19th October 2004, 13:05
Added to the EvilHack Modification thread.

mlitn
19th October 2004, 13:20
Nice tutorial men

For make quotes you need to put this codes :

After text: [*Quote] -»without the star

before text[/Quote

Wahts the difrence ( the evilhack modification thread and this)??

yeah i know bout that, but it was on my forum and since it's down i can't copy-paste it here so i had to do it from a doc-file i saved it in, and i'm too lazy to add quote][/quote

Wahts the difrence ( the evilhack modification thread and this)??
^^what do you mean? difference between this thread and which one?

gil
19th October 2004, 13:32
There is no difference, we are just putting everything there.
You can post there, but there is a link to this thread.


Just like the hack's list.

itwasfunny
19th October 2004, 16:05
to put this in PK Source i need to replace all evilhack´s for painkiller´s right?

I Like Chicken
19th October 2004, 16:09
Not all, just the includes and look for the different file names.

sharknaww
19th October 2004, 16:24
wow never thought I would see this on public forums. Adding this hook is simple jset coppy and paste over your old hook. remember to keep your old includes.

itwasfunny
24th October 2004, 15:03
in painkiller source i have this includes:


#include "painkiller.h"
#include <winable.h> //for SendInput
#ifdef TESTMODE
#include "mdump.h"
#endif
#define BUFSIZE 80
extern IDirect3DDevice8 *pD3DDevice8; //Original Device pointer
extern NewIDirect3DDevice8 *pMyD3DDevice8; //Wrapped Device pointer
extern IDirect3D8 *pD3D8; //Original Device pointer
extern NewIDirect3D8 *pMyD3D8; //Wrapped Device pointer
extern NewIDirect3D8 MyD3D8;
extern NewIDirectInput8 MyDInput8;
extern IDirectInput8 *pDInput8; //Original Device pointer
extern void CompensateRecoilAndBreathing();

I need to replace that with:


#include "painkiller.h"
#include <winable.h> //for SendInput

#ifdef TESTMODE

#include "mdump.h"

#endif

extern IDirect3DDevice8 *pD3DDevice8; //Original Device pointer

extern NewIDirect3DDevice8 *pMyD3DDevice8; //Wrapped Device pointer

extern IDirect3D8 *pD3D8; //Original Device pointer

extern NewIDirect3D8 *pMyD3D8; //Wrapped Device pointer

extern NewIDirect3D8 MyD3D8;

extern NewIDirectInput8 MyDInput8;

extern IDirectInput8 *pDInput8; //Original Device pointer

extern void CompensateRecoilAndBreathing();

itwasfunny
25th October 2004, 13:44
Error Creating Process :( :( :(

HELP!! HELP!!! HELP!!!

I have XP with Service Pack 2
I make my hack in The Windows 98 or millenium in Microsoft VS beta...

I add this to my Hack:

-1.6.3.2 Hook
-Dll name changed
-Hack name changed
-fingerprint
-Body Part Texture info
-Dead Body Fix

And Error Creating Process ?! I think is because the Hook..

hollowsoft
25th October 2004, 20:04
you are using pk source right? well i got the same error when i run the program. i will try putting d3d8.dll in the same folder

mlitn
25th October 2004, 20:11
works on painkiller too, but you gotta change some names (evilhack > painkiller etc)

itwasfunny
25th October 2004, 21:49
Yap, too much work lol.
Im go try with EH SOURCE....

gameplayer1987
26th October 2004, 01:45
So with this hook. And using aiw. Is there any way punk buster can detect it, currently.

mlitn
26th October 2004, 09:32
no .

DeathFr0mBehinD
13th November 2004, 14:35
is this still current (November 13, 2004)?? or are all hooks dead?

noob-cheater
13th November 2004, 14:49
is this still current (November 13, 2004)?? or are all hooks dead?

there are no undetected hook availble currently :ermm: