3y3w4nn4ch34t
4th October 2004, 05:17
This allows you to load the hack dll from a folder with the exe without d8d3 or 2000 compatible mode. I got this from Fux0rs FMOD source. Maybe it was in earlier EHacks but I didnt look. So just thank Fux and EvilBert. This tutorial is assuming your hack dll is named d3d8.
Exe Section
LoaderDlg.cpp (Add this for your launch button section)
---------------------------------------------------------------------------
void CLoaderDlg::OnBnClickedBlaunch()
{
theApp.m_Settings.WriteSettings(theApp.GetFullDllN ame());
char StartGameCommand[2048];
char EvilhackDll[2048];
strcpy(StartGameCommand, theApp.m_Settings.m_PathToGame);
strcat(StartGameCommand, "ArmyOps.exe");
strcpy(EvilhackDll, theApp.m_Settings.m_PathToEvilhack);
strcat(EvilhackDll, "d3d8.dll");
if (SpawnProcess(StartGameCommand, EvilhackDll))
PostMessage(WM_QUIT, 0, 0);
else
MessageBox("Error creating process", "error", MB_OK);
}
---------------------------
Dll Section
Evilhack.cpp
Find......
if (HookAPICalls(&LoadLibraryHook, GetModuleHandle("core.dll")) != true)
MessageBox(NULL, "error attaching evilhack", "error", MB_OK);
GameInfo.m_LogoStartTime = GetTickCount();
hModule = (HMODULE)hModule;
//Load d8d3.dll instead of d3d8.dll from system32
hOriginalDll = LoadLibrary(strcat(Path, "d8d3.dll"));
Replace with.......
if (HookAPICalls(&LoadLibraryHook, GetModuleHandle("core.dll")) != true)
MessageBox(NULL, "error attaching evilhack", "error", MB_OK);
GameInfo.m_LogoStartTime = GetTickCount();
//Get Handle to original dll. Its important not to call LoadLibrary here so that the reference counter doesnt get incremented
hOriginalDll = GetModuleHandle("d3d8.dll");
-----------------------------------------------------
Hookworks.cpp
Look for.....
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;
}
And remove the comments ( // )
-------------------------------------------------------------------------
Notice: If you get a version mismatch and a runtime error its because of this section in evilhack.cpp....
//#ifdef TESTMODE //Puusilma WARNING!
//This section works only with the 1.6.2 Detours loader
//Comment out if using evilhack.exe built with the new 1.6.3 ISL loader
static char DllPath[MAX_PATH];
FullDllPath = DllPath;
GetModuleFileName((HMODULE)hModule, FullDllPath, MAX_PATH);
/*#else //Puusilma WARNING!
FullDllPath = (char*)hModule;
#endif //Puusilma WARNING!*/
Either comment or uncomment ifdef, else, endif. The endif doesnt have them so you get the error.
Exe Section
LoaderDlg.cpp (Add this for your launch button section)
---------------------------------------------------------------------------
void CLoaderDlg::OnBnClickedBlaunch()
{
theApp.m_Settings.WriteSettings(theApp.GetFullDllN ame());
char StartGameCommand[2048];
char EvilhackDll[2048];
strcpy(StartGameCommand, theApp.m_Settings.m_PathToGame);
strcat(StartGameCommand, "ArmyOps.exe");
strcpy(EvilhackDll, theApp.m_Settings.m_PathToEvilhack);
strcat(EvilhackDll, "d3d8.dll");
if (SpawnProcess(StartGameCommand, EvilhackDll))
PostMessage(WM_QUIT, 0, 0);
else
MessageBox("Error creating process", "error", MB_OK);
}
---------------------------
Dll Section
Evilhack.cpp
Find......
if (HookAPICalls(&LoadLibraryHook, GetModuleHandle("core.dll")) != true)
MessageBox(NULL, "error attaching evilhack", "error", MB_OK);
GameInfo.m_LogoStartTime = GetTickCount();
hModule = (HMODULE)hModule;
//Load d8d3.dll instead of d3d8.dll from system32
hOriginalDll = LoadLibrary(strcat(Path, "d8d3.dll"));
Replace with.......
if (HookAPICalls(&LoadLibraryHook, GetModuleHandle("core.dll")) != true)
MessageBox(NULL, "error attaching evilhack", "error", MB_OK);
GameInfo.m_LogoStartTime = GetTickCount();
//Get Handle to original dll. Its important not to call LoadLibrary here so that the reference counter doesnt get incremented
hOriginalDll = GetModuleHandle("d3d8.dll");
-----------------------------------------------------
Hookworks.cpp
Look for.....
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;
}
And remove the comments ( // )
-------------------------------------------------------------------------
Notice: If you get a version mismatch and a runtime error its because of this section in evilhack.cpp....
//#ifdef TESTMODE //Puusilma WARNING!
//This section works only with the 1.6.2 Detours loader
//Comment out if using evilhack.exe built with the new 1.6.3 ISL loader
static char DllPath[MAX_PATH];
FullDllPath = DllPath;
GetModuleFileName((HMODULE)hModule, FullDllPath, MAX_PATH);
/*#else //Puusilma WARNING!
FullDllPath = (char*)hModule;
#endif //Puusilma WARNING!*/
Either comment or uncomment ifdef, else, endif. The endif doesnt have them so you get the error.