WhatArch 0.1.9

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global WhatArch --version 0.1.9
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local WhatArch --version 0.1.9
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=WhatArch&version=0.1.9
                    
nuke :add-package WhatArch --version 0.1.9
                    

<p align="center"> <img src="https://raw.githubusercontent.com/craigktreasure/WhatArch/main/assets/icon.png" alt="WhatArch logo" width="128" height="128"> </p>

<h1 align="center">WhatArch</h1>

<p align="center"> A <a href="https://docs.microsoft.com/dotnet/core/tools/global-tools">.NET tool</a> for Windows that detects the target architecture of native binaries and .NET assemblies. </p>

<p align="center"> <a href="https://github.com/craigktreasure/WhatArch/actions/workflows/CI.yml"><img src="https://github.com/craigktreasure/WhatArch/actions/workflows/CI.yml/badge.svg?branch=main" alt="CI"></a> <a href="https://codecov.io/gh/craigktreasure/WhatArch"><img src="https://codecov.io/gh/craigktreasure/WhatArch/branch/main/graph/badge.svg?token=OmUMjUGQb8" alt="codecov"></a> <a href="https://www.nuget.org/packages/WhatArch/"><img src="https://img.shields.io/nuget/v/WhatArch" alt="NuGet"></a> <a href="https://www.nuget.org/packages/WhatArch/"><img src="https://img.shields.io/nuget/dt/WhatArch" alt="NuGet Downloads"></a> </p>

Features

  • Detects native binary architectures: x86, x64, ARM64, ARM
  • Identifies .NET assembly configurations: AnyCPU (.NET), AnyCPU (.NET - 32-bit preferred), x86 (.NET), x64 (.NET), ARM64 (.NET)
  • Simple, script-friendly output
  • No external dependencies - parses PE headers directly

Requirements

  • Windows (PE files are Windows-specific)
  • .NET 10 SDK

Installation

dotnet tool install --global WhatArch

Update the tool

dotnet tool update --global WhatArch

Usage

whatarch <path-to-binary>

Examples

# Native binaries
whatarch C:\Windows\System32\kernel32.dll
> x64

whatarch C:\Windows\SysWOW64\kernel32.dll
> x86

# .NET assemblies
whatarch MyApp.dll
> AnyCPU (.NET)

whatarch MyApp.x64.dll
> x64 (.NET)

Exit Codes

Code Meaning
0 Success
1 Error (file not found, invalid PE, etc.)

How It Works

WhatArch reads the PE (Portable Executable) file headers to determine the target architecture. For .NET assemblies, it also examines the CLR header and CorFlags to distinguish between AnyCPU and platform-specific builds.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.1.19 117 1/17/2026
0.1.17 105 1/13/2026
0.1.14 107 12/31/2025
0.1.11 100 12/30/2025
0.1.9 101 12/30/2025
0.1.8 99 12/29/2025
0.1.5 105 12/29/2025