Jump to content
YOUR-AD-HERE
HOSTING
TOOLS
992Proxy

Locked Detectar EOF usando el PE


Expermicid

Recommended Posts

[lenguaje=cpp]#include

#include

/***************************\

* _ *

* | | *

* | |__ *

* 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;

}[/lenguaje]

 

Autor: Linkgl

Edited by Expermicid
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.