I am attempting to convert Python to Cython to run my pyinstaller executable to speed up the job and for obfuscation purposes. I have noticed however, that when I do this, it can be easily decompiled, the C files do not seem to be loaded correctly. Here’s the steps I have undertaken. I am doing so on windows.
HA.Py to Pyx with:
driver = webdriver.Chrome(chrome_options = options)
driver.get('https://google.com')
driver.close()
I then Convert to pyx (rename Py -> Pyx)
Set up.py
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("HA.pyx")
)
python setup.py build_ext –inplace (pyd, I got a so file in Unix)
C:\Python31\python.exe C:\Python31\Scripts\cython.py smalltest1.py --embed
CMD:
python setup.py develop
pyinstaller -r file_a.so,dll,file_a.so -r file_b.so,dll,file_b.so -F /C:/ANDAR
In the folder it contains the pyx, as well as the setup file.
It seems that when I compile this, it tends not to run or if I put the python file, it runs with python only and can be easily decompiled. I have tried creating a c file from Python though this did not seem to work through visual Studios.
If you can get it working, you're a legend. I've tried just about every variation under the sun with lots of error messages. There doesn't seem to be a lot of documentation out there and lots of questions in relation to cython go unanswered.
I think most people with Python just accept that obfuscating your code with cython is hard as heck..
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
C:\Python31\python.exe C:\Python31\Scripts\cython.py smalltest1.py --embed
Chris Barker schrieb am 17.11.2017 um 19:02:
> Cython is not an obfuscation tool -- that is correct. use ust like it was
> intended, and it will work, and you'll get (a tiny bit of) obfuscation out
> of the deal.
I still think it would be helpful to simplify the general use case of
compiling a whole application.
Nuitka is reportedly quite good at that, so
there is no reason why Cython shouldn't be. As much as I agree that "just
compile the whole thing" is usually the wrong approach and suggests that
"your problem is probably elsewhere", I don't think it helps anyone to keep
this use case difficult for people.