plasma-disassembler / plasma

Plasma is an interactive disassembler for x86/ARM/MIPS. It can generates indented pseudo-code with colored syntax.
GNU General Public License v3.0
3.05k stars 275 forks source link

Make plasma pip-installable #60

Open lvh opened 8 years ago

lvh commented 8 years ago

Making this pip-installabe would make it more accessible to a bunch of folks. It would also be great if there were Windows, OS X and maybe even manylinux binary wheels (although I appreciate that these are less important than they are for other projects, since if you care about disassembly you probably have a C compiler lying around).

(As a side note, thanks for doing this, this looks amazing)

lvh commented 8 years ago

This has a few consequences:

lvh commented 8 years ago

The requirements.sh file claims pefile isn't installable, and therefore does a manual thing with future/pefile cloning, but this appears resolved:

lvh@zygalski ~/P/plasma (master)> pip install pefile                                                                                                                                                                       08:21:32
Collecting pefile
  Downloading pefile-2016.3.28.tar.gz (58kB)
    100% |████████████████████████████████| 61kB 1.3MB/s
Collecting future (from pefile)
  Downloading future-0.15.2.tar.gz (1.6MB)
    100% |████████████████████████████████| 1.6MB 917kB/s
Installing collected packages: future, pefile
  Running setup.py install for future ... done
  Running setup.py install for pefile ... done
Successfully installed future-0.15.2 pefile-2016.3.28
lvh commented 8 years ago

requirement.sh specifies a specific capstone version, but you can also specify capstone==3.0.4 in setup.py/requirements.txt.

lvh commented 8 years ago

I don't know to what extent you're familiar with modern Python packaging, but https://python-packaging-user-guide.readthedocs.io/en/latest/ is an excellent starter. I'm also happy to help with any questions you may have.

lvh commented 8 years ago

elftools can be installed as pip install pyelftools. This appears to have been an issue before: https://github.com/joelpx/plasma/issues/38

ghost commented 8 years ago

Thank you for your comments. In fact I'm not very familiar with pip and packaging. The setup file was created at the origin by another author 266a49ee9d4f40301fa1b311254db19f0a5bb5b4.

I have updated the requirements.sh for pefile. But for pyelftools I already do the pip install, no ?

You are walcome if you have any improvements ;)

lvh commented 8 years ago

You do sudo -H pip install which is a bad idea in many environments. The main point is that requirements should be specified in setup.py as per https://python-packaging-user-guide.readthedocs.io/en/latest/distributing/#initial-files . This will also help you upload your package to PyPI, meaning that people will just be able to pip install plasma to get plasma working.

lvh commented 8 years ago

(This also makes it much easier for distributions to package your software.)

ghost commented 8 years ago

I have a bit simplified the installation process 1626f5c6a080a32fa76c2540c8483e4e5d7566d9