GaloisInc / MATE

MATE is a suite of tools for interactive program analysis with a focus on hunting for bugs in C and C++ code using Code Property Graphs.
https://galoisinc.github.io/MATE/
BSD 3-Clause "New" or "Revised" License
177 stars 12 forks source link

analyze the library or single program without main function #61

Closed flyfish101 closed 1 year ago

flyfish101 commented 1 year ago

How to analyze the library or single program without main function? "mate-cli oneshot" command doesn't work on library.

thinkmoore commented 1 year ago

Hi @flyfish101!

To analyze a library or program without a main function, you'll need to write a "harness" that contains a main function and exercises the functionality of the library you are interested in exploring, much like a test or fuzzing harness. (The analysis is "top-down", so only code reachable from the entry point will be considered.) To ensure that the code is properly analyzed, the harness program should be statically linked against the library / program.

flyfish101 commented 1 year ago

thanks!