Skip to content

Commit

Permalink
Fix i386 encoder issue Gallopsled#1761
Browse files Browse the repository at this point in the history
Don't encode `avoid` parameter in `fiddler.py` if type is `bytearray`
  • Loading branch information
rhythmize committed Jan 16, 2021
1 parent 153b35b commit dfaa8be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MANIFEST
dist
venv
.vscode
.idea
*.egg-info
*.core
.coverage
Expand Down
2 changes: 1 addition & 1 deletion pwnlib/util/fiddling.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def xor_pair(data, avoid = b'\x00\n'):
if isinstance(data, six.integer_types):
data = packing.pack(data)

if not isinstance(avoid, bytes):
if not (isinstance(avoid, bytes) or isinstance(avoid, bytearray)):
avoid = avoid.encode('utf-8')

avoid = bytearray(avoid)
Expand Down

0 comments on commit dfaa8be

Please sign in to comment.