pwntools
pwntools copied to clipboard
Fix inconsistent comparison of sets in encode when using regular expression
In this code:
67 if expr:
68 for char in all_chars:
69 if re.search(expr, char):
70 avoid.add(char)
which make avoid something like {'a', 'b'}
.
But set()
of bytes would be {some ints}
.
This will invalidate the following conditions because they can never intersect:
79 if encoder.blacklist & avoid:
...
87 if avoid & set(v):
Thank you! Current implementation of shellcode encoders is a mess in general, so I will take a look at it later.