mirror of
https://github.com/zardus/ctf-tools
synced 2024-12-13 14:32:34 +00:00
7144e756e5
early on any error + anticipate that some tools can't be installed by now, but we still want the test to return success to satisfy travis-ci
33 lines
503 B
Bash
Executable file
33 lines
503 B
Bash
Executable file
#!/bin/bash -ex
|
|
|
|
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
|