Skip to content

Create (Save) Database To ProjectFile Handle #7848

@utkonos

Description

@utkonos

What is the feature you'd like to have?
A single step from a new analysis to saving it to a database in a project. At the moment, to get a database into a project, it needs to be saved somewhere else first and then imported into the project using Project.create_file_from_path(). There should be a way to take an empty project file handle and pass it to bv.create_database. And/Or Project.create_file should be able to accept a bv? Or the appropriate handle that lets a ProjectFile be created directly from a new analysis.

Is your feature request related to a problem?
The current two step process seems inefficient and not straightforward.

Are any alternative solutions acceptable?

for pf in tqdm.notebook.tqdm(to_do):
    with tempfile.TemporaryDirectory() as td:
        bv = binaryninja.load(pf)
        bv.update_analysis_and_wait()
        tdp = pathlib.Path(td)
        dest = tdp.joinpath(f'{pf.name}.bndb')
        bv.create_database(dest)
        bv.file.close()
        p.create_file_from_path(dest, f, dest.name)

to_do here contains a list of ProjectFile handles to raw files in the project.

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