Skip to content

Commit

Permalink
python: distribute msvcr120.dll for Windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Feb 3, 2015
1 parent 6685aa5 commit c6b1be8
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 24 deletions.
49 changes: 49 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
This file details the changelog of Capstone.

---------------------------------
Version 3.0.1: February 03, 2015

[ X86 ]

- Properly handle LOCK, REP, REPE & REPNE prefixes.
- Handle undocumented immediates for SSE's (V)CMPPS/PD/SS/SD instructions.
- Print LJUMP/LCALL without * as prefix for Intel syntax.
- Handle REX prefix properly for segment/MMX related instructions (x86_64).
- Instruction with length > 15 is consider invalid.
- Handle some tricky encodings for instructions MOVSXD, FXCH, FCOM, FCOMP,
FSTP, FSTPNCE, NOP.
- Handle some tricky code for some X86_64 instructions with REX prefix.
- Add missing operands in detail mode for PUSH , POP , IN/OUT reg, reg
- MOV32ms & MOV32sm should reference word rather than dword.


[ Arm64 ]

- BL & BLR instructions do not read SP register.
- Print absolute (rather than relative) address for instructions B, BL,
CBNZ, ADR.


[ Arm ]

- Instructions ADC & SBC do not update flags.
- BL & BLX do not read SP, but PC register.
- Alias LDR instruction with operands [sp], 4 to POP.
- Print immediate operand of MVN instruction in positive hexadecimal form.


[ PowerPC ]

- Fix some compilation bugs when DIET mode is enable.
- Populate SLWI/SRWI instruction details with SH operand.


[ Python binding ]

- Fix a Cython bug when CsInsn.bytes returns a shorten array of bytes.
- Fixed a memory leak for Cython disasm functions when we immaturely quit
the enumeration of disassembled instructions.
- Fix a NULL memory access issue when SKIPDATA & Detail modes are enable
at the same time.
- Fix a memory leaking bug when when we stop enumeration over the disassembled
instructions prematurely.
- Export generic operand types & groups (CS_OP_xxx & CS_GRP_xxx).

---------------------------------
Version 3.0: November 19th, 2014

Expand Down
6 changes: 3 additions & 3 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The old bindings from version 2.x are not compatible with version 3.0, so
must be updated. For Java/Ocaml/Python bindings, see respective README files
under bindings/ directory in the source on how to reinstall them.
This version 3.0.1 fixed some important issues of Python binding, so Python
users should upgrade Python binding together with the core. See file
bindings/python/README.TXT for how to do that.
24 changes: 12 additions & 12 deletions bindings/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ gen_const:

install:
rm -rf $(OBJDIR) src/
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf prebuilt/win64/capstone.dll
rm -rf prebuilt/win32/capstone.dll
python setup.py build -b $(OBJDIR) install

install3:
rm -rf $(OBJDIR) src/
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf prebuilt/win64/capstone.dll
rm -rf prebuilt/win32/capstone.dll
python3 setup.py build -b $(OBJDIR) install

# NOTE: Newer cython can be installed by: sudo pip install --upgrade cython
install_cython:
rm -rf $(OBJDIR) src/
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf prebuilt/win64/capstone.dll
rm -rf prebuilt/win32/capstone.dll
mkdir -p $(OBJDIR)/pyx
cp setup_cython.py $(OBJDIR)
cp pyx/ccapstone* $(OBJDIR)/pyx/
Expand Down Expand Up @@ -53,17 +53,17 @@ install_cython:
# build & upload PyPi package with source code of the core
sdist:
rm -rf src/
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf prebuilt/win64/capstone.dll
rm -rf prebuilt/win32/capstone.dll
cp README.pypi-src README
cp PKG-INFO.src PKG-INFO
python setup.py sdist register upload

# build & upload PyPi package with source code of the core
sdist3:
rm -rf src/
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf prebuilt/win64/capstone.dll
rm -rf prebuilt/win32/capstone.dll
cp README.pypi-src README
cp PKG-INFO.src PKG-INFO
python3 setup.py sdist register upload
Expand All @@ -87,8 +87,8 @@ sdist3_win:
clean:
rm -rf $(OBJDIR) src/ README
rm -f capstone/*.so
rm -rf prebuilt/win64/*.dll
rm -rf prebuilt/win32/*.dll
rm -rf prebuilt/win64/capstone.dll
rm -rf prebuilt/win32/capstone.dll


TESTS = test.py test_detail.py test_arm.py test_arm64.py test_mips.py test_ppc.py
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/PKG-INFO.win
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/README.pypi-src
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NOTE: This 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).

For Windows, if you do not want to compile the core, install package "capstone-win"
For Windows, if you do not want to compile the core, install package "capstone_win"
instead, which already has the prebuilt core inside.
--------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion bindings/python/README.pypi-win
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NOTE: This package "capstone-win" includes prebuilt Windows core of Capstone.
NOTE: This package "capstone_win" includes prebuilt Windows core of Capstone.
To compile from source, see package "capstone".
--------------------------------------------------------------------------------

Expand Down
3 changes: 1 addition & 2 deletions bindings/python/prebuilt/win32/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Ignore everything in this directory
*
capstone.dll
# Except this file
!.gitignore
Binary file added bindings/python/prebuilt/win32/msvcr120.dll
Binary file not shown.
3 changes: 1 addition & 2 deletions bindings/python/prebuilt/win64/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Ignore everything in this directory
*
capstone.dll
# Except this file
!.gitignore
Binary file added bindings/python/prebuilt/win64/msvcr120.dll
Binary file not shown.
8 changes: 6 additions & 2 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@

# prebuilt libraries for Windows - for sdist
PATH_LIB64 = "prebuilt/win64/capstone.dll"
PATH_MSVCR64 = "prebuilt/win64/msvcr120.dll"
PATH_LIB32 = "prebuilt/win32/capstone.dll"
PATH_MSVCR32 = "prebuilt/win32/msvcr120.dll"

# package name can be 'capstone' or 'capstone-win'
# package name can be 'capstone' or 'capstone_win'
PKG_NAME = 'capstone'
if os.path.exists(PATH_LIB64) and os.path.exists(PATH_LIB32):
PKG_NAME = 'capstone-win'
PKG_NAME = 'capstone_win'

VERSION = '3.0.1'
SYSTEM = sys.platform
Expand Down Expand Up @@ -102,9 +104,11 @@ def build_libraries(self, libraries):
# if Windows prebuilt library is available, then include it
if is_64bits and os.path.exists(PATH_LIB64):
SETUP_DATA_FILES.append(PATH_LIB64)
SETUP_DATA_FILES.append(PATH_MSVCR64)
return
elif os.path.exists(PATH_LIB32):
SETUP_DATA_FILES.append(PATH_LIB32)
SETUP_DATA_FILES.append(PATH_MSVCR32)
return

# build library from source if src/ is existent
Expand Down

0 comments on commit c6b1be8

Please sign in to comment.