Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed a invalid escape #2

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gdb_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
q
q
clear
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ PEDA - Python Exploit Development Assistance for GDB

```sh
sudo pacman -S python-six # arch
sudo apt install python-siz # debian
sudo apt install python3-six # debian distros
sudo dnf python3-six dnf # fedodra / Cent / RHEL
```

- clone repository
Expand Down
2 changes: 1 addition & 1 deletion lib/nasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def nasm2shellcode(asmcode):
return ""

shellcode = []
pattern = re.compile("([0-9A-F]{8})\s*([^\s]*)\s*(.*)")
pattern = re.compile(r"([0-9A-F]{8})\s*([^\s]*)\s*(.*)")

matches = pattern.findall(asmcode)
for line in asmcode.splitlines():
Expand Down
7 changes: 3 additions & 4 deletions lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def format_disasm_code(code, nearby=None):
result += line + "\n"
else:
color = style = None
m = re.search(".*(0x[^ ]*).*:\s*([^ ]*)", line)
m = re.search(r".*(0x[^ ]*).*:\s*([^ ]*)", line)
if not m: # failed to parse
result += line + "\n"
continue
Expand All @@ -540,7 +540,7 @@ def format_disasm_code(code, nearby=None):
break

prefix = line.split(":\t")[0]
addr = re.search("(0x[^\s]*)", prefix)
addr = re.search(r"(0x[^\s]*)", prefix)
if addr:
addr = to_int(addr.group(1))
else:
Expand Down Expand Up @@ -589,8 +589,7 @@ def cyclic_pattern_charset(charset_type=None):
charset[2] = "sn()" + charset[2]

if charset_type == 2: # maximum type
charset += ['!"#$%&\()*+,-./:;<=>?@[]^_{|}~'] # string.punctuation

charset += [r'!"#$%&\()*+,-./:;<=>?@[]^_{|}~'] # string.punctuation
mixed_charset = mixed = ''
k = 0
while True:
Expand Down