Skip to content

BN_DISABLE_REPOSITORY_PLUGINS env var prevents BinaryView loading (dev branch) #8108

@melomac

Description

@melomac

I have been using the BN_DISABLE_REPOSITORY_PLUGINS environment variable to improve scripts loading time, making them almost as fast as in a containerized environment.

This helped me noticing a regression (stable channel isn't impacted) in current Binary Ninja dev build: when BN_DISABLE_REPOSITORY_PLUGINS environment variable is enabled, Binary Ninja won't be able to load ELF or Mach-O views.

I am able to reproduce the problem in a Linux container or a virtual environment on macOS:

$ cat /tmp/test.py
#!/usr/bin/env -S BN_DISABLE_REPOSITORY_PLUGINS=1 python3

from binaryninja import *
bv = load("/bin/ls")
print(f"BinaryView type: {bv.view_type}")
print(f"BinaryView version: {core_version()}")

$ /tmp/test.py
[0:0 Default error] Mapped view could not be created! Failed to get platform x86 by name
[0:0 Default error] SettingsCache failed to get a cached setting for 'core.module.loadDebugInfo'
[0:0 Default error] SettingsCache failed to get a cached setting for 'core.module.configureExtendedAnalysis'
[0:0 Default error] SettingsCache failed to get a cached setting for 'core.module.initialPointerAnalysis'
[0:0 Default error] SettingsCache failed to get a cached setting for 'core.module.stringsAnalysis'
[0:0 Default error] SettingsCache failed to get a cached setting for 'core.module.stringsAnalysis'
BinaryView type: Mapped
BinaryView version: 5.4.9488-dev

BinaryView loads the expected type without the BN_DISABLE_REPOSITORY_PLUGINS environment variable:

$ cat /tmp/test.py
#!/usr/bin/env python3

from binaryninja import *
bv = load("/bin/ls")
print(f"BinaryView type: {bv.view_type}")
print(f"BinaryView version: {core_version()}")

$ /tmp/test.py
BinaryView type: ELF
BinaryView version: 5.4.9488-dev

This is a regression from current stable channel:

$ cat /tmp/test.py
#!/usr/bin/env -S BN_DISABLE_REPOSITORY_PLUGINS=1 python3

from binaryninja import *
bv = load("/bin/ls")
print(f"BinaryView type: {bv.view_type}")
print(f"BinaryView version: {core_version()}")

$ /tmp/test.py
BinaryView type: ELF
BinaryView version: 5.3.9434

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions