Evaluator Column to show exe 32 bit or 64 bit architecture

Here's a pretty simple evaluator column script that shows a 'friendly name' for the most common platforms / architectures for binary files. Most commonly exe and dll, but a few others that also use PE and show the architecture in the 'Description' column.

image

Basically it just takes the info from the description which includes the architecture as the first part of the string, and parses that.

To use it just open Preferences > Evaluator Columns > Add. Then call it whatever you want, I have it called "Architecture".

If you want to change how it displays certain ones, or add more, it's simple enough to just add or edit the bottom section.

// Only process certain extensions. Otherwise early return/exit
// Use janky list checking strategy via InStr (Result is -1 if not found)
exts = "-exe-dll-efi-ax-acm-cpl-drv-ocx-";
if (InStr(exts, "-" + ext + "-") == -1) { return "" };

// Find the first comma in the description property, get the text before it
commaPos = InStr(desc, ",");
if (commapos < 0) { return "" };
exeType = Left(desc, commaPos);

// You can comment out this section, or certain lines, if you don't care about the friendly names
// Having more shouldn't affect performance much since the most common ones are first and returns once found
// Friendly name examples here: https://learn.microsoft.com/en-us/dotnet/api/system.reflection.portableexecutable.machine?view=net-9.0
if (exeType == "AMD64"	) 	{ return "64 bit (x64)" };
if (exeType == "I386"	) 	{ return "32 bit (x86)" };
if (exeType == "ARM64"	) 	{ return "Arm64" 		};
if (exeType == "THUMB2"	) 	{ return "ARM Thumb-2" 	};
if (exeType == "THUMB"	) 	{ return "Thumb" 		};

// If no matching friendly name just return as is
return exeType;
3 Likes