Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 20:58

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

Advertisement



Hilfe bei Detour (C++)

Discussion on Hilfe bei Detour (C++) within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
AutoitScript's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 74
Received Thanks: 24
Hilfe bei Detour (C++)

Hi,

Habe gerade das Tutorial von MrSmith durchgemacht. Hat super geklappt.
Jetzt habe ich mir ein kleines Testprogramm geschrieben, in dem ich ebenfalls die MessageBoxW Funktion detouren möchte. In Olly habe ich flgendes gefunden:
Code:
idata:00482684 ; int __stdcall MessageBoxW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType)
Mein Code:
Code:
#include <detours.h>

#pragma comment(lib,"detours")

typedef int (__stdcall *MyType)(HWND,LPCWSTR,LPCWSTR,UINT);

MyType Original = NULL;

int __stdcall MessageBoxWDetour(HWND Window, LPCWSTR Text, LPCWSTR Caption, UINT Type)
{
	Text = L"lol'd";
	return Original(Window, Text, Caption, Type);
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		MessageBoxA(0,"Attached","Info",0);
		Original=(MyType)DetourFunction((PBYTE)0x00482684,(PBYTE)MessageBoxWDetour);
		break;
	case DLL_PROCESS_DETACH:
		MessageBoxA(0,"Dettached","Info",0);
		break;
	}
	return TRUE;
}
Wenn ich die Dll dann injecte crasht das Prog.

PS: Bin C++ "Anfänger", beherrsche jedoch C# recht gut.


Mfg AutoitScript
AutoitScript is offline  
Old 08/27/2012, 21:22   #2
 
elite*gold: 0
Join Date: Jul 2010
Posts: 388
Received Thanks: 196
Was soll die Adresse?

Code:
Original=(MyType)DetourFunction((PBYTE)MessageBoxW,(PBYTE)MessageBoxWDetour);
SmackJew is offline  
Old 08/28/2012, 19:45   #3


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,908
Received Thanks: 25,409
Arrow General Coding -> C/C++

#moved
MrSm!th is offline  
Reply


Similar Threads Similar Threads
Detour Problem
03/17/2012 - C/C++ - 7 Replies
Hey leute ich habe ein Problem mit einem Geplanten Detour. Hier der Source teil. push ebp; mov ,SentryGunTimeAddy1 mov ,SentryGunTimeAddy2 mov ,SentryGunTimeAddy3 mov ,SentryGunTimeAddy4
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!
[Serach]Detour
02/19/2011 - WarRock Hacks, Bots, Cheats & Exploits - 5 Replies
Hi, Who has and will give the detour?



All times are GMT +1. The time now is 20:58.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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