Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-jh committed Feb 10, 2023
2 parents 780b15a + 3802624 commit 4deaef9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ def charcode(text: bytes) -> Optional[bytes]:
@staticmethod
def charcode_hex(text: bytes) -> Optional[bytes]:
""" Replace hex character codes with the corresponding characters """
output = regex.sub(rb'(?i)(?:\\x|0x|%)([a-z0-9]{2})', lambda m: binascii.unhexlify(m.group(1)), text)
output = regex.sub(rb'(?i)(?:\\x|0x|%)([a-f0-9]{2})', lambda m: binascii.unhexlify(m.group(1)), text)
return output if output != text else None

@staticmethod
def charcode_unicode(text: bytes) -> Optional[bytes]:
""" Replace unicode character codes with the corresponding utf-8 byte sequence"""
output = regex.sub(rb'(?i)(?:\\u|%u)([a-z0-9]{4})', DeobfuScripter.codepoint_sub, text)
output = regex.sub(rb'(?i)(?:\\u|%u)([a-f0-9]{4})', DeobfuScripter.codepoint_sub, text)
return output if output != text else None

@staticmethod
Expand Down

0 comments on commit 4deaef9

Please sign in to comment.