Skip to content

Commit bab6a8d

Browse files
Merge remote-tracking branch 'github/dev' into fix-fmstr-no-revert
2 parents 5ef7945 + a76db16 commit bab6a8d

File tree

696 files changed

+8181
-2705
lines changed

Some content is hidden

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

696 files changed

+8181
-2705
lines changed

.github/ISSUE_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thanks for contributing to Pwntools!
44

55
When reporting an issue, be sure that you are running the latest released version of pwntools (`pip install --upgrade pwntools`).
66

7-
Please verify that your issue occurs on 64-bit Ubuntu 14.04. You can use the Dockerfile on `docker.io` for quick testing.
7+
Please verify that your issue occurs on 64-bit Ubuntu 22.04. You can use the Dockerfile on `docker.io` for quick testing.
88

99
```
1010
$ docker pull pwntools/pwntools:stable

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You should see `[DEBUG]` statements that show what's happening behind the scenes
3939

4040
## Verify on Ubuntu
4141

42-
If possible, please verify that your issue occurs on 64-bit Ubuntu 18.04. We provide a Dockerfile based on Ubuntu 18.04 via `docker.io` to make this super simple, no VM required!
42+
If possible, please verify that your issue occurs on 64-bit Ubuntu 22.04. We provide a Dockerfile based on Ubuntu 22.04 via `docker.io` to make this super simple, no VM required!
4343

4444
```sh
4545
# Download the Docker image

.github/workflows/android.yml

-70
This file was deleted.

.github/workflows/ci.yml

+150-31
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,25 @@ jobs:
55
test:
66
strategy:
77
matrix:
8-
python_version: ['3.10', '3.12']
8+
python_version: ['3.10', '3.12', '3.13']
99
os: [ubuntu-latest]
10-
include:
11-
- python_version: '2.7'
12-
os: ubuntu-22.04
1310
runs-on: ${{ matrix.os }}
1411
timeout-minutes: 30
12+
services:
13+
libcdb-cache:
14+
image: nginx
15+
volumes:
16+
- /home/runner/libcdb-cache:/var/cache/nginx
17+
ports:
18+
- 3000:3000 # https://debuginfod.elfutils.org proxy cache
19+
- 3001:3001 # https://libc.rip/ proxy cache
20+
- 3002:3002 # http://archive.ubuntu.com/ proxy cache
21+
- 3003:3003 # https://gitlab.com/ proxy cache
22+
env:
23+
DEBUGINFOD_URLS: http://localhost:3000/
24+
PWN_LIBCRIP_URL: http://localhost:3001/
25+
PWN_UBUNTU_ARCHIVE_URL: http://localhost:3002/
26+
PWN_GITLAB_LIBCDB_URL: http://localhost:3003/
1527
steps:
1628
- uses: actions/checkout@v4
1729
with:
@@ -22,6 +34,28 @@ jobs:
2234
git fetch origin
2335
git log --oneline --graph -10
2436
37+
- name: Fix libcdb-cache permissions
38+
id: fix-perms
39+
run: |
40+
sudo chown -R runner:runner /home/runner/libcdb-cache
41+
echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
42+
43+
- name: Cache for libcdb requests
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/libcdb-cache
47+
key: libcdb-python${{ matrix.python_version }}-${{ steps.fix-perms.outputs.date }}
48+
restore-keys: |
49+
libcdb-python${{ matrix.python_version }}-
50+
libcdb-
51+
52+
- name: Install libcdb-cache service config
53+
run: |
54+
sudo chown -R 101:101 /home/runner/libcdb-cache
55+
container_id=$(docker ps --all --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
56+
docker cp ./travis/libcdb_nginx_cache.conf $container_id:/etc/nginx/nginx.conf
57+
docker restart $container_id
58+
2559
- name: Install RPyC for gdb
2660
run: |
2761
# The version packaged in python3-rpyc is too old on Ubuntu 24.04
@@ -30,17 +64,7 @@ jobs:
3064
/usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc
3165
gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
3266
33-
- name: Cache for pip
34-
uses: actions/cache@v4
35-
if: matrix.python_version == '2.7'
36-
id: cache-pip
37-
with:
38-
path: ~/.cache/pip
39-
key: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }}
40-
restore-keys: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-
41-
4267
- name: Set up Python ${{ matrix.python_version }}
43-
if: matrix.python_version != '2.7'
4468
uses: actions/setup-python@v5
4569
with:
4670
python-version: ${{ matrix.python_version }}
@@ -49,17 +73,6 @@ jobs:
4973
**/pyproject.toml
5074
**/requirements*.txt
5175
52-
- name: Set up Python 2.7
53-
if: matrix.python_version == '2.7'
54-
run: |
55-
sudo apt-get update
56-
sudo apt-get install -y \
57-
python2.7 python2.7-dev python2-pip-whl
58-
sudo ln -sf python2.7 /usr/bin/python
59-
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
60-
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
61-
sudo chown -R $USER /usr/local/lib/python2.7
62-
6376
6477
- name: Verify tag against version
6578
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
@@ -89,11 +102,12 @@ jobs:
89102
binutils-s390x-linux-gnu \
90103
binutils-sparc64-linux-gnu \
91104
binutils-riscv64-linux-gnu \
105+
binutils-loongarch64-linux-gnu \
92106
gcc-multilib \
93107
libc6-dbg \
94108
elfutils \
95109
patchelf
96-
110+
97111
- name: Testing Corefiles
98112
run: |
99113
ulimit -a
@@ -119,10 +133,6 @@ jobs:
119133
- name: Install documentation dependencies
120134
run: pip install -r docs/requirements.txt
121135

122-
- name: Manually install non-broken Unicorn
123-
if: matrix.python_version == '2.7'
124-
run: pip install unicorn==2.0.0rc7
125-
126136
- name: Disable yama ptrace_scope
127137
run: |
128138
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope # required by some gdb doctests
@@ -208,7 +218,6 @@ jobs:
208218
pwn libcdb hash b229d1da1e161f95e839cf90cded5f719e5de308
209219
210220
- name: Build source and wheel distributions
211-
if: matrix.python_version != '2.7'
212221
run: |
213222
python -m build
214223
@@ -225,6 +234,116 @@ jobs:
225234
path: .coverage*
226235
include-hidden-files: true
227236

237+
- name: Fix libcdb-cache permissions
238+
run: |
239+
container_id=$(docker ps --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
240+
docker stop $container_id
241+
sudo chown -R runner:runner /home/runner/libcdb-cache
242+
243+
android-test:
244+
runs-on: ubuntu-latest
245+
timeout-minutes: 30
246+
continue-on-error: true
247+
steps:
248+
- uses: actions/checkout@v4
249+
250+
- name: Set up Python 3.12
251+
uses: actions/setup-python@v5
252+
with:
253+
python-version: '3.12'
254+
cache: 'pip'
255+
cache-dependency-path: |
256+
**/pyproject.toml
257+
**/requirements*.txt
258+
259+
- name: Install Linux dependencies
260+
run: |
261+
sudo apt-get update
262+
sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
263+
gdb gdbserver socat \
264+
qemu-user-static \
265+
binutils-aarch64-linux-gnu \
266+
binutils-arm-linux-gnueabihf \
267+
libc6-dbg
268+
269+
- name: Cache for avd
270+
uses: actions/cache@v4
271+
id: cache-avd
272+
with:
273+
path: |
274+
~/.android
275+
/usr/local/lib/android/sdk/emulator
276+
/usr/local/lib/android/sdk/platform-tools
277+
/usr/local/lib/android/sdk/system-images
278+
key: ${{ matrix.os }}-cache-avd-${{ hashFiles('travis/setup_avd*.sh') }}
279+
restore-keys: |
280+
${{ matrix.os }}-cache-avd-
281+
282+
- name: Install Android AVD
283+
run: |
284+
sudo usermod -aG kvm $USER
285+
source travis/setup_avd_fast.sh
286+
sed -i 's/skip_android = True/skip_android = False/' docs/source/conf.py
287+
set | grep ^PATH >.android.env
288+
289+
- name: Install dependencies
290+
run: |
291+
pip install --upgrade pip
292+
pip install --upgrade wheel build
293+
pip install --upgrade flake8 appdirs
294+
pip install --upgrade --editable .
295+
296+
- name: Sanity checks
297+
run: PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)'
298+
299+
- name: Install documentation dependencies
300+
run: pip install -r docs/requirements.txt
301+
302+
- name: Coverage Doctests (Android Only)
303+
run: |
304+
source .android.env
305+
PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest docs/source/adb.rst
306+
307+
- uses: actions/upload-artifact@v4
308+
with:
309+
name: coverage-android
310+
path: .coverage*
311+
include-hidden-files: true
312+
313+
windows-test:
314+
runs-on: windows-latest
315+
timeout-minutes: 30
316+
continue-on-error: true
317+
steps:
318+
- uses: actions/checkout@v4
319+
320+
- name: Set up Python 3.12
321+
uses: actions/setup-python@v5
322+
with:
323+
python-version: '3.12'
324+
325+
- name: Install dependencies
326+
run: |
327+
pip install --upgrade pip
328+
pip install --upgrade --editable .
329+
330+
- name: Install documentation dependencies
331+
run: pip install -r docs/requirements.txt
332+
333+
- name: Sanity checks
334+
run: |
335+
python -bb -c 'from pwn import *'
336+
python -bb examples/text.py
337+
338+
- name: Coverage doctests
339+
run: |
340+
python -bb -m coverage run -m sphinx -b doctest docs/source docs/build/doctest
341+
342+
- uses: actions/upload-artifact@v4
343+
with:
344+
name: coverage-windows
345+
path: .coverage*
346+
include-hidden-files: true
228347

229348
upload-coverage:
230349
runs-on: ubuntu-latest

.github/workflows/pylint.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ jobs:
2626
set -x
2727
pip install pylint
2828
pip install --upgrade -e .
29-
pylint --exit-zero --errors-only pwnlib -f parseable | cut -d ' ' -f2- > current.txt
29+
run_pylint() { pylint --exit-zero --errors-only pwnlib -f parseable | cut -d ' ' -f2- | sed 's/line [0-9]\+/line XXXX/g'; }
30+
run_pylint > current.txt
3031
git fetch origin
3132
git checkout origin/"$GITHUB_BASE_REF"
32-
pylint --exit-zero --errors-only pwnlib -f parseable | cut -d ' ' -f2- > base.txt
33+
run_pylint > base.txt
3334
if diff base.txt current.txt | grep '>'; then
3435
false
3536
fi

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 2
55
build:
66
os: ubuntu-22.04
77
tools:
8-
python: "3"
8+
python: "3.12"
99

1010
sphinx:
1111
configuration: docs/source/conf.py

0 commit comments

Comments
 (0)