Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 760773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:45:31+00:00 2026-05-14T15:45:31+00:00

Using either Delphi 2007+ or Lazarus(Win64) I’m looking for a way to determine if

  • 0

Using either Delphi 2007+ or Lazarus(Win64) I’m looking for a way to determine if a dll is compiled as x64 or x86?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:45:31+00:00Added an answer on May 14, 2026 at 3:45 pm

    You should read and parse PE header.

    Like this:

    function Isx64(const Strm: TStream): Boolean;
    const
      IMAGE_FILE_MACHINE_I386     = $014c; // Intel x86
      IMAGE_FILE_MACHINE_IA64     = $0200; // Intel Itanium Processor Family (IPF)
      IMAGE_FILE_MACHINE_AMD64    = $8664; // x64 (AMD64 or EM64T)
      // You'll unlikely encounter the things below:
      IMAGE_FILE_MACHINE_R3000_BE = $160;  // MIPS big-endian
      IMAGE_FILE_MACHINE_R3000    = $162;  // MIPS little-endian, 0x160 big-endian
      IMAGE_FILE_MACHINE_R4000    = $166;  // MIPS little-endian
      IMAGE_FILE_MACHINE_R10000   = $168;  // MIPS little-endian
      IMAGE_FILE_MACHINE_ALPHA    = $184;  // Alpha_AXP }
      IMAGE_FILE_MACHINE_POWERPC  = $1F0;  // IBM PowerPC Little-Endian
    var
      Header: TImageDosHeader;
      ImageNtHeaders: TImageNtHeaders;
    begin
      Strm.ReadBuffer(Header, SizeOf(Header));
      if (Header.e_magic <> IMAGE_DOS_SIGNATURE) or
         (Header._lfanew = 0) then
        raise Exception.Create('Invalid executable');
      Strm.Position := Header._lfanew;
    
      Strm.ReadBuffer(ImageNtHeaders, SizeOf(ImageNtHeaders));
      if ImageNtHeaders.Signature <> IMAGE_NT_SIGNATURE then
        raise Exception.Create('Invalid executable');
    
      Result := ImageNtHeaders.FileHeader.Machine <> IMAGE_FILE_MACHINE_I386;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's the fastest way using either DOS scripting or PowerShell to run this simple
I'd like to change the way some types are displayed using either 'dt' or
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
I am trying to create a code coverage tool using Delphi 2007. My general
I am loading a .dll written in Delphi 7 using DllImport within a Windows
I don't see the point of using either http://960.gs or http://blueprintcss.org if they enforce
What advantages are there for using either XSLT or Linq to XML for HTML
What are the pros and cons of using either of the following approaches to
I can download a file from S3 using either of the following methods. s3cmd
I want to create a report, using either Crystal reports or RDLC, doesn't really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.