-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
List imports #85
Conversation
mrexodia
left a comment
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.
src/ida_pro_mcp/mcp-plugin.py
Outdated
| "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.
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.
You can import (and export) symbols via ordinals on Windows. However, I'm not sure how common that is outside of malware so I removed it for now.
src/ida_pro_mcp/mcp-plugin.py
Outdated
|
|
||
| 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?
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 changed it to imported_name since it could be a function or a global object.
|
Awesome, thanks! |
Adds a paginated
list_imports.Returns data that looks like this:
{ "data": [ { "module": ".dynsym", "import": "sprintf@@GLIBC_2.0", "address": "0x804e580", "ordinal": "0x0" }, { "module": ".dynsym", "import": "err@@GLIBC_2.0", "address": "0x804e584", "ordinal": "0x0" }, { "module": ".dynsym", "import": "signal@@GLIBC_2.0", "address": "0x804e588", "ordinal": "0x0" }, { "module": ".dynsym", "import": "recv@@GLIBC_2.0", "address": "0x804e58c", "ordinal": "0x0" }, { "module": ".dynsym", "import": "calloc@@GLIBC_2.0", "address": "0x804e590", "ordinal": "0x0" }, { "module": ".dynsym", "import": "listen@@GLIBC_2.0", "address": "0x804e594", "ordinal": "0x0" }, { "module": ".dynsym", "import": "__libc_start_main@@GLIBC_2.0", "address": "0x804e598", "ordinal": "0x0" }, { "module": ".dynsym", "import": "htons@@GLIBC_2.0", "address": "0x804e59c", "ordinal": "0x0" }, { "module": ".dynsym", "import": "setegid@@GLIBC_2.0", "address": "0x804e5a0", "ordinal": "0x0" }, { "module": ".dynsym", "import": "read@@GLIBC_2.0", "address": "0x804e5a4", "ordinal": "0x0" }, { "module": ".dynsym", "import": "free@@GLIBC_2.0", "address": "0x804e5a8", "ordinal": "0x0" }, { "module": ".dynsym", "import": "accept@@GLIBC_2.0", "address": "0x804e5ac", "ordinal": "0x0" }, { "module": ".dynsym", "import": "socket@@GLIBC_2.0", "address": "0x804e5b0", "ordinal": "0x0" } ], "next_offset": null }