Gallopsled / Gallopsled/pwntools-tutorial

Python 3 Byte String

Offen
#8 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@Arusekk arbeitet bereits daran.

Seit 18.6.2020.

Vorherrschende Sprache
Jupyter Notebook
Sterne
1.6k
Forks
260
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I think this tutorial needs an update to conform the newest version of `pwntools`.

One example is on the **[Utility Function](https://github.com/Gallopsled/pwntools-tutorial/blob/master/utility.md)** tutorial page, section **[Packing and Unpacking Integers](https://github.com/Gallopsled/pwntools-tutorial/blob/master/utility.md#packing-and-unpacking-integers)**:

```py
...

hex(unpack('AAAA'))
# '0x41414141'

...
```

On `python3.5` with `pwntools==4.2.0dev` this will cause problem:

```
>>> from pwn import *
>>> unpack('AAAA')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/pwnlib/context/__init__.py", line 1461, in setter
return function(*a, **kw)
File "/usr/local/lib/python3.5/dist-packages/pwnlib/util/packing.py", line 221, in unpack
data = bytearray(data)
TypeError: an integer is required
```

Looking from the [commit](https://github.com/Gallopsled/pwntools/commit/57f0ebd7623a3792834888bdeefbb4c26f8c5f53#diff-4b262bbb0f689a006ecdad5f660ae812) history, it seems this function requires a byte string instead of normal string on Python 3. Since the last commit on this repo is a948b00 from Oct 10, 2018, I think it's time to have some update.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.