Fragment
04-29-2008, 08:29 PM
Im trying to detour PB, and when I joined a server, my screen got flooded with these.
http://img247.imageshack.us/img247/831/pubdw1.png
Did anyone have this problem, and if so, how did they fix it?
And here is my code. Written in Visual C++ 6
#include <windows.h>
#include "detours.h"
#pragma comment(lib, "detours.lib")
//Variables
DWORD PbclBase;
//Hooked Functions
int (__stdcall* PBMemcheck)(int,size_t,int);
//My Replaced Functions
int ModMemcheck(int a, size_t b, int c)
{
//Hacks Off
return PBMemcheck(a, b, c);
//Hacks On
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
PbclBase = (DWORD)GetModuleHandle("pbcl.dll");
PBMemcheck = (int (__stdcall*)(int))DetourFunction((PBYTE)(PbclBase + 0x55FC5), (PBYTE)ModMemcheck);
//Hacks on (But only for these testing purposes)
}
if (dwReason == DLL_PROCESS_DETACH)
{
PbclBase = (DWORD)GetModuleHandle("pbcl.dll");
DetourRemove((PBYTE)(PbclBase + 0x55FC5), (PBYTE)PBMemcheck);
}
return TRUE;
}
http://img247.imageshack.us/img247/831/pubdw1.png
Did anyone have this problem, and if so, how did they fix it?
And here is my code. Written in Visual C++ 6
#include <windows.h>
#include "detours.h"
#pragma comment(lib, "detours.lib")
//Variables
DWORD PbclBase;
//Hooked Functions
int (__stdcall* PBMemcheck)(int,size_t,int);
//My Replaced Functions
int ModMemcheck(int a, size_t b, int c)
{
//Hacks Off
return PBMemcheck(a, b, c);
//Hacks On
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
PbclBase = (DWORD)GetModuleHandle("pbcl.dll");
PBMemcheck = (int (__stdcall*)(int))DetourFunction((PBYTE)(PbclBase + 0x55FC5), (PBYTE)ModMemcheck);
//Hacks on (But only for these testing purposes)
}
if (dwReason == DLL_PROCESS_DETACH)
{
PbclBase = (DWORD)GetModuleHandle("pbcl.dll");
DetourRemove((PBYTE)(PbclBase + 0x55FC5), (PBYTE)PBMemcheck);
}
return TRUE;
}