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

Loading static library for analysis #45

Closed
riyadparvez opened this issue Nov 26, 2015 · 5 comments
Closed

Loading static library for analysis #45

riyadparvez opened this issue Nov 26, 2015 · 5 comments

Comments

@riyadparvez
Copy link

The cle loader fails to load linux static libraries. This is just a feature request for adding support for loading static library. I will appreciate it.

@rhelmot
Copy link
Member

rhelmot commented Nov 26, 2015

Can you provide an example of a static library? All the libraries on my system are dynamically linked.

@riyadparvez
Copy link
Author

Static library is basically an archive of one or more *.o object files, can be built by ar command. For example you want to use lightweight libc like musl, but do not want to force user to install musl on their system, you can just static link musl into your application. Here is a good tutorial on how to create static libraries on linux: http://www.cs.dartmouth.edu/~campbell/cs50/buildlib.html.

@rhelmot
Copy link
Member

rhelmot commented Nov 26, 2015

Alright. What mechanism would you like to have available to resolve import symbols? Static libraries provide no indication of their dependencies (though it's usually just libc), as far as I can tell.

@riyadparvez
Copy link
Author

That is a good question. I haven't thought about that actually, is there any better way than just to leave imported symbols unresolved?

@rhelmot
Copy link
Member

rhelmot commented Nov 27, 2015

The way it's done in code concretely is that the dependencies must be resolved manually by specifying -lname in the compiler flags. -lc is implicit, of course, but everything else is manual. So in the loader options you'll have to somehow specify the libraries that need to be loaded. Pretty sure that if you just specify the libraries in force_load_libs their exports should get picked up automatically.

I'll do this at some point! I've got a lot of classwork to get through, but this can absolutely happen.

sraboy pushed a commit to sraboy/angr that referenced this issue Aug 2, 2017
Fixed a debug message typo in strchr SimProcedure
Icegrave0391 pushed a commit to Icegrave0391/angr that referenced this issue Dec 16, 2021
* Added a fix script for macOS dylib patching

* Updated Readme
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

No branches or pull requests

3 participants