Skip to content

Commit f56105c

Browse files
authored
Merge pull request #1541 from qilingframework/dev
Getting ready for 1.4.7
2 parents 9a78d18 + cf325d3 commit f56105c

File tree

331 files changed

+11881
-20070
lines changed

Some content is hidden

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

331 files changed

+11881
-20070
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
!/qiling/
3+
!/poetry.lock
4+
!/pyproject.toml
5+
!/ql*
6+
!/README.md

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*.py]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_size = 4
10+
indent_style = space
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true

.github/workflows/build-ci.yml

Lines changed: 40 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,82 +10,76 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
#os: [windows-2019, macos-10.15, ubuntu-18.04, ubuntu-20.04]
13-
os: [windows-latest, ubuntu-20.04]
14-
python-version: [3.8, 3.9]
13+
os: [windows-latest, ubuntu-22.04]
14+
python-version: ["3.9", "3.11"]
1515
include:
1616
- os: ubuntu-22.04
1717
python-version: 3.9
1818
container: Docker
1919

2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v3
2222

23-
- name: Set up Python
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: ${{ matrix.python-version }}
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
2727

28+
- name: Win setup MSVC
29+
if: contains(matrix.os, 'windows')
30+
uses: microsoft/setup-msbuild@v1
2831

29-
- name: Win setup MSVC
30-
if: contains(matrix.os, 'windows')
31-
uses: microsoft/setup-msbuild@v1
32-
33-
34-
- name: Win configure Pagefile
35-
if: contains(matrix.os, 'windows')
36-
uses: al-cheb/[email protected]
37-
with:
32+
- name: Win configure Pagefile
33+
if: contains(matrix.os, 'windows')
34+
uses: al-cheb/[email protected]
35+
with:
3836
minimum-size: 16GB
3937
maximum-size: 16GB
4038
disk-root: "C:"
4139

42-
43-
- name: win run tests
44-
if: contains(matrix.os, 'windows')
45-
shell: bash
46-
run: |
40+
- name: win run tests
41+
if: contains(matrix.os, 'windows')
42+
shell: bash
43+
run: |
4744
powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableArchiveScanning \$true'"
4845
powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableBehaviorMonitoring \$true'"
4946
powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableRealtimeMonitoring \$true'"
5047
powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Add-MpPreference -ExclusionPath $GITHUB_WORKSPACE'"
51-
pip3 install setuptools wheel
5248
pip3 install .
5349
cd examples
5450
rm -rf rootfs
5551
curl -LJk -o master.zip https://github.com/qilingframework/rootfs/archive/refs/heads/master.zip && unzip master.zip
5652
mv rootfs-master rootfs
57-
cd $GITHUB_WORKSPACE
53+
cd "$GITHUB_WORKSPACE"
5854
cmd.exe //C 'examples\scripts\dllscollector.bat'
59-
cd $GITHUB_WORKSPACE/examples/rootfs/x86_windows/bin
55+
cd "$GITHUB_WORKSPACE/examples/rootfs/x86_windows/bin"
6056
unzip -Pinfected wannacry.bin.zip
6157
unzip -Pinfected UselessDisk.bin.zip
6258
unzip -Pinfected GandCrab502.bin.zip
6359
unzip -Pinfected al-khaser.bin.zip
6460
unzip -Pinfected sality.dll.zip
65-
cd $GITHUB_WORKSPACE/tests
61+
cd "$GITHUB_WORKSPACE/tests"
6662
cmd.exe //C '.\test_pe.bat'
6763
64+
- name: linux run tests
65+
if: contains(matrix.os, 'ubuntu')
66+
shell: 'script -q -e -c "bash {0}"'
67+
run: |
68+
cd examples
69+
rm -rf rootfs
70+
wget https://github.com/qilingframework/rootfs/archive/refs/heads/master.zip
71+
unzip master.zip && mv rootfs-master rootfs
72+
cd ../qiling
73+
cd ../examples/rootfs/x86_linux/kernel && unzip -P infected m0hamed_rootkit.ko.zip
74+
cd ../../../../
75+
pip3 install -e .[RE]
6876
69-
- name: linux run tests
70-
if: contains(matrix.os, 'ubuntu')
71-
shell: 'script -q -e -c "bash {0}"'
72-
run: |
73-
cd examples
74-
rm -rf rootfs
75-
wget https://github.com/qilingframework/rootfs/archive/refs/heads/master.zip
76-
unzip master.zip && mv rootfs-master rootfs
77-
cd ../qiling
78-
cd ../examples/rootfs/x86_linux/kernel && unzip -P infected m0hamed_rootkit.ko.zip
79-
cd ../../../../
80-
pip3 install -e .[evm,RE]
81-
82-
if [ ${{ matrix.os }} == 'ubuntu-18.04' ] and [ ${{ matrix.python-version }} == '3.9' ]; then
83-
docker run -it --rm -v ${GITHUB_WORKSPACE}:/qiling qilingframework/qiling:dev bash -c "cd tests && ./test_onlinux.sh"
84-
else
85-
pip3 install setuptools wheel
86-
cd tests && ./test_onlinux.sh
87-
fi
88-
77+
if [ ${{ matrix.os }} == 'ubuntu-18.04' ] and [ ${{ matrix.python-version }} == '3.9' ]; then
78+
docker run -it --rm -v ${GITHUB_WORKSPACE}:/qiling qilingframework/qiling:dev bash -c "cd tests && ./test_onlinux.sh"
79+
else
80+
pip3 install poetry
81+
cd tests && ./test_onlinux.sh
82+
fi
8983
9084
# - name: mac run tests
9185
# if: contains(matrix.os, 'macos')
@@ -97,4 +91,4 @@ jobs:
9791
# cd $GITHUB_WORKSPACE/examples/rootfs/x8664_macos/kext
9892
# unzip -Pinfected SuperRootkit.kext.zip
9993
# cd $GITHUB_WORKSPACE/tests
100-
# ./test_macho.sh
94+
# ./test_macho.sh

.github/workflows/dockerimage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: 'Checkout git repo'
13+
- name: "Checkout git repo"
1414
uses: actions/checkout@v1
1515

1616
- name: Publish to registry

.github/workflows/giteesync.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: sync to gitee
2-
on:
3-
push:
1+
name: sync to gitee
2+
on:
3+
push:
44

5-
jobs:
6-
deploy:
7-
runs-on: ubuntu-latest
8-
if: github.repository_owner == 'qilingframework'
9-
steps:
10-
- uses: actions/checkout@v2
11-
with:
12-
fetch-depth: 0
13-
- uses: xwings/sync-repo-action@master
14-
with:
15-
run: git config --global --add safe.directory *
16-
ssh_private_key: ${{ secrets.GITEE_KEY }}
17-
target_repo: ssh://[email protected]/qilingframework/qiling.git
18-
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
if: github.repository_owner == 'qilingframework'
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- uses: xwings/sync-repo-action@master
14+
with:
15+
run: git config --global --add safe.directory *
16+
ssh_private_key: ${{ secrets.GITEE_KEY }}
17+
target_repo: ssh://[email protected]/qilingframework/qiling.git

.github/workflows/pythonpublish.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,25 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Set up Python
11-
uses: actions/setup-python@v1
12-
with:
13-
python-version: '3.x'
14-
- name: Install dependencies
15-
run: |
16-
pip install setuptools wheel
17-
- name: Build distribution 📦
18-
run: |
19-
pip install .
20-
python setup.py sdist bdist_wheel
21-
- uses: actions/upload-artifact@v2
22-
with:
23-
path: ${{ github.workspace }}/dist/*
9+
- uses: actions/checkout@v2
10+
- name: Set up Python
11+
uses: actions/setup-python@v4
12+
with:
13+
python-version: "^3.8"
14+
- name: Install dependencies
15+
run: pipx install poetry
16+
- name: Build distribution 📦
17+
run: poetry build -n
18+
- uses: actions/upload-artifact@v4
19+
with:
20+
path: ${{ github.workspace }}/dist/*
2421

2522
publish:
2623
needs: [build]
2724
runs-on: ubuntu-latest
2825
if: startsWith(github.ref, 'refs/tags')
2926
steps:
30-
- uses: actions/download-artifact@v2
27+
- uses: actions/download-artifact@v4
3128
with:
3229
name: artifact
3330
path: dist

.gitignore

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,10 @@
22
.DS_Store
33
.vscode
44
.idea
5-
*.pyc
65
*.cache
76
*.cache2
87
.*.swp
98
*.raw
10-
.venv
11-
12-
# cache and misc
13-
qiling.egg-info/
14-
__pycache__/
15-
*.py[cod]
16-
build
17-
dist
189

1910
# test and logs
2011
tests/mac_test_elf.sh
@@ -38,3 +29,44 @@ core
3829
tests/output.txt
3930
tests/testtest_*
4031

32+
### Python ###
33+
# Byte-compiled / optimized / DLL files
34+
__pycache__/
35+
*.py[cod]
36+
37+
# Distribution / packaging
38+
build/
39+
develop-eggs/
40+
dist/
41+
eggs/
42+
sdist/
43+
wheels/
44+
*.egg-info/
45+
.installed.cfg
46+
*.egg
47+
MANIFEST
48+
49+
# Environments
50+
.env
51+
.venv
52+
venv/
53+
54+
# mypy
55+
.mypy_cache/
56+
.dmypy.json
57+
dmypy.json
58+
59+
# Pyre type checker
60+
.pyre/
61+
62+
# pytype static type analyzer
63+
.pytype/
64+
65+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
66+
poetry.toml
67+
68+
# ruff
69+
.ruff_cache/
70+
71+
# LSP config files
72+
pyrightconfig.json

Dockerfile

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
FROM python:3.8-slim AS builder
1+
FROM python:3-slim AS base
22

3-
LABEL maintainer="Kevin Foo <chfl4gs@qiling.io>"
3+
WORKDIR /qiling
44

5+
# hadolint global ignore=DL3008,DL3013
56
ENV DEBIAN_FRONTEND=noninteractive
6-
ENV AM_I_IN_A_DOCKER_CONTAINER Yes
7+
ENV AM_I_IN_A_DOCKER_CONTAINER=True
78

8-
RUN apt-get update \
9-
&& apt-get -y upgrade \
10-
&& apt-get install -y --no-install-recommends cmake build-essential gcc git
9+
RUN apt-get update && apt-get -y upgrade && rm -rf /var/lib/apt/lists/*
10+
11+
12+
FROM base AS builder
1113

12-
COPY . /qiling
14+
RUN apt-get update && apt-get install -y --no-install-recommends \
15+
cmake build-essential gcc git \
16+
&& rm -rf /var/lib/apt/lists/*
1317

14-
RUN cd /qiling \
15-
&& pip wheel . -w wheels
18+
COPY pyproject.toml poetry.lock ./
19+
RUN pip3 install --no-cache-dir poetry \
20+
&& poetry install --no-root --no-directory
1621

17-
FROM python:3.8-slim AS base
22+
COPY . .
23+
RUN poetry install --only main && poetry build --format=wheel
24+
25+
FROM base
26+
27+
LABEL maintainer="Kevin Foo <[email protected]>"
1828

1929
COPY --from=builder /qiling /qiling
2030

2131
WORKDIR /qiling
2232

2333
RUN apt-get update \
24-
&& apt-get install -y --no-install-recommends unzip apt-utils \
25-
&& rm -rf /var/lib/apt/lists/* \
26-
&& pip3 install --no-deps wheels/*.whl \
27-
&& rm -rf wheels
28-
29-
ENV HOME /qiling
34+
&& apt-get install -y --no-install-recommends unzip apt-utils \
35+
&& rm -rf /var/lib/apt/lists/* \
36+
&& pip3 install --no-deps --no-cache-dir dist/*.whl \
37+
&& rm -rf ./dist/
3038

31-
CMD bash
39+
CMD ["bash"]

0 commit comments

Comments
 (0)