Vector35 / Vector35/binaryninja-api

How to get the file path and file name from file metadata

Open
#7,958 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Core Effort: Low Impact: Low
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

I am writing a script, I want to know the file path (if available) and the file name. I understand that the file path is something that could be sensitive, and the BNDB may have removed it. What I want is to know, the two apis that I should be calling. Currently it seems we have four apis:

>>> bv.file.display_name
'/Users/emesare/Downloads/iterators.exe'
>>> bv.file.filename
'/Users/emesare/Downloads/iterators.exe'
>>> bv.file.original_filename
'/Users/emesare/Downloads/iterators.exe'
>>> bv.file.virtual_path
'/Users/emesare/Downloads/iterators.exe'

Its interesting to me that none of these apis are named to "get me the file path", a more straightforward approach would be to have a file_path and a file_name, I'm sure the "answer" will be that these are historical, but I'm more interested in what we are doing to simplify an API that really should not be that difficult to grok. All in all, these APIs seem extremely overloaded, and we should try and identify all usages of them in the product to determine what exactly each callers expectations are and refactor accordingly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the four named entry points—bv.file.display_name, filename, original_filename, and virtual_path—and trace their usages across the product. Done means the distinct path and filename expectations are identified and a clear, agreed API simplification is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.