Esto ya es el comienzo para usar la opcion EOF en un crypter en C, despues hago el modulo completo que esto ya me tomo un rato.

Código: Seleccionar todo

#include <stdio.h>
#include <windows.h>
/***************************\
*        _                  *
*       | |                 *
*       | |__               *
* Coder |____|inkgl         *
* Fecha: 02/01/11           *
* Indetectables.net/foro    *
* Revolutionteams.info      *
* Orgulloso de ser...       *
*  -INDETECTABLE-           *
\***************************/

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

//mHmm..
Muy buena función,yo también me puse con el formato PE,asique vamos a ver que sale de todo esto...

También muy ingenioso,posicionarse y leer en cada sección de la PE...
Blog técnico dedicado a la seguridad informática y al estudio de nuevas vulnerabilidades.
Blog: http://www.seginformatica.net
Twitter: https://twitter.com/#!/p0is0nseginf
Responder

Volver a “Fuentes”