From 0f6970261fa0eeb7e6239b736fda61caa714c5e0 Mon Sep 17 00:00:00 2001 From: Herwin Bozet Date: Sat, 13 Sep 2025 23:57:59 +0200 Subject: [PATCH] Updated readme.md --- readme.md | 424 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 423 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 226780e..03e3c9e 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,10 @@ -# PB-PEArch +# PEArch A small tool that tells you which [CPU architecture](https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types) a given [Windows PE](https://learn.microsoft.com/en-us/windows/win32/debug/pe-format) is made for. +A total of 35 architectures are supported by this tool. + + ## Usage ``` PEArch.exe [/?] [/E|/AsError] [/H|/AsHex] [/F|/FullText] @@ -13,8 +16,427 @@ Options: /F, /FullText Prints a longer description of the architecture. ``` +
+ Click here to show/hide the architecture and return codes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ STDOUT + + STDOUT with /AsHex + + STDERR with /AsError + Description (Source: MSDN) +
UNKNOWN + 0x0 + + 0 + The content of this field is assumed to be applicable to any machine type
ALPHA + 0x184 + + 388 + Alpha AXP, 32-bit address space
ALPHA64 + 0x284 + + 644 + Alpha 64, 64-bit address space
AM33 + 0x1d3 + + 467 + Matsushita AM33
AMD64 + 0x8664 + + 34404 + x64
ARM + 0x1c0 + + 448 + ARM little endian
ARM64 + 0xaa64 + + 43620 + ARM64 little endian
ARM64EC + 0xA641 + + 42561 + ABI that enables interoperability between native ARM64 and emulated x64 code.
ARM64X + 0xA64E + + 42574 + Binary format that allows both native ARM64 and ARM64EC code to coexist in the same file.
ARMNT + 0x1c4 + + 452 + ARM Thumb-2 little endian
AXP64 + 0x284 + + 644 + AXP 64 (Same as Alpha 64)
EBC + 0xebc + + 3772 + EFI byte code
I386 + 0x14c + + 332 + Intel 386 or later processors and compatible processors
IA64 + 0x200 + + 512 + Intel Itanium processor family
LOONGARCH32 + 0x6232 + + 25138 + LoongArch 32-bit processor family
LOONGARCH64 + 0x6264 + + 25188 + LoongArch 64-bit processor family
M32R + 0x9041 + + 36929 + Mitsubishi M32R little endian
MIPS16 + 0x266 + + 614 + MIPS16
MIPSFPU + 0x366 + + 870 + MIPS with FPU
MIPSFPU16 + 0x466 + + 1126 + MIPS16 with FPU
POWERPC + 0x1f0 + + 496 + Power PC little endian
POWERPCFP + 0x1f1 + + 497 + Power PC with floating point support
R3000BE + 0x160 + + 352 + MIPS I compatible 32-bit big endian
R3000 + 0x162 + + 354 + MIPS I compatible 32-bit little endian
R4000 + 0x166 + + 358 + MIPS III compatible 64-bit little endian
R10000 + 0x168 + + 360 + MIPS IV compatible 64-bit little endian
RISCV32 + 0x5032 + + 20530 + RISC-V 32-bit address space
RISCV64 + 0x5064 + + 20580 + RISC-V 64-bit address space
RISCV128 + 0x5128 + + 20776 + RISC-V 128-bit address space
SH3 + 0x1a2 + + 418 + Hitachi SH3
SH3DSP + 0x1a3 + + 419 + Hitachi SH3 DSP
SH4 + 0x1a6 + + 422 + Hitachi SH4
SH5 + 0x1a8 + + 424 + Hitachi SH5
THUMB + 0x1c2 + + 450 + Thumb
WCEMIPSV2 + 0x169 + + 361 + MIPS little-endian WCE v2v2
+
+
+ + +## Output examples +**Without options:** +``` +Command: pearch "C:\Windows\explorer.exe" +> STDOUT: AMD64 +> STDERR: +> ERRORLEVEL: 0 +``` +``` +Command: pearch "C:\Windows\non-existant-file.exe" +> STDOUT: +> STDERR: Cannot open file ! +> ERRORLEVEL: 12 +``` + +**With `/AsHex` and `/AsError:** +``` +Command: pearch /AsHex "C:\Windows\explorer.exe" +> STDOUT: 8664 +> STDERR: +> ERRORLEVEL: 0 +``` +``` +Command: pearch /AsError "C:\Windows\explorer.exe" +> STDOUT: +> STDERR: +> ERRORLEVEL: 34404 +``` +``` +Command: pearch /AsError /AsHex "C:\Windows\explorer.exe" +> STDOUT: 8664 +> STDERR: +> ERRORLEVEL: 34404 +``` +``` +Command: pearch /AsError /AsHex "C:\Windows\non-existant-file.exe" +> STDOUT: +> STDERR: Cannot open file ! +> ERRORLEVEL: 0 +``` + + ## Cloning **TODO: Add instructions related to the submodule** + ## License All the code in this repo is released in the [Public Domain](LICENSE).