# AssemblyRef

The AssemblyRef table contains various information about other referenced external assemblies.

# Get referenced assemblies

AssemblyRef.get_assemblyref_names(deduplicate: bool) -> List[str]

Get a list of referenced assembly names.

Parameters:

  • deduplicate De-duplicate names.

Return value:

A list with referenced assembly names

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 "AssemblyRef" table exists
if dotnet_file.metadata_table_exists('AssemblyRef'):
    # Get referenced assemblies
    assemblyref_names = dotnet_file.AssemblyRef.get_assemblyref_names()

    # Print out the list of referenced assemblies
    for assemblyref_name in assemblyref_names:
        print(f'{assemblyref_name}')

# Get referenced cultures

AssemblyRef.get_assemblyref_cultures() -> List[str]

Get a list of referenced culture names.

Parameters:

-

Return value:

A list with referenced culture names

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 "AssemblyRef" table exists
if dotnet_file.metadata_table_exists('AssemblyRef'):
    # Get referenced cultures
    culture_names = dotnet_file.AssemblyRef.get_assemblyref_cultures()

    # Print out the list of referenced cultures
    for culture_name in culture_names:
        print(f'{culture_name}')