Click here to Skip to main content
15,901,283 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSEX HERE Pin
gamitech6-Mar-06 11:36
gamitech6-Mar-06 11:36 
QuestionRibbon control Pin
Andre xxxxxxx6-Mar-06 10:38
Andre xxxxxxx6-Mar-06 10:38 
AnswerRe: Ribbon control Pin
PJ Arends6-Mar-06 15:22
professionalPJ Arends6-Mar-06 15:22 
GeneralRe: Ribbon control Pin
Andre xxxxxxx6-Mar-06 23:21
Andre xxxxxxx6-Mar-06 23:21 
QuestionPer-user per-machine registry Pin
Squirrel Twirler6-Mar-06 9:55
Squirrel Twirler6-Mar-06 9:55 
AnswerRe: Per-user per-machine registry Pin
Ryan Binns6-Mar-06 17:25
Ryan Binns6-Mar-06 17:25 
GeneralRe: Per-user per-machine registry Pin
Squirrel Twirler6-Mar-06 19:28
Squirrel Twirler6-Mar-06 19:28 
GeneralRe: Per-user per-machine registry Pin
Ryan Binns6-Mar-06 22:05
Ryan Binns6-Mar-06 22:05 
QuestionProject Includes settings. Pin
Maximilien6-Mar-06 8:39
Maximilien6-Mar-06 8:39 
QuestionNewcomer Guidance Pin
Greg Barnes6-Mar-06 7:53
Greg Barnes6-Mar-06 7:53 
AnswerRe: Newcomer Guidance Pin
Christian Graus6-Mar-06 8:14
protectorChristian Graus6-Mar-06 8:14 
GeneralRe: Newcomer Guidance Pin
Greg Barnes6-Mar-06 8:20
Greg Barnes6-Mar-06 8:20 
GeneralRe: Newcomer Guidance Pin
Chris Meech6-Mar-06 8:45
Chris Meech6-Mar-06 8:45 
AnswerRe: Newcomer Guidance Pin
Ryan Binns6-Mar-06 17:28
Ryan Binns6-Mar-06 17:28 
QuestionWhy? Pin
#realJSOP6-Mar-06 5:47
professional#realJSOP6-Mar-06 5:47 
AnswerRe: Why? Pin
Blake Miller6-Mar-06 5:49
Blake Miller6-Mar-06 5:49 
AnswerRe: Why? Pin
Michael Dunn6-Mar-06 8:03
sitebuilderMichael Dunn6-Mar-06 8:03 
QuestionHow? Pin
Lampros Giampouras6-Mar-06 5:35
Lampros Giampouras6-Mar-06 5:35 
AnswerRe: How? Pin
David Crow6-Mar-06 5:36
David Crow6-Mar-06 5:36 
AnswerRe: How? Pin
Roger Stoltz6-Mar-06 5:39
Roger Stoltz6-Mar-06 5:39 
Question_DebugHeapTag error Pin
Eytukan6-Mar-06 5:13
Eytukan6-Mar-06 5:13 
AnswerRe: _DebugHeapTag error Pin
toxcct6-Mar-06 6:59
toxcct6-Mar-06 6:59 
QuestionMicrosoft detour + hook winapi functions Pin
David-coder6-Mar-06 5:08
David-coder6-Mar-06 5:08 
Hi all,

Since a few weeks I am playing with detour and winapi functions.
I hooked DirectDrawCreate and GetProcAdress. In the function GetProcAdress I want to return the adress of the api function "DirectDrawCreate" without detour does some 1 got the solution for this? Below the code I made so far:

<br />
<br />
DETOUR_TRAMPOLINE( HWND __stdcall zDirectDrawCreate(GUID* lpGUID , LPDIRECTDRAW* lplpDD , IUnknown* pUnkOuter) ,DirectDrawCreate );<br />
<br />
HWND __stdcall sDirectDrawCreate(GUID* lpGUID , LPDIRECTDRAW* lplpDD , IUnknown* pUnkOuter) <br />
{<br />
return zDirectDrawCreate(lpGUID , lplpDD , pUnkOuter); // Give PB the HRESULT<br />
}<br />
<br />
<br />
<br />
DETOUR_TRAMPOLINE(FARPROC WINAPI zGetProcAddress (HMODULE hModule, LPCSTR lp),GetProcAddress);<br />
<br />
FARPROC WINAPI sGetProcAddress (HMODULE hModule, LPCSTR lp)<br />
{<br />
if(HIWORD(lp))<br />
{<br />
<br />
<br />
if(!strcmp(lp, "GetProcAddress")) return (FARPROC) zGetProcAddress;<br />
//else if (!strcmp(lp, "DirectDrawCreate")) return // how can I return here the adress of the DirectDrawCreate api function without detour.. detour make jumps 0xE9 or 0x90.<br />
<br />
}<br />
return zGetProcAddress(hModule, lp);<br />
}<br />
<br />
void Detour_PB_DirectDraw()<br />
{ <br />
DetourFunctionWithTrampoline((PBYTE)zDirectDrawCreate,(PBYTE)sDirectDrawCreate);<br />
}<br />
<br />
void Detour_PB_GetProcAddress()<br />
{<br />
DetourFunctionWithTrampoline((PBYTE)zGetProcAddress,(PBYTE)sGetProcAddress);<br />
}<br />
<br />
bool WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, PVOID pvReserved)<br />
{<br />
if(dwReason == DLL_PROCESS_ATTACH) <br />
{<br />
<br />
Detour_PB_GetProcAddress(); <br />
Detour_PB_DirectDraw();<br />
<br />
}<br />
<br />
else if(dwReason == DLL_PROCESS_DETACH)<br />
{<br />
<br />
}<br />
<br />
return true; <br />
}<br />

AnswerRe: Microsoft detour + hook winapi functions Pin
Stephen Hewitt6-Mar-06 11:46
Stephen Hewitt6-Mar-06 11:46 
GeneralRe: Microsoft detour + hook winapi functions Pin
David-coder7-Mar-06 6:06
David-coder7-Mar-06 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.