View Full Version : Fixing detouring PB
mojo007
04-15-2008, 12:14 PM
I added detours.h and detours.lib in my src folder, and
version is 1.5
added testdig.cpp
#include "detours.h"
#pragma comment(lib, "detours")
and added the code in testdig.cpp
typedef int ( *PBPerformCheck_t )( int iArg1, int iArg2, size_t sArg3 );
PBPerformCheck_t pPBPerformCheck = 0;
int _PBPerformCheck( int iArg1, int iArg2, size_t sArg3 )
{
// Remove stuff
int iReturn = pPBPerformCheck( iArg1 , iArg2, sArg3 );
// Apply stuff
return iReturn;
}
void Hook( )
{
DWORD dwPbclBase = ( DWORD )GetModuleHandle( "pbcl.dll" );
pPBPerformCheck = ( PBPerformCheck_t )DetourFunction( ( BYTE * )( dwPbclBase + 0x10055FC5 ), ( BYTE * )_PBPerformCheck);
}
and compileded
can i be sure it will work ingame , or do i need any changes like a call or ?
Wrhackadmin
04-16-2008, 03:51 AM
i think it's ok
mojo007
04-16-2008, 06:21 AM
dont work testet it. after i turn for antikick, i got a ban, so the deatouring dont work..
purple
04-16-2008, 08:33 AM
there is much code missing. i think u only copy&paste this. i dont think that anyone will give u just the source. there r so much tutorials and u can get the pb offsets in this board... u should make it on ur own...
Kill3rinstinct
04-17-2008, 09:27 AM
Try this
The checks function is like this int, size_t, char *.. Creds to Cobra for this :)
so to detour it you could just do this instead
#include <windows.h>
#include <detours.h>
unsigned long PB = 0;
typdef int (__cdecl* _pbCheck)(int, size_t, char *);
_pbCheck pbCheck_;
int __cdecl Check(int, size_t, char *);
int __stdcall Detour(int);
//////////////////////////////////////////////////////////////
*/ Make sure u done ur main DLLMain Part :) /*
int __cdecl Check(int a1, size_t a2, char *a3)
{
Detour(0);
int p = pbCheck_(a1, a2, a3);
Detour(1);
/// also disable mem hacks here, you shud no how to do that
Return p;
}
int __stdcall Detour(int a1)
{
if(a1 == 0)
{
DetourRemove((unsigned char*)pbCheck_, ((unsigned char*)Check);
}
else if(a1 == 1)
{
pbCheck_ = = (_pbCheck)DetourFunction((unsigned char*)(PB + 0x1CCA3), (unsigned char*)Check);
}
}
Credits to Roverturbo to teach me detours... i just modified most of it.. anyway this should work
In your DLL Main ALso call the Detour so when attached do
Detour(1);
+ That warrock offset is right ;)
mojo007
04-17-2008, 11:32 AM
i did but errors and mfc exe dont obtain a main.cpp, i dont have main cpp
.cpp(267) : error C2199: syntax error : found 'int (' at global scope (was a declaration intended?)
testDlg.cpp(267) : error C2501: 'typdef' : missing storage-class or type specifiers
testDlg.cpp(267) : error C2199: syntax error : found 'int (' at global scope (was a declaration intended?)
testDlg.cpp(269) : error C2146: syntax error : missing ';' before identifier 'pbCheck_'
testDlg.cpp(269) : error C2501: '_pbCheck' : missing storage-class or type specifiers
testDlg.cpp(269) : fatal error C1004: unexpected end of file found
purple
04-17-2008, 12:37 PM
he told u how it works, but i think u even dont know the c++ basics...
mojo007
04-17-2008, 12:41 PM
omg purple, i am maybe new to understand the coding, and reading for tuts
all beginners look for tuts, you did 2!
so whats the problem with you
dont post if you gonna answer like a biatch
masterboy
04-17-2008, 03:16 PM
Try this
The checks function is like this int, size_t, char *.. Creds to Cobra for this :)
so to detour it you could just do this instead
#include <windows.h>
#include <detours.h>
unsigned long PB = 0;
typdef int (__cdecl* _pbCheck)(int, size_t, char *);
_pbCheck pbCheck_;
int __cdecl Check(int, size_t, char *);
int __stdcall Detour(int);
//////////////////////////////////////////////////////////////
*/ Make sure u done ur main DLLMain Part :) /*
int __cdecl Check(int a1, size_t a2, char *a3)
{
Detour(0);
int p = pbCheck_(a1, a2, a3);
Detour(1);
/// also disable mem hacks here, you shud no how to do that
Return p;
}
int __stdcall Detour(int a1)
{
if(a1 == 0)
{
DetourRemove((unsigned char*)pbCheck_, ((unsigned char*)Check);
}
else if(a1 == 1)
{
pbCheck_ = = (_pbCheck)DetourFunction((unsigned char*)(PB + 0x1CCA3), (unsigned char*)Check);
}
}
Credits to Roverturbo to teach me detours... i just modified most of it.. anyway this should work
In your DLL Main ALso call the Detour so when attached do
Detour(1);
+ That warrock offset is right ;)
If im right this should be injected in warrock.exe or it won't work and mojo you need the right detours.h
purple
04-18-2008, 08:27 AM
perhaps u r right. but there r so many coders that even dont know wtf a variable is and its always *teach me hacking warrock* *help me making my hack ud* *tell me the code of detouring pb*....
is leider so sry...
edit: okay sry for being pissed^^ not my day ;-)
be sure to include msdetours 1.5... u have to include <detour.h> and detour.lib and perhaps compile it before. this code works for visual c++!
masterboy
04-18-2008, 10:01 AM
i did but errors and mfc exe dont obtain a main.cpp, i dont have main cpp
.cpp(267) : error C2199: syntax error : found 'int (' at global scope (was a declaration intended?)
testDlg.cpp(267) : error C2501: 'typdef' : missing storage-class or type specifiers
testDlg.cpp(267) : error C2199: syntax error : found 'int (' at global scope (was a declaration intended?)
testDlg.cpp(269) : error C2146: syntax error : missing ';' before identifier 'pbCheck_'
testDlg.cpp(269) : error C2501: '_pbCheck' : missing storage-class or type specifiers
testDlg.cpp(269) : fatal error C1004: unexpected end of file found
Check your PM,I gave u a better Detour that should work
purple
04-19-2008, 02:09 AM
the problem was u did not include detours.lib correctly
deejdd
04-23-2008, 05:13 AM
Hey m8 could you send me a Working detour to? since this one is'nt working.
btw is the current offset 55FC5 ?
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.