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

Support Python3? #521

Closed
bananaappletw opened this issue Apr 24, 2017 · 13 comments
Closed

Support Python3? #521

bananaappletw opened this issue Apr 24, 2017 · 13 comments

Comments

@bananaappletw
Copy link
Contributor

Triton is awesome project.
Thanks for the great work!!!

Is there any plan to support python3?
If that, maybe I could also help.
Thanks.

@JonathanSalwan
Copy link
Owner

JonathanSalwan commented Apr 24, 2017

I never tried but maybe it is already supported? Did you tried?

@bananaappletw
Copy link
Contributor Author

@JonathanSalwan
Code seems like hard-coded python version as 2.7.
Not providing way to customize python version
https://github.com/JonathanSalwan/Triton/blob/master/CMakeLists.txt#L115
https://github.com/JonathanSalwan/Triton/blob/master/src/libtriton/CMakeLists.txt#L282
Or something am I missing?
If I was wrong, correct me.
Thank you.

@JonathanSalwan
Copy link
Owner

Yeah it's hardcoded but if you remplace them does it work?

@JonathanSalwan
Copy link
Owner

If it works we can easily add an option to the compile process.

@bananaappletw
Copy link
Contributor Author

bananaappletw commented Apr 24, 2017

@JonathanSalwan
Seems not.
I change 2.7 to 3.5.
There are another places of code need to be modified.
capture

@JonathanSalwan
Copy link
Owner

JonathanSalwan commented Apr 24, 2017

=(. Well, if you manage to figure out these issues, I will be happy to accept your pull request :)

@bananaappletw
Copy link
Contributor Author

@JonathanSalwan
Ok, I will try!
Thank you for kind reply.

@JonathanSalwan
Copy link
Owner

Ok, I will try!

Woot, thanks. Go ahead from the dev-next branch.

@bananaappletw
Copy link
Contributor Author

https://docs.python.org/3/howto/cporting.html
Seems like python3 binding for c++ is completely different compared to python2.
It needs some work to do that.

@bananaappletw
Copy link
Contributor Author

Quote from https://docs.python.org/2/c-api/intro.html

Note Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any standard headers are included.

The python binding codes should put #include <Python.h> before other headers

@lclc19
Copy link

lclc19 commented Feb 8, 2019

@JonathanSalwan It seems Python3 is a must for Windows is you want to use Tigress_protection, because the dependent Arybo cannot compile under Python 2.7 in Windows:

with the exception of Python 2 not available under Windows
https://pythonhosted.org/arybo/setup.html

Steps to reproduce in Windows:

  1. Build Triton in Python2.7
  2. In Tigress_protection run
    python ./solve-vm.py ./obfuscated_binaries/_binary_
    shows missing arybo.tools.triton_
  3. pip install arybo shows error compling pytanque:
    building 'pytanque' extension ... include\pa/exprs.h(30) : fatal error C1083: Cannot open include file: 'cstdint': No such file or directory

How can I bypass pytanque compilation in python2.7?
Thanks.

@JonathanSalwan
Copy link
Owner

You should open an issue on https://github.com/quarkslab/arybo

@JonathanSalwan JonathanSalwan modified the milestones: v0.x, v0.7 Feb 27, 2019
@JonathanSalwan
Copy link
Owner

Merged into dev-v0.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants