[==::Zona-Games.Com::==] Bienvenidos Al Foro de respeto
Bueno aqui encontraras Todo lo que a ti te gusta Por ejemplo
Hack de msn Hack De Gunbound Hack De Msn Y Mas Bueno hay
muxo mas solo que tienen que buscar en nuestro Foro

Bueno Me despido Staff: Manuel Rojas


Unirse al foro, es rápido y fácil

[==::Zona-Games.Com::==] Bienvenidos Al Foro de respeto
Bueno aqui encontraras Todo lo que a ti te gusta Por ejemplo
Hack de msn Hack De Gunbound Hack De Msn Y Mas Bueno hay
muxo mas solo que tienen que buscar en nuestro Foro

Bueno Me despido Staff: Manuel Rojas
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

"Safer" Trampolining

Ir abajo

"Safer" Trampolining Empty "Safer" Trampolining

Mensaje  Admin Miér Mar 18, 2009 5:32 pm

"Safer" Trampolining


by Irwin
I've posted a few examples of this before but nobody seems to listen, and thus you have problems with people who have a version (service pack) of Windows which did not support hot-patching. Mind you, I think it's incredibly stupid to trampoline over hooks, but here's a "safer" way to do so:

Código:

#ifdef _WIN64
#error Inline assembler & naked function decelerations are not supported on x64.
#else

#include
#include

#define HOTPATCH_PROLOGUE 0x8BFF
// #define TEST_TRAMPOLINE

ULONG_PTR ulPostMessage;

__declspec(naked) BOOL WINAPI _PostMessage(__in HWND hWnd, __in UINT Msg, __in WPARAM wParam, __in LPARAM lParam)
{
__asm {
push ebp
mov ebp, esp
jmp [ulPostMessage]
}
}

__inline BOOL InitializeTrampoline(void)
{
__try {
ulPostMessage = (ULONG_PTR)PostMessage;
// proof of my absent-mindedness
// ulPostMessage += *(WORD*)PostMessage == HOTPATCH_PROLOGUE ? 5 : 3;
ulPostMessage += 5;
return TRUE;
}
__except(EXCEPTION_EXECUTE_HANDLER) {
return FALSE;
}
}

int __cdecl _tmain(__in int argc, __in_ecount_z(argc) _TCHAR* argv[], __in_z _TCHAR* envp[])
{
UNREFERENCED_PARAMETER(argc);
UNREFERENCED_PARAMETER(argv);
UNREFERENCED_PARAMETER(envp);

if (InitializeTrampoline())
{
_tprintf(_T("trampoline address found!"));
#ifdef TEST_TRAMPOLINE
HWND hWnd = FindWindow(_T("Notepad"), NULL);
if (hWnd != NULL)
_PostMessage(hWnd, WM_CLOSE, 0, 0);
#endif
return EXIT_SUCCESS;
}
else
{
_ftprintf(stderr, _T("error occurred, exception triggered while trying to find hotpatch prologue..."));
return EXIT_FAILURE;
}
}

#endif

HECHOS EN LOS MEJORES FOROS DE
MANUEL
Admin
Admin
Admin

Cantidad de envíos : 224
Edad : 29
Localización : LIMA-PERU-TRUJILLO-ARQUIPA-ESPAÑA-ECUADOR-TARAPOTO-ALEMANIA-CHICLAYO-CHIMBOTE-PERU
Puntos : 488
Reputación : 0
Fecha de inscripción : 07/01/2009

https://zona-games.forosactivos.net

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.