Skip to content

Commit

Permalink
Merge pull request #34 from CybercentreCanada/replace_substring
Browse files Browse the repository at this point in the history
Bugfix: Check if substring exists in substitution
  • Loading branch information
cccs-rs authored Aug 17, 2022
2 parents 909e3cf + 577fbf9 commit bee4b83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def string_replace(text: bytes) -> Optional[bytes]:
# Execute the substitution
substitute = substitute.replace(str1, str2)
# Remove the replace calls from the layer (prevent accidental substitutions in the next step)
substitute = substitute[:substitute.lower().index(b'.replace(')]
if b'.replace(' in substitute.lower():
substitute = substitute[:substitute.lower().index(b'.replace(')]
output = output.replace(strreplace, substitute)

# Process global string replace
Expand Down

0 comments on commit bee4b83

Please sign in to comment.