Skip to content

Commit d0e5cdc

Browse files
authored
Merge pull request #684 from qilingframework/dev
Dev
2 parents d3df704 + d942c5d commit d0e5cdc

File tree

303 files changed

+4864
-4499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+4864
-4499
lines changed

.github/workflows/build-ci.yml

Lines changed: 57 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,30 @@ env:
55
jobs:
66
tests:
77
runs-on: ${{ matrix.os }}
8-
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
8+
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.container }}
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
os: [windows-2019, macos-10.15, ubuntu-18.04, ubuntu-20.04]
13-
python-version: [3.6.8, 3.7.6]
12+
os: [ubuntu-18.04, ubuntu-20.04]
13+
python-version: [3.6.8, 3.7.6, 3.8.5]
1414
exclude:
15-
- os: windows-2019
16-
python-version: 3.7.6
17-
- os: macos-10.15
18-
python-version: 3.7.6
15+
# - os: windows-2019
16+
# python-version: 3.7.6
17+
# - os: macos-10.15
18+
# python-version: 3.7.6
1919
- os: ubuntu-20.04
2020
python-version: 3.7.6
21+
# - os: windows-2019
22+
# python-version: 3.8.5
23+
# - os: macos-10.15
24+
# python-version: 3.8.5
25+
- os: ubuntu-20.04
26+
python-version: 3.8.5
27+
include:
28+
- os: ubuntu-20.04
29+
python-version: 3.6.8
30+
container: Docker
31+
2132
steps:
2233
- uses: actions/checkout@v2
2334

@@ -26,41 +37,41 @@ jobs:
2637
with:
2738
python-version: ${{ matrix.python-version }}
2839

29-
- name: win setup MSVC
30-
if: contains(matrix.os, 'windows')
31-
uses: microsoft/setup-msbuild@v1
40+
# - name: win setup MSVC
41+
# if: contains(matrix.os, 'windows')
42+
# uses: microsoft/setup-msbuild@v1
3243

33-
- name: win run tests
34-
if: contains(matrix.os, 'windows')
35-
shell: bash
36-
run: |
37-
powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableArchiveScanning \$true'"
38-
powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableBehaviorMonitoring \$true'"
39-
powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableRealtimeMonitoring \$true'"
40-
powershell Add-MpPreference -ExclusionPath $GITHUB_WORKSPACE
41-
pip3 install setuptools wheel
42-
pip3 install .
43-
cmd.exe //C 'examples\scripts\dllscollector.bat'
44-
cd $GITHUB_WORKSPACE/examples/rootfs/x86_windows/bin
45-
unzip -Pinfected wannacry.bin.zip
46-
unzip -Pinfected UselessDisk.bin.zip
47-
unzip -Pinfected GandCrab502.bin.zip
48-
unzip -Pinfected al-khaser.bin.zip
49-
unzip -Pinfected sality.dll.zip
50-
cd $GITHUB_WORKSPACE/tests
51-
cmd.exe //C '.\test_pe.bat'
52-
- name: mac run tests
53-
if: contains(matrix.os, 'macos')
54-
continue-on-error: true
55-
shell: bash
56-
run: |
57-
pip3 install setuptools wheel
58-
pip3 install .
59-
./examples/scripts/dylibcollector.sh
60-
cd $GITHUB_WORKSPACE/examples/rootfs/x8664_macos/kext
61-
unzip -Pinfected SuperRootkit.kext.zip
62-
cd $GITHUB_WORKSPACE/tests
63-
./test_macho.sh
44+
# - name: win run tests
45+
# if: contains(matrix.os, 'windows')
46+
# shell: bash
47+
# run: |
48+
# powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableArchiveScanning \$true'"
49+
# powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableBehaviorMonitoring \$true'"
50+
# powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableRealtimeMonitoring \$true'"
51+
# powershell Add-MpPreference -ExclusionPath $GITHUB_WORKSPACE
52+
# pip3 install setuptools wheel
53+
# pip3 install .
54+
# cmd.exe //C 'examples\scripts\dllscollector.bat'
55+
# cd $GITHUB_WORKSPACE/examples/rootfs/x86_windows/bin
56+
# unzip -Pinfected wannacry.bin.zip
57+
# unzip -Pinfected UselessDisk.bin.zip
58+
# unzip -Pinfected GandCrab502.bin.zip
59+
# unzip -Pinfected al-khaser.bin.zip
60+
# unzip -Pinfected sality.dll.zip
61+
# cd $GITHUB_WORKSPACE/tests
62+
# cmd.exe //C '.\test_pe.bat'
63+
# - name: mac run tests
64+
# if: contains(matrix.os, 'macos')
65+
# continue-on-error: true
66+
# shell: bash
67+
# run: |
68+
# pip3 install setuptools wheel
69+
# pip3 install .
70+
# ./examples/scripts/dylibcollector.sh
71+
# cd $GITHUB_WORKSPACE/examples/rootfs/x8664_macos/kext
72+
# unzip -Pinfected SuperRootkit.kext.zip
73+
# cd $GITHUB_WORKSPACE/tests
74+
# ./test_macho.sh
6475
- name: linux run tests
6576
if: contains(matrix.os, 'ubuntu')
6677
shell: 'script -q -e -c "bash {0}"'
@@ -69,11 +80,13 @@ jobs:
6980
pip3 install setuptools wheel flake8
7081
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
7182
pip3 install .
72-
cd tests && ./test_elf.sh
83+
cd examples/rootfs/x86_linux/kernel && unzip -P infected m0hamed_rootkit.ko.zip
84+
cd ../../../../tests && ./test_elf.sh
7385
elif [ ${{ matrix.os }} == 'ubuntu-20.04' ]; then
74-
docker run -it --rm -v ${GITHUB_WORKSPACE}:/qiling qilingframework/qiling:dev bash -c "pip3 install . && cd tests && ./test_elf.sh"
86+
docker run -it --rm -v ${GITHUB_WORKSPACE}:/qiling qilingframework/qiling:dev bash -c "pip3 install . && cd examples/rootfs/x86_linux/kernel && unzip -P infected m0hamed_rootkit.ko.zip && cd ../../../../tests && ./test_elf.sh"
7587
else
7688
pip3 install setuptools wheel
7789
pip3 install .
78-
cd tests && ./test_elf.sh
90+
cd examples/rootfs/x86_linux/kernel && unzip -P infected m0hamed_rootkit.ko.zip
91+
cd ../../../../tests && ./test_elf.sh
7992
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.idea
55
*.pyc
66
*.cache
7+
*.cache2
78
.*.swp
89
*.raw
910

.travis.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,58 @@ matrix:
3333
script:
3434
- ./test_macho.sh
3535

36+
- name: "Python 3.6.8 on Windows"
37+
os: windows
38+
language: shell
39+
env:
40+
- PATH="/c/Python36:/c/Python36/Scripts:$PATH"
41+
cache:
42+
directories:
43+
# - $HOME/AppData/Local/Temp/chocolatey
44+
- $HOME/AppData/Local/pip/Cache
45+
- /c/Python36
46+
# - $HOME/AppData/Local/NuGet/Cache
47+
before_install:
48+
- |
49+
if [[ ! -f /c/Python36/python ]]; then
50+
choco install python --version=3.6.8
51+
fi
52+
# Prevent worker settings failure
53+
- powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableArchiveScanning \$true'"
54+
- powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableBehaviorMonitoring \$true'"
55+
- powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableRealtimeMonitoring \$true'"
56+
#- choco install kb2999226
57+
#- python -m pip install --upgrade pip
58+
install:
59+
# - pip3 install wheel 'capstone>=4.0.1' 'pefile>=2019.4.18' 'python-registry>=1.3.1' 'unicorn>=1.0.2rc3'
60+
# - |
61+
# if [ ! -f $HOME/dist/keystone*.zip ]; then
62+
# git clone https://github.com/keystone-engine/keystone && \
63+
# cd keystone && \
64+
# mkdir build && \
65+
# cd build && \
66+
# 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 && \
67+
# cd ../bindings/python && \
68+
# python setup.py install && \
69+
# python setup.py bdist --formats=zip && \
70+
# cp dist/*.zip $HOME/dist/ && \
71+
# cp /c/Program\ Files\ \(x86\)/keystone/lib/keystone.dll /c/Python36/Lib/site-packages/keystone/ && \
72+
# cp /c/Program\ Files\ \(x86\)/keystone/lib/keystone.dll $HOME/dist/;
73+
# else
74+
# unzip $HOME/dist/*.zip -d /c && \
75+
# cp $HOME/dist/keystone.dll /c/Python36/Lib/site-packages/keystone/;
76+
# fi
77+
- cd $TRAVIS_BUILD_DIR
78+
- pip3 install .
79+
# - cp /c/Program\ Files\ \(x86\)/keystone/lib/keystone.dll /c/Python36/Lib/site-packages/keystone/
80+
before_script:
81+
- cmd.exe //C 'examples\scripts\dllscollector.bat'
82+
- cd $TRAVIS_BUILD_DIR/examples/rootfs/x86_windows/bin
83+
- unzip -Pinfected wannacry.bin.zip
84+
- unzip -Pinfected UselessDisk.bin.zip
85+
- unzip -Pinfected GandCrab502.bin.zip
86+
- unzip -Pinfected al-khaser.bin.zip
87+
- unzip -Pinfected sality.dll.zip
88+
- cd $TRAVIS_BUILD_DIR/tests
89+
script:
90+
- cmd.exe //C '.\test_pe.bat'

CREDITS.TXT

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
This file credits all the contributors of the Qiling Framework project.
22

3+
34
Project Leader
45
==============
56
LAU kaijern (xwings) <[email protected]>
67

8+
79
Advisor
810
=======
911
NGUYEN Anh Quynh <[email protected]>
1012

13+
1114
Travis, Website and Documentations
1215
==================================
1316
FOO Kevin (chfl4gs) <[email protected]>
1417

18+
1519
Core Developers
1620
===============
1721
DING tianze (D1iv3) <[email protected]>
@@ -22,11 +26,6 @@ Earl MARCUS (klks84) [email protected]
2226
WU chenxu (kabeor) <[email protected]>
2327
KONG ziqiao (lazymio) <[email protected]>
2428

25-
Demigod team (https://groundx.io/demigod)
26-
=========================================
27-
NGUYEN Anh Quynh
28-
NGUYEN Hong Quang
29-
DO Minh Tuan
3029

3130
Key Contributors (in no particular order)
3231
=========================================
@@ -35,6 +34,18 @@ liba2k
3534
assafcarlsbad
3635
ucgJhe
3736
jhumble
37+
Mark Jansen (learn-more)
38+
cq674350529
39+
elicn
40+
bkerler (viperbjk)
41+
42+
43+
Demigod team (https://groundx.io/demigod)
44+
=========================================
45+
NGUYEN Anh Quynh
46+
NGUYEN Hong Quang
47+
DO Minh Tuan
48+
3849

3950
Contributors (in no particular order)
4051
=====================================
@@ -48,9 +59,8 @@ danielhenrymantilla
4859
iamyeh
4960
alfink
5061
bambu
51-
bkerler (viperbjk)
52-
Mark Jansen (learn-more)
53-
cq674350529
62+
63+
5464

5565
Alpha testers (in no particular order, named by github id)
5666
==========================================================

ChangeLog

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,30 @@ BREAK CHANGE
77
- ql.filename is renamed to ql.argv.
88
- ql.output and ql.verbose now has slightly different meanings and can be adjusted runtime. See their docstring for details.
99
- ql.filter now accepts a regular expression.
10+
- Remove ql.log_dir, ql.log_split, ql.append but add ql.log_file instead.
11+
12+
13+
------------------------------------
14+
[Version 1.2.3]: March [SOMETHING], 2021
15+
-
16+
1017

1118
------------------------------------
12-
[Version 1.3]: January [SOMETHING], 2021
19+
[Version 1.2.2]: February 8, 2021
20+
21+
- Fix _acmdln and _wcmdln handling
22+
- More UEFI refactor
23+
- Refactor common OS space
24+
- Bring sality test to work again
25+
- Clean up more test case
26+
- First stage multithread rewrite done
27+
- Updated Qiling(shellcode=) to Qiling(code=), still keeping Qiling(shellcode=) for legacy purpose
28+
- Added support for SMM_RUNTIME_SERVICES_TABLE
29+
- Fixed regression in code coverage collection
30+
- Added generic ql.mem.read_ptr helper function
31+
- merged UEFI, windows, linux and macos print_function
32+
- merged UEFI, windows, linux and macos fncc
33+
- make MacOS uses more Qiling API
1334

1435

1536
------------------------------------

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ RUN apt-get update \
88
&& apt-get -y upgrade \
99
&& apt-get install -y --no-install-recommends cmake build-essential gcc git
1010

11-
RUN git clone -b dev https://github.com/qilingframework/qiling.git \
12-
&& cd qiling \
11+
COPY . /qiling
12+
13+
RUN cd /qiling \
1314
&& pip wheel . -w wheels
1415

1516
FROM python:3.6-slim AS base
@@ -19,6 +20,7 @@ COPY --from=builder /qiling /qiling
1920
WORKDIR /qiling
2021

2122
RUN apt-get update \
23+
&& apt-get install -y --no-install-recommends unzip \
2224
&& rm -rf /var/lib/apt/lists/* \
2325
&& pip3 install wheels/*.whl \
2426
&& rm -rf wheels

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ Contact us at email [email protected], or via Twitter [@qiling_io](https://twitter.
233233
- assafcarlsbad
234234
- ucgJhe
235235
- jhumble
236+
- Mark Jansen (learn-more)
237+
- cq674350529
238+
- elicn
239+
- bkerler (viperbjk)
236240

237241
---
238242

docs/bg_page.png

252 KB
Loading

examples/adcache_x86_windows_debug.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
#
33
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
4-
# Built on top of Unicorn emulator (www.unicorn-engine.org)
4+
#
55

66
import sys
77
from zipfile import ZipFile
@@ -13,6 +13,6 @@
1313
with ZipFile("shellcodes/win32_https_download.zip") as zip_reader:
1414
with zip_reader.open('win32_https_download.bin', 'r', b'infected') as f:
1515
sc = f.read()
16-
ql = Qiling(shellcoder=sc, archtype="x86", ostype="windows",
16+
ql = Qiling(code=sc, archtype="x86", ostype="windows",
1717
rootfs="rootfs/x86_windows", output="debug")
1818
ql.run()

examples/cachedlls_x8664_windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
#
33
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
4-
# Built on top of Unicorn emulator (www.unicorn-engine.org)
4+
#
55
import sys
66
sys.path.append("..")
77
from qiling import *

0 commit comments

Comments
 (0)