Python: Clean up the capstone-windows stuff with extreme prejudice
This commit is contained in:
parent
fdcd607c99
commit
ad36604b55
|
@ -1,19 +1,12 @@
|
|||
0. This documentation explains how to install Python binding for Capstone
|
||||
from source. If you want to install it from PyPi package, see the below
|
||||
docs instead:
|
||||
from source. If you want to install it from PyPi package (recommended if you
|
||||
are on Window), see README.txt.
|
||||
|
||||
- README.pypi-src: How to compile the Capstone core & install binding
|
||||
at the same time from PyPi package "capstone"
|
||||
|
||||
- README.pypi-win: How to install binding for Windows from PyPi package
|
||||
"capstone-windows". Note that this package already has prebuilt core
|
||||
inside, so no compilation is needed.
|
||||
|
||||
1. To install pure Python binding on *nix, run the command below:
|
||||
1. To install capstone and the python bindings on *nix, run the command below:
|
||||
|
||||
$ sudo make install
|
||||
|
||||
To install Python3 binding package, run the command below:
|
||||
To install capstone for python 3, run the command below:
|
||||
(Note: this requires python3 installed in your machine)
|
||||
|
||||
$ sudo make install3
|
||||
|
@ -22,8 +15,8 @@
|
|||
|
||||
$ sudo make install_cython
|
||||
|
||||
Note that this requires cython installed in your machine first.
|
||||
To install cython, see section 3 below.
|
||||
Note that this requires cython installed first. To install cython, see
|
||||
below.
|
||||
|
||||
3. To install cython, you have to ensure that the header files
|
||||
and the static library for Python are installed beforehand.
|
||||
|
@ -32,8 +25,8 @@
|
|||
|
||||
$ sudo apt-get install python-dev
|
||||
|
||||
Depending on if you already have pip or easy_install
|
||||
installed, install cython with either:
|
||||
Depending on if you already have pip or easy_install installed, install
|
||||
cython with either:
|
||||
|
||||
$ sudo pip install cython
|
||||
or:
|
||||
|
@ -56,8 +49,7 @@
|
|||
|
||||
Which should at least print version 0.19
|
||||
|
||||
|
||||
This directory contains some test code to show how to use Capstone API.
|
||||
4. This directory contains some test code to show how to use Capstone API.
|
||||
|
||||
- test.py
|
||||
This code shows the most simple form of API where we only want to get basic
|
||||
|
@ -81,26 +73,3 @@ This directory contains some test code to show how to use Capstone API.
|
|||
- test_<arch>.py
|
||||
These code show how to access architecture-specific information for each
|
||||
architecture.
|
||||
|
||||
|
||||
2. To install Python binding on Windows:
|
||||
|
||||
Recommended method:
|
||||
|
||||
Use the Python module installer for 32/64 bit Windows from:
|
||||
|
||||
http://www.capstone-engine.org/download.html
|
||||
|
||||
|
||||
Manual method:
|
||||
|
||||
If the module installer fails to locate your Python install, or if you have
|
||||
additional Python installs (e.g. Anaconda / virtualenv), run the following
|
||||
command in command prompt:
|
||||
|
||||
C:\> C:\location_to_python\python.exe setup.py install
|
||||
|
||||
Next, copy capstone.dll from the 'Core engine for Windows' package available
|
||||
on the same Capstone download page and paste it in the path:
|
||||
|
||||
C:\location_to_python\Lib\site-packages\capstone\
|
|
@ -1,3 +1,5 @@
|
|||
recursive-include src *
|
||||
include LICENSE.TXT
|
||||
include README
|
||||
include README.txt
|
||||
include BUILDING.txt
|
||||
include Makefile
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
Metadata-Version: 1.3
|
||||
Name: capstone
|
||||
Version: 3.0.4
|
||||
Author: Nguyen Anh Quynh
|
||||
Author-email: aquynh at gmail com
|
||||
Maintainer: Nguyen Anh Quynh
|
||||
Maintainer-email: aquynh at gmail com
|
||||
Home-page: http://www.capstone-engine.org
|
||||
Download-url: www.capstone-engine.org
|
||||
Summary: Capstone disassembly framework
|
||||
License: BSD
|
||||
Description: Capstone is a lightweight multi-platform, multi-architecture disassembly framework with some advanced features. Further information is available at the homepage http://www.capstone-engine.org
|
||||
Keywords: disassembly reverse binary arm arm64 aarch64 powerpc ppc mips x86 x86_64 sparc systemz xcore
|
||||
Platform: Windows MacOSX Linux NetBSD FreeBSD OpenBSD Solaris Android iOS
|
|
@ -1,14 +0,0 @@
|
|||
Metadata-Version: 1.3
|
||||
Name: capstone
|
||||
Version: 3.0.4
|
||||
Author: Nguyen Anh Quynh
|
||||
Author-email: aquynh at gmail com
|
||||
Maintainer: Nguyen Anh Quynh
|
||||
Maintainer-email: aquynh at gmail com
|
||||
Home-page: http://www.capstone-engine.org
|
||||
Download-url: www.capstone-engine.org
|
||||
Summary: Capstone disassembly framework with Windows prebuilt core ready inside.
|
||||
License: BSD
|
||||
Description: Capstone is a lightweight multi-platform, multi-architecture disassembly framework with some advanced features. Further information is available at the homepage http://www.capstone-engine.org
|
||||
Keywords: disassembly reverse binary arm arm64 aarch64 powerpc ppc mips x86 x86_64 sparc systemz xcore
|
||||
Platform: Windows MacOSX Linux NetBSD FreeBSD OpenBSD Solaris Android iOS
|
|
@ -1,54 +0,0 @@
|
|||
NOTE: This PyPi package "capstone" includes source code of the core of Capstone.
|
||||
So installing this would also compile the core with C compiler (either "gcc" or
|
||||
"msvc" on Windows).
|
||||
|
||||
On Windows, MSVC needs compiler environmental setup, you would need to either
|
||||
run "pip install capstone" or "python setup.py install" from "Developer Command
|
||||
Prompt".
|
||||
|
||||
For Windows, if you do not want to compile the core, try the "capstone-windows"
|
||||
package instead, which already includes the prebuilt "capstone.dll" inside.
|
||||
|
||||
https://pypi.python.org/pypi/capstone-windows
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Capstone is a disassembly framework with the target of becoming the ultimate
|
||||
disasm engine for binary analysis and reversing in the security community.
|
||||
|
||||
Created by Nguyen Anh Quynh, then developed and maintained by a small community,
|
||||
Capstone offers some unparalleled features:
|
||||
|
||||
- Support multiple hardware architectures: ARM, ARM64 (ARMv8), Mips, PPC, Sparc,
|
||||
SystemZ, XCore and X86 (including X86_64).
|
||||
|
||||
- Having clean/simple/lightweight/intuitive architecture-neutral API.
|
||||
|
||||
- Provide details on disassembled instruction (called “decomposer” by others).
|
||||
|
||||
- Provide semantics of the disassembled instruction, such as list of implicit
|
||||
registers read & written.
|
||||
|
||||
- Implemented in pure C language, with lightweight wrappers for C++, C#, Go,
|
||||
Java, NodeJS, Ocaml, Python, Ruby & Vala ready (available in main code,
|
||||
or provided externally by the community).
|
||||
|
||||
- Native support for all popular platforms: Windows, Mac OSX, iOS, Android,
|
||||
Linux, *BSD, Solaris, etc.
|
||||
|
||||
- Thread-safe by design.
|
||||
|
||||
- Special support for embedding into firmware or OS kernel.
|
||||
|
||||
- High performance & suitable for malware analysis (capable of handling various
|
||||
X86 malware tricks).
|
||||
|
||||
- Distributed under the open source BSD license.
|
||||
|
||||
Further information is available at http://www.capstone-engine.org
|
||||
|
||||
|
||||
[License]
|
||||
|
||||
This project is released under the BSD license. If you redistribute the binary
|
||||
or source code of Capstone, please attach file LICENSE.TXT with your products.
|
|
@ -1,13 +1,17 @@
|
|||
NOTE: This package includes prebuilt Windows core of Capstone, so no external
|
||||
Capstone library is needed.
|
||||
To install capstone, you should run `pip install capstone`.
|
||||
|
||||
On Windows, download this PyPi package and run "python setup.py install" from
|
||||
"Command Prompt" is all you need to install it.
|
||||
If you would like to build capstone with just the source distribution, without
|
||||
pip, just run `python setup.py install` in the same folder as this text file.
|
||||
|
||||
If you want to compile everything from source code instead, use the
|
||||
PyPi package "capstone" instead.
|
||||
In order to use this source distribution, you will need an environment that can
|
||||
compile C code. On linux, this is usually easy, but on windows, this involves
|
||||
installing Visual Studio and using the "Developer Command Prompt" to perform the
|
||||
installation. See BUILDING.txt for more information.
|
||||
|
||||
https://pypi.python.org/pypi/capstone
|
||||
If you don't want to build your own copy of capstone, you can use a precompiled
|
||||
binary distribution frm PyPI. Saying `pip install capstone` should automatically
|
||||
obtain an appropriate copy for your system. If it does not, please inform
|
||||
<andrew@andrewdutcher.com> - they will fix this, probably.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
capstone.dll
|
||||
# Except this file
|
||||
!.gitignore
|
|
@ -1,3 +0,0 @@
|
|||
capstone.dll
|
||||
# Except this file
|
||||
!.gitignore
|
|
@ -156,17 +156,18 @@ except ImportError:
|
|||
print "Proper 'develop' support unavailable."
|
||||
|
||||
if 'bdist_wheel' in sys.argv and '--plat-name' not in sys.argv:
|
||||
sys.argv.append('--plat-name')
|
||||
idx = sys.argv.index('bdist_wheel') + 1
|
||||
sys.argv.insert(idx, '--plat-name')
|
||||
name = get_platform()
|
||||
if 'linux' in name:
|
||||
# linux_* platform tags are disallowed because the python ecosystem is fubar
|
||||
# linux builds should be built in the centos 5 vm for maximum compatibility
|
||||
# see https://github.com/pypa/manylinux
|
||||
# see also https://github.com/angr/angr-dev/blob/master/bdist.sh
|
||||
sys.argv.append('manylinux1_' + platform.machine())
|
||||
sys.argv.insert(idx + 1, 'manylinux1_' + platform.machine())
|
||||
else:
|
||||
# https://www.python.org/dev/peps/pep-0425/
|
||||
sys.argv.append(name.replace('.', '_').replace('-', '_'))
|
||||
sys.argv.insert(idx + 1, name.replace('.', '_').replace('-', '_'))
|
||||
|
||||
setup(
|
||||
provides=['capstone'],
|
||||
|
|
Loading…
Reference in New Issue