Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Coding Releases > Coding Snippets
You last visited: Today at 16:52

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C++] Punkbuster Detour

Discussion on [C++] Punkbuster Detour within the Coding Snippets forum part of the Coding Releases category.

Reply
 
Old   #1
 
const*'s Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 776
Received Thanks: 313
[C++] Punkbuster Detour

Hello Epvp

I decided to release the code of a basic "Punkbuster-Detour". For everyone who knows for what that is for and could make use of it - nice - if you do not have any plan about, please do not ask. Thanks.

Please note! This detour was written ages ago (2012), so I think it will not work anymore - but you can get it running again by sniffing the addresses or dump the punkbuster main executable. I would really give you guys the knowledge on how to find that out, but unfortunately I can't do it myself anymore. Also note that I did not code that alone, somebody helped me, but I don't know, who was it - if it was you - just raise your hand down below.

Code:
#include <Windows.h>
#include <iostream>
#include <string>

using namespace std;

/* This detour was originally made by *static_cast in 2012. Please do not remove the credits :) */


DWORD NopNopJump(DWORD dwThread, DWORD dwAdress, DWORD dwSize)
{
	DWORD dwDetour, dwProtect, i;
	if (dwAdress&&dwThread&&dwSize >= dwSize)
	{
		dwDetour = (DWORD)VirtualAlloc(0, dwSize + dwSize, 0x1000, 0x40);
		if (dwDetour&&VirtualProtect((VOID*)dwAdress, dwSize, 0x40, &dwProtect))
		{
			for (i = 0; i < dwSize; i++)
			{
				*(BYTE*)(dwDetour + i) = *(BYTE*)(dwAdress + i);
			}
			*(BYTE*)(dwDetour + dwSize + 0) = 0x96;
			*(DWORD*)(dwDetour + dwSize + 1) = (dwAdress + dwSize);
			*(BYTE*)(dwDetour + dwSize + 0) = 0x96;
			*(DWORD*)(dwDetour + dwSize + 1) = (dwAdress + dwSize);
			*(WORD*)(dwDetour + dwSize + 5) = 0x2E;
			*(DWORD*)(dwAdress + 1) = (dwThread);
			*(WORD*)(dwAdress + 5) = 0xE9;
			VirtualProtect((VOID*)dwAdress, dwSize, dwProtect, &dwProtect);
			VirtualProtect((VOID*)dwDetour, dwSize + dwSize, 0x20, &dwProtect);
			return dwDetour;
		}
	}
	return (0);
}

// Credits:
// static_cast*
// MSDN
// Somebody's name I forgot :c
You also can get this working for other anti-cheats like Hackshield, XTrap and so on, if you modify that. That's all.

- Marco
const* is offline  
Old 04/06/2015, 22:25   #2

 
Delinquenz's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,160
Received Thanks: 232
Code:
if (dwAdress&&dwThread&&dwSize >= dwSize)
This checks if dwAdress and dwThread is > 0 and if dwSize is >= dwSize which is always true. What was your intention while writing this?
Delinquenz is offline  
Old 04/06/2015, 23:15   #3
 
const*'s Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 776
Received Thanks: 313
Quote:
Originally Posted by Delinquenz View Post
Code:
if (dwAdress&&dwThread&&dwSize >= dwSize)
This checks if dwAdress and dwThread is > 0 and if dwSize is >= dwSize which is always true. What was your intention while writing this?
Just to make sure, it might be neccessary, if you are mapping the process.
const* is offline  
Reply


Similar Threads Similar Threads
C++ Detour Help
09/09/2013 - C/C++ - 8 Replies
Was wondering if someone knows why my return SendTramp crashes exe Perhaps the (int, int, size_t, int, int) from IDA is incorrect?
C++ Detour & Dll
09/14/2012 - C/C++ - 7 Replies
Ich stehe gerade vor einem mir unerklärlichem Problem. Bis gerade eben dachte ich noch es liegt an meiner Unfähigkeit mit Detorus umzugehen bzw. meinen Reversing Künsten, aber jetzt ist mir aufgefallen, dass es scheinbar gar nicht direkt an den Detour-Funktionen liegt, sondern an meiner Dll. Um das ganze ein bisschen genauer zu beschreiben: Ich wollte endlich mal mit dem Thema Detours anfangen, klingt auch alles soweit logisch und ich glaube auch es verstanden zu haben. Also habe ich mir...
Detour und Rehook?! oder nur Detour?
09/16/2011 - WarRock - 4 Replies
Hallo EPVP' Ich hätte mal ne kleine Frage an die D3D Coder C++. Ich hab schon meinen eigenen Hack gecoded. Nun woltle ich D3D Funcs adden, hab auch den richtigen code. In-Game geht es jedoch NICHT!. Nun wurde mir von jemanden gesagt ich bräuchte eine Detour.
C++ WndProc Detour
07/27/2011 - C/C++ - 4 Replies
Hi, ich will das WndProc von einem fremden Programm Detouren, aber ich weiß nicht wie der Name der WndProc ist... Wie kann ich ihn herausfinden? Also das Programm hat nur ein Fenster sagen wir das Fenster heißt "Test" und ich habe das Handle dazu kann ich jetzt irgendwie den Name der WndProc herausfinden? MFG!



All times are GMT +2. The time now is 16:52.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.