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

Move Lib already loaded check before dlopen Call #15075

Merged
merged 1 commit into from
Sep 19, 2019
Merged

Conversation

thestr4ng3r
Copy link
Contributor

for rizinorg/rz-ghidra#38

This prevents constructors, for example doing C++ static initialization, from being executed twice.

@radare
Copy link
Collaborator

radare commented Sep 19, 2019 via email

@thestr4ng3r
Copy link
Contributor Author

Checksums break again if you have a slightly different version of the same plugin. One good way would be to add a unique id string per plugin to RLibStruct and check that after loading the lib and before registering the plugin. But we still need to make sure not to call any constructors before we haven't checked the duplication. I don't know enough about dynamic loading to say if this is possible on all platforms.

@radare
Copy link
Collaborator

radare commented Sep 19, 2019

yes, thats what we must check.. but if c++/objc crap run things when you do dlopen.. not sure how can we handle this in the right way without using RBin instead

@radare radare merged commit 0b9edb4 into master Sep 19, 2019
@radare
Copy link
Collaborator

radare commented Sep 19, 2019

lets merge for now, most people delete all the plugins after every r2 update, as well as most people put them all in the same place. so it shouldnt be a problem

@thestr4ng3r
Copy link
Contributor Author

Yes, this patch only makes the situation better. Actually even after it there is a special case when you have a duplicate plugin and the one that is loaded first triggers the Module version mismatch /home/florian/bin/prefix/radare2/lib/radare2/core_ghidra.so (3.8.0) vs (4.0.0-git), then it still breaks. I have to investigate whether this is fixable somehow.

@thestr4ng3r thestr4ng3r deleted the check-already-loaded branch September 19, 2019 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants