hasherezade / pe-sieve

Scans a given process. Recognizes and dumps a variety of potentially malicious implants (replaced/injected PEs, shellcodes, hooks, in-memory patches).
https://hshrzd.wordpress.com/pe-sieve/
BSD 2-Clause "Simplified" License
3.01k stars 421 forks source link

Add options for building a static library and linking statically #60

Closed secDre4mer closed 4 years ago

secDre4mer commented 4 years ago

This pull request:

One issue with the current implementation is that anyone linking against the static library needs to define PESIEVE_STATIC_LIB. One option to avoid this might be to export a pkgconfig file or something similar in the future which automatically sets this.

hasherezade commented 4 years ago

Thank you for your contribution! Few remarks: 1) the option -static will fail to compile in Visual Studio. So it can be used only if the compiler is GNU. I reworked it a bit: https://github.com/hasherezade/pe-sieve/commit/7c85aebad0682ddc9b4b657eda9a00f9242f637c 2) in order to let the PE-sieve be used as a static library, I need to wrap everything in the namespace. which is ok, I will do it. but I will prefer to have it done before merging to the master.

secDre4mer commented 4 years ago

Thanks for the rework! Regarding your 2nd remark: Are you also referring to the "entry methods", PESieve_***? Or only to any helper methods which aren't wrapped yet?

Also, thanks for offering to implement the namespace wrapping. If there's anything I can do to help, please just let me know.

hasherezade commented 4 years ago

@secDre4mer - I mean "any helper methods which aren't wrapped yet". thanks for offering your help, but no worries, I will do it soon.

hasherezade commented 4 years ago

ok, I decided I will merge it first and then rework it. this will be easier.

secDre4mer commented 4 years ago

I've seen that you finished the rework (and fixed a number of issues I hadn't thought of). Again, thanks a lot for your help in getting this merged!

hasherezade commented 4 years ago

You are welcome! Thank you for bringing it up!