mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
convert str(path) usage to path.as_posix() to get str format of Path
Update fixtures.py
This commit is contained in:
@@ -51,13 +51,13 @@ def load_analysis(bv):
|
||||
binaryninja.log_info(f"dirname: {dirname}\nshortname: {shortname}\n")
|
||||
js_path = path = dirname / (shortname + ".js")
|
||||
json_path = dirname / (shortname + ".json")
|
||||
if os.access(str(js_path), os.R_OK):
|
||||
if os.access(js_path.as_posix(), os.R_OK):
|
||||
path = js_path
|
||||
elif os.access(str(json_path), os.R_OK):
|
||||
elif os.access(json_path.as_posix(), os.R_OK):
|
||||
path = json_path
|
||||
else:
|
||||
path = binaryninja.interaction.get_open_filename_input("capa report:", "JSON (*.js *.json);;All Files (*)")
|
||||
if not path or not os.access(str(path), os.R_OK):
|
||||
if not path or not os.access(path.as_posix(), os.R_OK):
|
||||
binaryninja.log_error("Invalid filename.")
|
||||
return 0
|
||||
binaryninja.log_info(f"Using capa file {path}")
|
||||
|
||||
Reference in New Issue
Block a user