Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Alessandro Minghelli
Hi

In my office I developed a little utility and I compiling this with PyInstaller. 
It's not very important someone copy this (there isn't commercial value), but is very important none can decompiling the source.

First question is: Is there a way to decompiling an executable made with PyInstaller to obtain the source code? 

Second question is in the subject. PyInstaller is compatible with BS4 and Request libraries?

Thanks 




--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/32b53b3c-7760-42e9-9b2b-cbf5919e165d%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Hartmut Goebel
Am 28.05.20 um 10:45 schrieb Alessandro Minghelli:

It's not very important someone copy this (there isn't commercial value), but is very important none can decompiling the source.

First question is: Is there a way to decompiling an executable made with PyInstaller to obtain the source code?

Yes, his is possible.

There is a feature for encrypting the source, but this is currently broken. Please consider funding the fix: http://www.pyinstaller.org/funding.html


--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: https://www.goe-con.de/blog/chatsecure-ist-tot-lang-lebe-chatsecure
Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2011-11-in-troja-nichts-neues

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/e6b69691-123b-3980-3676-02d4900fd6b8%40goebel-consult.de.

0x7B752811BF773B65.asc (21K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Brendan Simon (gmail)
On 28/5/20 7:37 pm, Hartmut Goebel wrote:
Am 28.05.20 um 10:45 schrieb Alessandro Minghelli:

It's not very important someone copy this (there isn't commercial value), but is very important none can decompiling the source.

First question is: Is there a way to decompiling an executable made with PyInstaller to obtain the source code?

Yes, his is possible.

There is a feature for encrypting the source, but this is currently broken. Please consider funding the fix: http://www.pyinstaller.org/funding.html


I've used Cython, before PyInstaller packaging step, to "compile" your python modules to "executable" code (.so/.dylib files).  It's a step harder to decompile it to useful python code, but I suspect it's not impossible.  And the upside is you will get some performance improvement too (if that is important at all).

Brendan.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/6a648b10-0f9d-ef2c-b1ec-8875370144fe%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

墨焓
In reply to this post by Alessandro Minghelli
I'm not sure about the compatibility issue, but I guess it should be fine.

As for the decompiling thing, yes, it's easy to decompile. The tool called "pyinstxtractor" shipped with pyinstaller is designed to unpack the built binary. After that, all individual files can be found, by default they are just python bytecode ".pyc" files, while python-bytecode-to-sourcecode-converter can be found everywhere on internet. So basically you can get everything back including docstrings and comments. However if they are not ".pyc" bytecode files, but pre-built binary library files like ".so" or ".pyd", the the reverse-engineering job would be very very tough, even nearly impossible.


Alessandro Minghelli <[hidden email]> 于 2020年5月28日周四 17:32写道:
Hi

In my office I developed a little utility and I compiling this with PyInstaller. 
It's not very important someone copy this (there isn't commercial value), but is very important none can decompiling the source.

First question is: Is there a way to decompiling an executable made with PyInstaller to obtain the source code? 

Second question is in the subject. PyInstaller is compatible with BS4 and Request libraries?

Thanks 




--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/32b53b3c-7760-42e9-9b2b-cbf5919e165d%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CALc1kgWHHxMM35KD9S4XqNeKDy-6w7ce22A-nfX%2BWvZzWa5R8A%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Hartmut Goebel
Am 29.05.20 um 08:42 schrieb 墨焓:
The tool called "pyinstxtractor" shipped with pyinstaller

This tool is not shipped with PyInstaller. If your PyInstaller archive contains this tool, you you have an faulty archive.

So basically you can get everything back including docstrings and comments.
This is wrong, you can not get back comments from a .pyc file. (Trust me, I'm offered a python-bytecode-to-sourcecode service for many years.)

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: https://www.goe-con.de/blog/eilt-petition-auf-weact-gegen-vds-jetzt-unterschreiben
Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2012-01-in-die-cloud-in-die-cloud-aber-wo-soll-die-sein

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/0b91fa16-4969-928f-7602-e494861eda74%40goebel-consult.de.

0x7B752811BF773B65.asc (21K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

墨焓
Then it must be my incorrect memory. The pyinstxtractor should be from internet too, and the comments are not in bytecode, while the real code including docstrings are.

I will cythonize the source file which I'd like to protect, which could pretty much stop the decompiling (to source), but all the libraries packed inside by pyinstaller are still accessible by anyone.

Hartmut Goebel <[hidden email]> 于 2020年5月29日周五 22:29写道:
Am 29.05.20 um 08:42 schrieb 墨焓:
The tool called "pyinstxtractor" shipped with pyinstaller

This tool is not shipped with PyInstaller. If your PyInstaller archive contains this tool, you you have an faulty archive.

So basically you can get everything back including docstrings and comments.
This is wrong, you can not get back comments from a .pyc file. (Trust me, I'm offered a python-bytecode-to-sourcecode service for many years.)

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: https://www.goe-con.de/blog/eilt-petition-auf-weact-gegen-vds-jetzt-unterschreiben
Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2012-01-in-die-cloud-in-die-cloud-aber-wo-soll-die-sein

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/0b91fa16-4969-928f-7602-e494861eda74%40goebel-consult.de.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CALc1kgX0d_iNn9e8G_agW0uitXai8GaPaXSG8zX5bUrK3-1Hhw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Alessandro Minghelli
In reply to this post by 墨焓
Thanks for your answer.

Just another question. 
There's a way so in the exe the file will be .so or .pyd?
Otherwise need I make some pre elaboration before I make the exe file?

Alex

Il giorno venerdì 29 maggio 2020 10:23:38 UTC+2, 墨焓 ha scritto:
I'm not sure about the compatibility issue, but I guess it should be fine.

As for the decompiling thing, yes, it's easy to decompile. The tool called "pyinstxtractor" shipped with pyinstaller is designed to unpack the built binary. After that, all individual files can be found, by default they are just python bytecode ".pyc" files, while python-bytecode-to-sourcecode-converter can be found everywhere on internet. So basically you can get everything back including docstrings and comments. However if they are not ".pyc" bytecode files, but pre-built binary library files like ".so" or ".pyd", the the reverse-engineering job would be very very tough, even nearly impossible.


Alessandro Minghelli <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wtbKqy0uAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">alessandr...@gmail.com> 于 2020年5月28日周四 17:32写道:
Hi

In my office I developed a little utility and I compiling this with PyInstaller. 
It's not very important someone copy this (there isn't commercial value), but is very important none can decompiling the source.

First question is: Is there a way to decompiling an executable made with PyInstaller to obtain the source code? 

Second question is in the subject. PyInstaller is compatible with BS4 and Request libraries?

Thanks 




--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="wtbKqy0uAgAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">pyins...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/pyinstaller/32b53b3c-7760-42e9-9b2b-cbf5919e165d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/pyinstaller/32b53b3c-7760-42e9-9b2b-cbf5919e165d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/pyinstaller/32b53b3c-7760-42e9-9b2b-cbf5919e165d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/pyinstaller/32b53b3c-7760-42e9-9b2b-cbf5919e165d%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/3c254997-9dfd-446e-be00-074e7a1c0038%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Alessandro Minghelli
In reply to this post by Hartmut Goebel
Thanks for your answer. 




 

Il giorno venerdì 29 maggio 2020 16:29:28 UTC+2, Hartmut Goebel ha scritto:
Am 29.05.20 um 08:42 schrieb 墨焓:
The tool called "pyinstxtractor" shipped with pyinstaller

This tool is not shipped with PyInstaller. If your PyInstaller archive contains this tool, you you have an faulty archive.

So basically you can get everything back including docstrings and comments.
This is wrong, you can not get back comments from a .pyc file. (Trust me, I'm offered a python-bytecode-to-sourcecode service for many years.)

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
<a style="color:black" href="http://www.goebel-consult.de" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.goebel-consult.de\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHs4zUB0fQIL_Yg4brDiF83WXvPcg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.goebel-consult.de\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHs4zUB0fQIL_Yg4brDiF83WXvPcg&#39;;return true;">http://www.goebel-consult.de

Blog: <a style="color:grey!important;text-decoration:none!important" href="https://www.goe-con.de/blog/eilt-petition-auf-weact-gegen-vds-jetzt-unterschreiben" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.goe-con.de%2Fblog%2Feilt-petition-auf-weact-gegen-vds-jetzt-unterschreiben\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHjWxGuvGgyW9VrPR1wGgIppwoWMA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.goe-con.de%2Fblog%2Feilt-petition-auf-weact-gegen-vds-jetzt-unterschreiben\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHjWxGuvGgyW9VrPR1wGgIppwoWMA&#39;;return true;">https://www.goe-con.de/blog/eilt-petition-auf-weact-gegen-vds-jetzt-unterschreiben
Kolumne: <a style="color:grey!important;text-decoration:none!important" href="https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2012-01-in-die-cloud-in-die-cloud-aber-wo-soll-die-sein" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.goe-con.de%2Fhartmut-goebel%2Fcissp-gefluester%2F2012-01-in-die-cloud-in-die-cloud-aber-wo-soll-die-sein\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFDhFl7UxN5v5yj9On37CDsCHhQbA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.goe-con.de%2Fhartmut-goebel%2Fcissp-gefluester%2F2012-01-in-die-cloud-in-die-cloud-aber-wo-soll-die-sein\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFDhFl7UxN5v5yj9On37CDsCHhQbA&#39;;return true;">https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2012-01-in-die-cloud-in-die-cloud-aber-wo-soll-die-sein

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/cf321673-02b6-4ad4-b1f9-d956c1e9b9c7%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

墨焓
In reply to this post by Alessandro Minghelli
If you need pre-compiled binary library like ".so" (unix-like OS) or ".pyd" (Windows OS, similar to DLL), then you need cython.

Cython is not only used to convert bytecode to binary, it's made to convert python dynamic type into C static type which improves performance tremendously, it's also used to build C extensions for python using python Lang.

Alessandro Minghelli <[hidden email]> 于 2020年5月30日周六 00:30写道:
Thanks for your answer.

Just another question. 
There's a way so in the exe the file will be .so or .pyd?
Otherwise need I make some pre elaboration before I make the exe file?

Alex

Il giorno venerdì 29 maggio 2020 10:23:38 UTC+2, 墨焓 ha scritto:
I'm not sure about the compatibility issue, but I guess it should be fine.

As for the decompiling thing, yes, it's easy to decompile. The tool called "pyinstxtractor" shipped with pyinstaller is designed to unpack the built binary. After that, all individual files can be found, by default they are just python bytecode ".pyc" files, while python-bytecode-to-sourcecode-converter can be found everywhere on internet. So basically you can get everything back including docstrings and comments. However if they are not ".pyc" bytecode files, but pre-built binary library files like ".so" or ".pyd", the the reverse-engineering job would be very very tough, even nearly impossible.


Alessandro Minghelli <[hidden email]> 于 2020年5月28日周四 17:32写道:
Hi

In my office I developed a little utility and I compiling this with PyInstaller. 
It's not very important someone copy this (there isn't commercial value), but is very important none can decompiling the source.

First question is: Is there a way to decompiling an executable made with PyInstaller to obtain the source code? 

Second question is in the subject. PyInstaller is compatible with BS4 and Request libraries?

Thanks 




--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/32b53b3c-7760-42e9-9b2b-cbf5919e165d%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/3c254997-9dfd-446e-be00-074e7a1c0038%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CALc1kgVLq7rhZupD4mPXPgbe%2BKvMJNFenCV8jyU06yq2t6nKzg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Alessandro Minghelli
In reply to this post by Brendan Simon (gmail)
Thanks

The commercial value of my utility is not big. I just wish complicate life who wish use  my source. Also the speed is  not  so  important.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/fcf82d32-f3ef-4d80-b6c0-117d83a1e39c%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Decompiling an pyinstaller exe and compatibility with BeautifulSoup+Request

Chris Barker - NOAA Federal
>
> The commercial value of my utility is not big. I just wish complicate life who wish use  my source. Also the speed is  not  so  important.

Then you are fine with pyInstaller, only shipping *.pyc files.

A determined hacker can decompile it fairly easily, but unless you
have proprietary algorithms— no one is going to bother.

-CHB




>
> --
> You received this message because you are subscribed to the Google Groups "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/fcf82d32-f3ef-4d80-b6c0-117d83a1e39c%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CALGmxEJoTQoVk1qTgwW9RfSqyah-UmO5pqjXkodAnAbwnSePFA%40mail.gmail.com.