#
Assembly
The Assembly
table contains various information about the assembly. An assembly is a module that contains a manifest in the metadata.
#
Get assembly name
Assembly.get_assembly_name() -> str
Get the assembly name.
Parameters:
-
Return value:
Assembly name
Example:
# Import class DotNetPE from module dotnetfile
from dotnetfile import DotNetPE
# Create an instance of DotNetPE with the file path as a parameter
dotnet_file = DotNetPE('/Users/<username>/my_dotnet_assembly.exe')
# Check if the "Assembly" table exists
if dotnet_file.metadata_table_exists('Assembly'):
# Print out the assembly name
print(f'Assembly name: {dotnet_file.Assembly.get_assembly_name()}')
#
Get assembly culture
Assembly.get_assembly_culture() -> str
Get the assembly culture.
Parameters:
-
Return value:
Culture name
Example:
# Import class DotNetPE from module dotnetfile
from dotnetfile import DotNetPE
# Create an instance of DotNetPE with the file path as a parameter
dotnet_file = DotNetPE('/Users/<username>/my_dotnet_assembly.exe')
# Check if the "Assembly" table exists
if dotnet_file.metadata_table_exists('Assembly'):
# Print out the assembly culture
print(f'Assembly culture: {dotnet_file.Assembly.get_assembly_culture()}')
#
Get assembly version information
Assembly.get_assembly_version_information() -> Optional[Struct.AssemblyInfo]
Get the assembly version information.
Parameters:
-
Return value:
The result is a AssemblyInfo
dataclass object with the following values or None
:
- MajorVersion int Major version number
- MinorVersion int Minor version number
- BuildNumber int Build number
- RevisionNumber int Revision number
Example:
# Import class DotNetPE from module dotnetfile
from dotnetfile import DotNetPE
# Create an instance of DotNetPE with the file path as a parameter
dotnet_file = DotNetPE('/Users/<username>/my_dotnet_assembly.exe')
# Check if the "Assembly" table exists
if dotnet_file.metadata_table_exists('Assembly'):
# Get assembly version information
assembly_version_info = dotnet_file.Assembly.get_assembly_version_information()
# Print out version information
print(f'Version information: {assembly_version_info.BuildNumber}.{assembly_version_info.MajorVersion}.'
f'{assembly_version_info.MinorVersion}.{assembly_version_info.RevisionNumber}')