[DUG] Program Exe information

Paul paul.blommaerts at telenet.be
Mon Mar 30 19:11:38 NZST 2009


you can use this function to check it.

I'm not sure it will work with D2009 though

Paul

function isMadeWithDelphi(Filename: string): Boolean;
const
  BorlandMagicTimeStamp = $2A425E19;
var
  hFile: THandle;
  BytesRead: DWORD;
  ImageDosHeader: TImageDosHeader;
  ImageNtHeaders: TImageNtHeaders;
begin
  Result := FALSE;
  hFile := CreateFile(PChar(Filename), GENERIC_READ, FILE_SHARE_READ, nil,
    OPEN_EXISTING, 0, 0);
  if (hFile <> INVALID_HANDLE_VALUE) then
  begin
    if ReadFile(hFile, ImageDosHeader, SizeOf(TImageDosHeader),BytesRead, 
nil) then
      if BytesRead = SizeOf(TImageDosHeader) then
        if ImageDosHeader.e_magic = IMAGE_DOS_SIGNATURE then
          if SetFilePointer(hFile, ImageDosHeader._lfanew, nil, FILE_BEGIN) 
<> $FFFFFFFF then
            if ReadFile(hFile, ImageNtHeaders, SizeOf(TImageNtHeaders), 
BytesRead, nil) then
              if BytesRead = SizeOf(TImageNtHeaders) then
                if ImageNtHeaders.Signature = IMAGE_NT_SIGNATURE then
                  Result:= ImageNtHeaders.FileHeader.TimeDateStamp = 
BorlandMagicTimeStamp;
    CloseHandle(hFile);
  end;
end;

end.

----- Original Message ----- 
From: "John Bird" <johnkbird at paradise.net.nz>
To: "NZ Borland Developers Group - Delphi List" <delphi at delphi.org.nz>
Sent: Saturday, March 28, 2009 12:54 AM
Subject: [DUG] Program Exe information


I am often curious to know what a particular program was written using, for
instance was just checking out the latest Skype V4 to see if it is still
Delphi

In the exe file I found these strings

FastMM Borland Edition © 2004, 2005 Pierre le Rich

C:\Program Files\CodeGear\RAD Studio\5.0\source\Win32\rtl\sys\SysUtils.pas

So it looks very familiar.

In general, are there any tools around that can look at an executable and
tell info about it - what compiler or language it may have originated from?

John

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: 
unsubscribe



More information about the Delphi mailing list