Visitante
Ingresar
Registrarse
Underc0de - Hacking y seguridad informática
Menu
Inicio
Website
Blog
Buscar
Calendario
Ingresar
Registrarse
Underc0de - Hacking y seguridad informática
»
Programación General
»
C / C++
»
Códigos Fuentes
Detectar EOF usando el PE
Imprimir
Páginas: [
1
]
Ir Abajo
« anterior
próximo »
Detectar EOF usando el PE
0 Respuestas
2268 Vistas
0 Usuarios y 1 Visitante están viendo este tema.
linkgl
Underc0der
Mensajes: 45
Actividad:
0%
Reputación 0
Detectar EOF usando el PE
en: Agosto 14, 2011, 12:13:14 pm
Bueno esta función retorna true si existe EOF en un ejecutable y false si no existe jeje saludos!.
Código: C
#include <stdio.h>
#include <windows.h>
/***************************\
* _ *
* | | *
* | |__ *
* Coder |____|inkgl *
* Fecha: 02/01/11 *
\***************************/
bool existe_EOF
(
char
*
ruta
)
{
//-> Estructuras necesarias
IMAGE_DOS_HEADER idh
;
IMAGE_NT_HEADERS inh
;
IMAGE_SECTION_HEADER ish
;
//-> Variables necesarias
FILE
*
fp
;
DWORD iTam
;
DWORD hTam
;
//Abrimos el archivo para leer en binario
fp
=
fopen
(
ruta
,
"rb"
)
;
if
(
fp
!=
NULL
)
{
fseek
(
fp
,
0
,
SEEK_END
)
;
iTam
=
ftell
(
fp
)
;
rewind
(
fp
)
;
fread
(
&
idh
,
sizeof
(
IMAGE_DOS_HEADER
)
,
1
,
fp
)
;
fseek
(
fp
,
idh.
e_lfanew
,
SEEK_SET
)
;
fread
(
&
inh
,
sizeof
(
IMAGE_NT_HEADERS
)
,
1
,
fp
)
;
fseek
(
fp
,
idh.
e_lfanew
+
sizeof
(
IMAGE_NT_HEADERS
)
+
sizeof
(
IMAGE_SECTION_HEADER
)
*
(
inh.
FileHeader
.
NumberOfSections
-
1
)
,
SEEK_SET
)
;
fread
(
&
ish
,
sizeof
(
IMAGE_SECTION_HEADER
)
,
1
,
fp
)
;
fclose
(
fp
)
;
hTam
=
ish.
PointerToRawData
+
ish.
SizeOfRawData
;
if
(
hTam
<
iTam
)
return
true
;
else
return
false
;
}
}
//->USO
int
main
(
)
{
if
(
existe_EOF
(
"C:
\\
salida.exe"
)
)
printf
(
"El ejecutable tiene EOF"
)
;
else
printf
(
"El ejecutable no tiene EOF"
)
;
getchar
(
)
;
return
0
;
}
En línea
Imprimir
Páginas: [
1
]
Ir Arriba
« anterior
próximo »
Similar topics (1)
Detectar teclas presionadas por HOOKS (Keylogger base)
Iniciado por
linkgl
Respuestas: 2
Vistas: 4707
Agosto 20, 2011, 12:28:05 pm
por
linkgl
Sponsors
Zerpens
Kali-Linux
Club Hacker
ANTRAX-LABS
Ingresar
×
Bienvenido(a),
Visitante
. Por favor,
ingresa
o
regístrate
. ¿Perdiste tu
email de activación
?
1 Hora
1 Día
1 Semana
1 Mes
Siempre
Ingresar con nombre de usuario, contraseña y duración de la sesión