Jump to content


Photo

[TRUCOS DELPHI] Tipo de Ejecutable (Binario).


  • Please log in to reply
No replies to this topic

#1 sir.dev.a.lot

sir.dev.a.lot

    Advanced Member

  • Miembros
  • PipPipPip
  • 545 posts
  • Location127.0.0.1

Posted 24 August 2016 - 11:02 AM

[TRUCOS DELPHI] Tipo de Ejecutable (Binario).


delphi
  1. function getexetype(Filename:string):string;
  2. var
  3. BinaryType: DWORD;
  4. begin
  5. If GetBinaryType(Pchar(Filename), Binarytype) Then
  6. case BinaryType of
  7. SCS_32BIT_BINARY: Result:= 'Win32 executable';
  8. SCS_DOS_BINARY : Result:= 'DOS executable';
  9. SCS_WOW_BINARY : Result:= 'Win16 executable';
  10. SCS_PIF_BINARY : Result:= 'PIF file';
  11. SCS_POSIX_BINARY: Result:= 'POSIX executable';
  12. SCS_OS216_BINARY: Result:= 'OS/2 16 bit executable'
  13. else
  14. Result:= 'unknown executable'
  15. end
  16. else
  17. Result:= 'File is not an executable';
  18. end;

Ejemplo de uso:


delphi
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3. Label1.Caption:=getexetype('c:\windows\notepad.exe');
  4. end;

Saludos!


  • 1




IP.Board spam blocked by CleanTalk.