PDA

View Full Version : ...Oh bob saget



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;
}

masterboy
04-30-2008, 10:49 AM
I never saw that error,it looks like that Pb detects your code,so try to comment some things off and try again....

Fragment
04-30-2008, 03:04 PM
Nah if it were that, I'd get a kick/ban. I think the coding is wrong. And if I forgot to mention this, this thing occurs when i FIRST LOG IN. Not every 2 minutes.

AlexSleyore
04-30-2008, 07:00 PM
i tried it.. i dont get any errors just get kicked cause PB stops responding

only 4 things i changed:

#include <windows.h>
#include "detours.h"

PbclBase = (DWORD)GetModuleHandle(L"pbcl.dll");

PBMemcheck = (int (__stdcall*)(int,size_t,int))DetourFunction((PBYTE )(PbclBase + 0x55FC5), (PBYTE)ModMemcheck);

and

PbclBase = (DWORD)GetModuleHandle(L"pbcl.dll");



i also solution config from Debug to Release. im pretty sure thats all i changed at least

Fragment
04-30-2008, 08:46 PM
i tried it.. i dont get any errors just get kicked cause PB stops responding

only 4 things i changed:

#include <windows.h>
#include "detours.h"

PbclBase = (DWORD)GetModuleHandle(L"pbcl.dll");

PBMemcheck = (int (__stdcall*)(int,size_t,int))DetourFunction((PBYTE )(PbclBase + 0x55FC5), (PBYTE)ModMemcheck);

and

PbclBase = (DWORD)GetModuleHandle(L"pbcl.dll");



i also solution config from Debug to Release. im pretty sure thats all i changed at least

What lol?
What did you change?

I put the L before PBCL.DLL and it didn't compile properly because of it, and the only difference between the main detour functions are that you put a space after PByTE... so what did you change?

AlexSleyore
05-01-2008, 10:39 PM
Mine:

PBMemcheck = (int (__stdcall*)(int,size_t,int))DetourFunction((PBYTE )(PbclBase + 0x55FC5), (PBYTE)ModMemcheck);


Yours:

PBMemcheck = (int (__stdcall*)(int))DetourFunction((PBYTE)(PbclBase + 0x55FC5), (PBYTE)ModMemcheck);

Look at ooo right here

PBMemcheck = (int (__stdcall*)(int,size_t,int))DetourFunction((PBYTE )(PbclBase + 0x55FC5), (PBYTE)ModMemcheck);