xmy
11-14-2010, 10:51 AM
/Edit:
Using a different Injector did it :)
Thanks anyway.
Hello guys, first of all for the nice tutorials here.
I try to write my first small Hook for CSS using the Pluginconvert tutorial(gamedeception.net/threads/20643-How-to-convert-a-plugin-based-cheat-into-an-injected-cheat).
I'm using Ring0's ProInjector to load my Plugin. My problem is, it does not get loaded. I can load the plugin via plugin_load. But the injector just does nothing.
I hope someone can help me here.
Using plugin_load, the MessageBoxes are showing up too.
I really want to learn, i don't want code. Just some small tipps :)
That's my Code:
#include <stdio.h>
#include "interface.h"
#include "filesystem.h"
#include "engine/iserverplugin.h"
#include "eiface.h"
#include "igameevents.h"
#include "convar.h"
#include "Color.h"
#include "vstdlib/random.h"
#include "engine/IEngineTrace.h"
#include "windows.h"
#include <tier1/tier1.h>
#include <tier2/tier2.h>
#include <tier3/tier3.h>
#include "game/server/iplayerinfo.h"
#include <../game/client/cdll_client_int.h>
#include <string>
HANDLE hThread;
HMODULE hmCheat;
HWND hGameWindow;
char g_path[ MAX_PATH ];
void LoadHack(){
HMODULE hmEngine = GetModuleHandleA( "engine.dll" );
HMODULE hmVgui = GetModuleHandleA("vstdlib.dll");
CreateInterfaceFn pfnEngine = ( CreateInterfaceFn ) GetProcAddress( hmEngine, "CreateInterface" );
CreateInterfaceFn pfnvgui = ( CreateInterfaceFn ) GetProcAddress( hmVgui, "CreateInterface" );
IVEngineClient* pEngine = (IVEngineClient*) pfnEngine( "VEngineClient013", NULL );
ICvar *pCvar = (ICvar *)pfnvgui("VEngineCvar004",NULL);
pCvar->ConsoleDPrintf("Oh Hai");
pCvar->ConsolePrintf("Oh Hai");
}
DWORD WINAPI InitThread( LPVOID param )
{
try{
bool done = false;
GetModuleFileNameA( hmCheat, g_path, MAX_PATH );
char* path_end = NULL;
for ( char* ptr = g_path; *ptr; ++ptr )
{
if ( *ptr=='\\' ) path_end = ptr+1;
}
*path_end = '\0';
MessageBox(NULL, "", "", MB_OK);
done = true;
}catch (...){
MessageBox(NULL, "", "", MB_OK);
}
LoadHack();
return 0;
}
BOOL APIENTRY DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
{
if ( dwReason==DLL_PROCESS_ATTACH )
{
// Save our module handle
hmCheat = hModule;
// No need to call us anymore
DisableThreadLibraryCalls( hModule );
// Just create the initializer thread with default stuff
hThread = CreateThread( NULL, 0, &InitThread, NULL, 0, NULL );
}
return TRUE;
}
Regards
Using a different Injector did it :)
Thanks anyway.
Hello guys, first of all for the nice tutorials here.
I try to write my first small Hook for CSS using the Pluginconvert tutorial(gamedeception.net/threads/20643-How-to-convert-a-plugin-based-cheat-into-an-injected-cheat).
I'm using Ring0's ProInjector to load my Plugin. My problem is, it does not get loaded. I can load the plugin via plugin_load. But the injector just does nothing.
I hope someone can help me here.
Using plugin_load, the MessageBoxes are showing up too.
I really want to learn, i don't want code. Just some small tipps :)
That's my Code:
#include <stdio.h>
#include "interface.h"
#include "filesystem.h"
#include "engine/iserverplugin.h"
#include "eiface.h"
#include "igameevents.h"
#include "convar.h"
#include "Color.h"
#include "vstdlib/random.h"
#include "engine/IEngineTrace.h"
#include "windows.h"
#include <tier1/tier1.h>
#include <tier2/tier2.h>
#include <tier3/tier3.h>
#include "game/server/iplayerinfo.h"
#include <../game/client/cdll_client_int.h>
#include <string>
HANDLE hThread;
HMODULE hmCheat;
HWND hGameWindow;
char g_path[ MAX_PATH ];
void LoadHack(){
HMODULE hmEngine = GetModuleHandleA( "engine.dll" );
HMODULE hmVgui = GetModuleHandleA("vstdlib.dll");
CreateInterfaceFn pfnEngine = ( CreateInterfaceFn ) GetProcAddress( hmEngine, "CreateInterface" );
CreateInterfaceFn pfnvgui = ( CreateInterfaceFn ) GetProcAddress( hmVgui, "CreateInterface" );
IVEngineClient* pEngine = (IVEngineClient*) pfnEngine( "VEngineClient013", NULL );
ICvar *pCvar = (ICvar *)pfnvgui("VEngineCvar004",NULL);
pCvar->ConsoleDPrintf("Oh Hai");
pCvar->ConsolePrintf("Oh Hai");
}
DWORD WINAPI InitThread( LPVOID param )
{
try{
bool done = false;
GetModuleFileNameA( hmCheat, g_path, MAX_PATH );
char* path_end = NULL;
for ( char* ptr = g_path; *ptr; ++ptr )
{
if ( *ptr=='\\' ) path_end = ptr+1;
}
*path_end = '\0';
MessageBox(NULL, "", "", MB_OK);
done = true;
}catch (...){
MessageBox(NULL, "", "", MB_OK);
}
LoadHack();
return 0;
}
BOOL APIENTRY DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
{
if ( dwReason==DLL_PROCESS_ATTACH )
{
// Save our module handle
hmCheat = hModule;
// No need to call us anymore
DisableThreadLibraryCalls( hModule );
// Just create the initializer thread with default stuff
hThread = CreateThread( NULL, 0, &InitThread, NULL, 0, NULL );
}
return TRUE;
}
Regards