Check if unmanaged DLL is 32-bit or 64-bit?
Refer to the specifications. Here’s a basic implementation: public static MachineType GetDllMachineType (string dllPath) { // See http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx // Offset to PE header is always at 0x3C. // The PE header starts with “PE\0\0” = 0x50 0x45 0x00 0x00, // followed by a 2-byte machine type field (see the document above for the enum). // … Read more