Skip to content

Commit

Permalink
Merge pull request #2 from punixcorn/syntax-errors
Browse files Browse the repository at this point in the history
fixed a invalid escape
  • Loading branch information
punixcorn authored Jul 7, 2024
2 parents 575022a + f54a64e commit 7b1a172
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
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

0 comments on commit 7b1a172

Please sign in to comment.