-
-
Notifications
You must be signed in to change notification settings - Fork 243
List imports #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
List imports #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, I added some review comments to be addressed.
@@ -658,6 +658,44 @@ def list_globals( | |||
"""List all globals in the database (paginated)""" | |||
return list_globals_filter(offset, count, "") | |||
|
|||
class Import(TypedDict): | |||
address: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TypedDict
does not match the returned data.
"module": module_name, | ||
"import": symbol_name, | ||
"address": f"{ea:#x}", | ||
"ordinal": f"#{ordinal}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the ordinal provide any kind of value? As far as I know this is just what IDA uses as an index to identify that specific import.
acc += [{ | ||
"module": module_name, | ||
"import": symbol_name, | ||
"address": f"{ea:#x}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use hex(ea)
to match the rest of the codebase
|
||
def imp_cb(ea, symbol_name, ordinal, acc): | ||
if not symbol_name: | ||
symbol_name = "<unnamed>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what circumstances does this happen? Perhaps this is where we should return symbol_name = f"#{ordinal}"
in this case?
|
||
acc += [{ | ||
"module": module_name, | ||
"import": symbol_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer calling this name
or function
, or did you observe calling it import
improve LLM performance in some way?
Adds a paginated
list_imports
.Returns data that looks like this: