das-labor / panopticon

A libre cross-platform disassembler.
https://panopticon.re
GNU General Public License v3.0
1.43k stars 78 forks source link

generic function #334

Closed m4b closed 6 years ago

m4b commented 6 years ago

If you like, can merge this and you will be able to test new and old functions side by side.

Additionally, almost everything has been ported to petgraph (except World).

Note:

  1. petgraph old function version of ssa_conversion() is broken; i note this in benchmarks, and line numbers. I believe its my dominator implementation
  2. you can test new and old via panop cli, using --neo flag for new; it will even run the new rewite_to_ssa (unfortunately, does not seem to be working, as testing on libfoo.so. etc., the function is unfinished
  3. We don't have to commit to generic function; its just very easy at the moment to have it generic so can run both side by side.
  4. Re generic functions: I have a proposal/idea for this that i think is going to work beautifully, and I think we be best of both worlds, but will require petgraph across the board
  5. I believe we want petgraph across the board; as I mentioned in PR, it looks like much of the savings are actually due to switching to petgraph.
  6. some functions I added randomly, etc., don't consider Fun the final say, etc. We can remove anything you don't like, etc.

Some numbers, specifically testing the effect of porting the Program cfg to petgraph:

libc, f2d92e1 and ae19d49, 2999 functions:

function lib program lib neo func time RES memory
petgraph panopticon yes 0:07.14 499440 KB
petgraph panopticon no 0:06.00 1822716 KB
petgraph petgraph yes 0:06.13 494684 KB
petgraph petgraph no 0:04.75 1818756 KB

rust binary, ae19d49, 2843 (long) functions:

function lib program lib neo func time RES memory
petgraph petgraph yes 0:32.40 1807908 KB
petgraph petgraph no 1:06.85 6751640 KB

flanfly commented 6 years ago
  • 0:32.40 1807908 KB
  • 1:06.85 6751640 KB

Lets call it a time memory trade off 😹