[==::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.

[C] Reading Pointers

Ir abajo

[C] Reading Pointers Empty [C] Reading Pointers

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

[C] Reading Pointers


by Manuel
This cool idea just randomly came to mind while on IRC.

Código:

#include

#define OFFSETS_END 0xDEADBEEF

__checkReturn BOOL _ReadPointer(__out PULONG_PTR pulValue, __in LPCVOID lpcvBase, ...)
{
ULONG_PTR ulTemp;
va_list pArguments;
BOOL bRET;
int iOffset;

__try {
ulTemp = (ULONG_PTR)lpcvBase;
va_start(pArguments, lpcvBase);
while ((iOffset = va_arg(pArguments, int)) != OFFSETS_END)
ulTemp = *(ULONG_PTR*)((*(ULONG_PTR*)ulTemp) + iOffset);
va_end(pArguments);
*pulValue = ulTemp == (ULONG_PTR)lpcvBase ? *(ULONG_PTR*)ulTemp : ulTemp;
bRET = TRUE;
}
__except(EXCEPTION_EXECUTE_HANDLER) {
bRET = FALSE;
}

return bRET;
}

#define ReadPointer(x, y, ...) _ReadPointer(x, y, __VA_ARGS__, OFFSETS_END)Example usage:
Código:

Código:
// Read a pointer: [0x600000]+0x69]
ReadPointer(&ulValue, (LPCVOID)0x600000, 0x69);
// Read a multi-level pointer: [[[[0x400000]+10]]+10]
ReadPointer(&ulValue, (LPCVOID)0x400000, 10, 0, 10);PROTIP: I'm being lazy and if you wanted it to be as safe as possible, instead of just catching exceptions I suggest you use VirtualQuery

by BanMe
the methodology is execellent and the code is easy to understand Great job Irwin .. here a very simple write to go along with it.. CREDITS to Irwin here to.. cause its just a simple mod of like 3 lines of code..


Código:

Código:

BOOL _WritePointer(__in ULONG ulValue, __in LPCVOID lpcvBase, ...)
{
ULONG_PTR ulTemp;
va_list pArguments;
BOOL bRET;
int iOffset;

__try {
ulTemp = (ULONG_PTR)lpcvBase;
va_start(pArguments, lpcvBase);
while ((iOffset = va_arg(pArguments, int)) != 0x7ffff000)
ulTemp = *(ULONG_PTR*)((*(ULONG_PTR*)ulTemp) + iOffset);
va_end(pArguments);
*ulTemp = ulValue;
bRET = TRUE;
}
__except(EXCEPTION_EXECUTE_HANDLER) {
bRET = FALSE;
}

return bRET;
}

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


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