joxeankoret / pigaios

A tool for matching and diffing source codes directly against binaries.
GNU General Public License v3.0
634 stars 67 forks source link

Add Python 3 support to srcbindiff.py #29

Closed thestr4ng3r closed 3 years ago

thestr4ng3r commented 5 years ago

I used the zlib example from the readme to compare the following scenarios: Before these changes with Python 2, after these changes with Python 2 and after these changes with Python 3. Both Python 2 cases gave the exact same sqlite database. Python 3 was different, but there seem to be only differences in how ids are assigned, as well as the order of elements in JSON, which is probably because of changes in the implementations of set and dict.

The only changes I am not 100% sure about yet are these two: https://github.com/joxeankoret/pigaios/pull/29/files#diff-896ceb413e77f27a034b3e24c53ab2c2R389 https://github.com/joxeankoret/pigaios/pull/29/files#diff-02b63b7451c485af3b9682e4c0059d6cR105 Why are you opening these files in binary mode? Both the source and the project file are text files, so this doesn't make much sense to me. In Python 3 this makes a difference because of str vs. bytes.

joxeankoret commented 5 years ago

Thanks! I will review and test it.

XVilka commented 4 years ago

Isn't it a good time for that change?

joxeankoret commented 4 years ago

I'm working on the port, actually. But it happens to be much more complex than this.

thestr4ng3r commented 4 years ago

Of course it is more complex, this here is only for srcbindiff.py