Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

Check if an Assembly Is 64 Bit

Determines whether the specified .NET assembly is compiled for a 64-bit platform.

This function uses the GetPEKind method to inspect the assembly’s PE header and determine the platform target. It returns False if the analysis fails or if the assembly is not 64-bit.

VB
    Function IsAssembly64Bit(assembly As Assembly) As Boolean
        Try
            Dim peKind As PortableExecutableKinds
            Dim machine As ImageFileMachine

            ' Get the platform type
            assembly.ManifestModule.GetPEKind(peKind, machine)

            ' Check if it's x64
            Return (peKind And PortableExecutableKinds.PE32Plus) <> 0 AndAlso
                   (machine = ImageFileMachine.AMD64 OrElse machine = ImageFileMachine.IA64)
        Catch ex As Exception
            Console.WriteLine("Error during assembly analisys: " & ex.Message)
            Return False
        End Try

    End Function

Posted by ipercube


© 2026 Ipercube Design