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 1071355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:42:17+00:00 2026-05-16T20:42:17+00:00

How can I determine the machine on which a given DLL can run. There

  • 0

How can I determine the machine on which a given DLL can run. There are many platforms ARM, SH4, x64, x32. When I have no other information than the DLL itself how to do that?

Background: There is a set off DLLs and some of them are not appropriate. How to detect them “offline”?


SOLUTION

Thanks for the help: the solution I use is the perl script

#!/usr/bin/perl 
# 
# usage: DllVer <exefile> 
# 
use strict;
use warnings;
use diagnostics;

my $exe = $ARGV[0]; 
my $doshdr; my $pehdr;
my %machines = (
    0x014c => "I386",
    0x0162 => "R3000",
    0x0166 => "R4000",
    0x0168 => "R10000",
    0x0169 => "WCEMIPSV2",
    0x0184 => "ALPHA",
    0x01a2 => "SH3",
    0x01a3 => "SH3DSP",
    0x01a4 => "SH3E",
    0x01a6 => "SH4",
    0x01c0 => "ARM",
    0x01c2 => "THUMB",
    0x01d3 => "AM33",
    0x01f0 => "POWERPC",
    0x01f1 => "POWERPCFP",
    0x0200 => "IA64",
    0x0266 => "MIPS16",
    0x0284 => "ALPHA64",
    0x0366 => "MIPSFPU",
    0x0466 => "MIPSFPU16",
    0x0520 => "TRICORE",
    0x8664 => "AMD64",
    0x9041 => "M32R",
    );

open(EXE, $exe) or die "can't open $exe: $!"; 
binmode(EXE); 
if (read(EXE, $doshdr, 68)) { 

   my ($magic,$skip,$offset)=unpack('a2a58l', $doshdr); 
   die("Not an executable") if ($magic ne 'MZ'); 

   seek(EXE, $offset, 0); 
   if (read(EXE, $pehdr, 6)){ 
       my ($sig,$skip,$machine)=unpack('a2a2v', $pehdr); 
       die("No a PE Executable") if ($sig ne 'PE'); 

       if (exists $machines{$machine}) {
           print $machines{$machine} . "\n";
       } 
       else{ 
            printf("Unknown machine type 0x%lx\n", $machine); 
       } 
   } 
} 

close(EXE); 
  • 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-16T20:42:17+00:00Added an answer on May 16, 2026 at 8:42 pm

    Try this perl script:

    #!/usr/bin/perl 
    # 
    # usage: DllVer <exefile> 
    # 
    $exe = $ARGV[0]; 
    
    open(EXE, $exe) or die "can't open $exe: $!"; 
    binmode(EXE); 
    if (read(EXE, $doshdr, 68)) { 
    
       ($magic,$skip,$offset)=unpack('a2a58l', $doshdr); 
       die("Not an executable") if ($magic ne 'MZ'); 
    
       seek(EXE,$offset,SEEK_SET); 
       if (read(EXE, $pehdr, 6)){ 
           ($sig,$skip,$machine)=unpack('a2a2v', $pehdr); 
           die("No a PE Executable") if ($sig ne 'PE'); 
    
           if ($machine == 0x014c){ 
                print "i386\n"; 
           } 
           elsif ($machine == 0x0200){ 
                print "IA64\n"; 
           } 
           elsif ($machine == 0x8664){ 
                print "AMD64\n"; 
           } 
           else{ 
                printf("Unknown machine type 0x%lx\n", $machine); 
           } 
       } 
    } 
    
    close(EXE); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started a GlassFish server on my machine. How can I determine which
How can I determine programmatically whether my machine is an x86, x64 or an
How can I determine if I have write permission on a remote machine in
How can one determine which sql server instances are installed on the local machine
Given the key for some registry value (e.g. HKEY_LOCAL_MACHINE\blah\blah\blah\foo) how can I: Safely determine
Is there a way my program can determine when it's running on a Remote
There are several options for C#-based programs to determine which .Net version is installed.
In C, there's the sizeof operator to determine the byte-size of a given data
Suppose my Macintosh machine has dual monitors how can I accurately determine the monitor
Does ClickOnce only look at the application manifest file to determine which dll files

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.