forked from qilingframework/qiling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
168 lines (162 loc) · 6.24 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
language: shell
matrix:
fast_finish: true
include:
- name: "Python 3.6 on Linux"
os: linux
dist: bionic
language: python
python: "3.6"
cache: pip
install:
- pip3 install -r requirements.txt
- python3 setup.py install
before_script:
- pysite=$(python3 -m sysconfig | sed -n '/purelib/ s/.*\= *//p' | xargs); cp ${pysite}${pysite}/keystone/libkeystone.so $pysite/keystone/
- cd tests
script:
- ./test_elf.sh
- name: "Python 3.7 on Linux"
os: linux
dist: bionic
language: python
python: "3.7"
cache: pip
install:
- pip3 install flake8 -r requirements.txt
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- python3 setup.py install
before_script:
- pysite=$(python3 -m sysconfig | sed -n '/purelib/ s/.*\= *//p' | xargs); cp ${pysite}${pysite}/keystone/libkeystone.so $pysite/keystone/
- cd tests
script:
- ./test_elf.sh
- name: "Python 3.7 on OSX"
os: osx
osx_image: xcode10.1
language: shell
cache:
directories:
- $HOME/Library/Caches/pip
- $HOME/dist/
before_install:
- pip3 install --upgrade pip
install:
- pip3 install wheel 'capstone>=4.0.1' 'pefile>=2019.4.18' 'python-registry>=1.3.1' 'unicorn==1.0.2rc3'
# - pip3 install -r requirements.txt
- |
if [ ! -f $HOME/dist/keystone*.zip ]; then
git clone https://github.com/keystone-engine/keystone && \
cd keystone && \
mkdir build && \
cd build && \
../make-share.sh && \
make -j8 && \
sudo make install && \
cd ../bindings/python && \
sudo make install && \
python3 setup.py install && \
sudo python3 setup.py bdist --formats=zip && \
cp dist/*.zip $HOME/dist/ && \
cp /usr/local/lib/libkeystone.0.dylib $HOME/dist/ && \
cp /usr/local/lib/libkeystone.dylib $HOME/dist/;
else
unzip $HOME/dist/*.zip -d / && \
cp $HOME/dist/*.dylib /usr/local/lib/;
fi
- cd $TRAVIS_BUILD_DIR
- python3 setup.py install
before_script:
- ./examples/scripts/collectdylib.sh
- cd tests
script:
- ./test_macho.sh
- name: "Python 3.6.8 on Windows"
os: windows
language: shell
env:
- PATH="/c/Python36:/c/Python36/Scripts:$PATH"
cache:
directories:
# - $HOME/AppData/Local/Temp/chocolatey
- $HOME/AppData/Local/pip/Cache
- $HOME/dist
# - $HOME/AppData/Local/NuGet/Cache
before_install:
- choco install python --version=3.6.8
#- choco install python
#- choco install kb2999226
#- python -m pip install --upgrade pip
install:
- pip3 install wheel 'capstone>=4.0.1' 'pefile>=2019.4.18' 'python-registry>=1.3.1' 'unicorn>=1.0.2rc3'
#` - pip3 install -r requirements.txt
- |
if [ ! -f $HOME/dist/keystone*.zip ]; then
git clone https://github.com/keystone-engine/keystone && \
cd keystone && \
mkdir build && \
cd build && \
cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 '&' cmd.exe //C '..\nmake-dll.bat' '&&' nmake instalL && \
cd ../bindings/python && \
python setup.py install && \
python setup.py bdist --formats=zip && \
cp dist/*.zip $HOME/dist/ && \
cp /c/Program\ Files\ \(x86\)/keystone/lib/keystone.dll /c/Python36/Lib/site-packages/keystone/ && \
cp /c/Program\ Files\ \(x86\)/keystone/lib/keystone.dll $HOME/dist/;
else
unzip $HOME/dist/*.zip -d /c && \
cp $HOME/dist/keystone.dll /c/Python36/Lib/site-packages/keystone/;
fi
- cd $TRAVIS_BUILD_DIR
- python setup.py install
# - cp /c/Program\ Files\ \(x86\)/keystone/lib/keystone.dll /c/Python36/Lib/site-packages/keystone/
before_script:
- cmd.exe //C 'examples\scripts\dllscollector.bat'
- cd $TRAVIS_BUILD_DIR/examples/rootfs/x86_windows/bin
- unzip -Pinfected wannacry.bin.zip
- unzip -Pinfected UselessDisk.bin.zip
- unzip -Pinfected GandCrab502.bin.zip
- unzip -Pinfected al-khaser.bin.zip
- cd $TRAVIS_BUILD_DIR/tests
script:
- cmd.exe //C '.\test_pe.bat'
- name: "Python 3.6 on Docker"
services:
- docker
cache:
bundler: true
directories:
- $HOME/docker
# before_cache:
# - docker save -o $HOME/docker/images.tar qiling:1.0
before_script:
- docker load -i $HOME/docker/images.tar || true
- |
if [[ ! $(docker images -q qiling:1.0) ]]; then
docker build -t qiling:1.0 . && docker save -o $HOME/docker/images.tar qiling:1.0;
fi
- docker run -dt --name qiling -v ${TRAVIS_BUILD_DIR}:/qiling qiling:1.0
- docker exec qiling pip3 install -r requirements.txt
- docker exec qiling python3 setup.py install
script:
- docker exec qiling bash -c "cd tests && ./test_elf.sh"
# - name: "Python 3.6 on WSL1 Ubuntu"
# os: windows
# language: shell
# before_install:
# - choco install wsl-ubuntu-1804
# - wsl apt update
# - wsl DEBIAN_FRONTEND=noninteractive apt dist-upgrade -y
# - wsl DEBIAN_FRONTEND=noninteractive apt install -y python3-pip cmake
# - wsl pip3 install --upgrade pip
# install:
# - wsl pip3 install -r requirements.txt
# - wsl python3 setup.py install
# before_script:
# - MSYS_NO_PATHCONV=1 wsl cp $(wsl python3 -c "import site; print(site.getsitepackages()[0])")$(wsl python3 -c "import site; print(site.getsitepackages()[1])")/keystone/libkeystone.so $(wsl python3 -c "import site; print(site.getsitepackages()[0])")/keystone/
# - cd tests
# script:
# - wsl python3 test_all.py
# allow_failures:
# - os: osx
# - services: docker