Add capstone

This commit is contained in:
Riccardo Schirone 2016-09-21 09:20:39 +00:00
parent e57a86abd0
commit ce80941526
5 changed files with 45 additions and 0 deletions

View file

@ -14,6 +14,7 @@ Installers for the following tools are included:
| binary | [barf](https://github.com/programa-stic/barf-project) | Binary Analysis and Reverse-engineering Framework. | <!--tool--><!--times-out-->
| binary | [bindead](https://bitbucket.org/mihaila/bindead/wiki/Home) | A static analysis tool for binaries. | <!--tool--><!--failing-->
| binary | [binjitsu](https://github.com/binjitsu/binjitsu) | Useful CTF utilities. pwntools fork. | <!--tool--><!--no-test-->
| binary | [capstone](http://www.capstone-engine.org) | Multi-architecture disassembly framework. | <!--tool--><!--test-->
| binary | [checksec](https://github.com/slimm609/checksec.sh) | Check binary hardening settings. | <!--tool--><!--test-->
| binary | [codereason](https://github.com/trailofbits/codereason) | Semantic Binary Code Analysis Framework. | <!--tool--><!--failing-->
| binary | [crosstool-ng](http://crosstool-ng.org/) | Cross-compilers and cross-architecture tools. | <!--tool--><!--no-test-->

View file

@ -139,6 +139,9 @@ function base_build_setup()
# create the py2 virtualenv
"$PWD/bin/ctf-tools-pip" freeze 2>&1 >/dev/null
# create the py3 virtualenv
"$PWD/bin/ctf-tools-pip3" freeze 2>&1 >/dev/null
}

4
capstone/install Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
ctf-tools-pip install -U capstone
ctf-tools-pip3 install -U capstone

33
capstone/test Executable file
View file

@ -0,0 +1,33 @@
#!/bin/bash -e
PY_TEST_FILE=$(mktemp)
cat << END > $PY_TEST_FILE
from capstone import *
import sys
CODE = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"
addresses = [0x1000, 0x1001]
md = Cs(CS_ARCH_X86, CS_MODE_64)
for idx, i in enumerate(md.disasm(CODE, 0x1000)):
if i.address != addresses[idx]:
sys.exit(1)
sys.exit(0)
END
source ${VIRTUALENVWRAPPER_SCRIPT}
set +e
workon ctftools
set -e
python $PY_TEST_FILE
deactivate
set +e
workon ctftools3
set -e
python $PY_TEST_FILE
deactivate
rm $PY_TEST_FILE

4
capstone/uninstall Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
ctf-tools-pip uninstall -y capstone || true
ctf-tools-pip3 uninstall -y capstone || true