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

  • Home
  • SEARCH
  • 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

How can I determine if my displays are in Clone Mode without using either
Is there a way to create a Distinct query in HQL. Either by using
I wonder if there is a way to either programatically or using a third
I am trying to create a code coverage tool using Delphi 2007. My general
Is there a better more performance way to write this jQuery selector using either
Usually Flash and Flex applications are embedded on in HTML using either a combination
In .Net you can read a string value into another data type using either
Does my question make sense? Using either Vim or Emacs, you come to understand
I have a Perl script that I'd like to run on Windows, using either
I have been spoiled by either using sql server to store data, or using

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.