Skip to content
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

Fixed the meta_path used for the darwin platform to add the 64-bit variation of the shared object filename #150

Merged
merged 2 commits into from Dec 14, 2021

Conversation

arizvisa
Copy link
Owner

@arizvisa arizvisa commented Dec 14, 2021

When the plugin initializes its base namespace, it uses Python's meta_path to add a finder that allows the user to interact with the native IDA shared object using the ctypes library. This allows one to interact with the exports that IDA's API exposes to a user in the situation that the desired functionality is not exposed by the IDAPython SWIG interface.

It was identified that the library on the "darwin" platfrom was incomplete and only included the path for the 32-bit version of IDA. This was due to an oversight by the author and was fixed by testing whether the 32-bit or 64-bit version of IDA is running and choosing the correct filename based on the detected version.

On the "darwin" platform, the 32-bit version of the library is "libida.dylib" and the 64-bit version of the library is "libida64.dylib". Similar to the way the internal is determined for the other platforms, the value for idaapi.BADADDR is checked and used to determine whether to add the "64" suffix or not. The "linux" platform was also updated to use idaapi.idadir to determine the installation directory and locate the correct native library.

This fixes issue #149.

@arizvisa arizvisa added the bug label Dec 14, 2021
@arizvisa arizvisa self-assigned this Dec 14, 2021
…he 64-bit suffix to the filename when creating the internal ctypes library.
…idaapi.idadir` when determining the location of the native api.
Copy link
Owner Author

@arizvisa arizvisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. It was only minor, anyways.

@arizvisa arizvisa merged commit 3cc6e7c into master Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant