logger.warning("Cannot deobfuscate block[blocked]='%s',blocker='%s',software='%s' - SKIPPED!", block["blocked"], blocker, software)
if not obfuscation.is_added(block["blocked"]):
- logger.debug("Invoking add(%s)", block["blocked"])
+ logger.debug("Invoking obfuscation.add(%s) ...", block["blocked"])
obfuscation.add(block["blocked"])
+ else:
+ logger.debug("Invoking obfuscation.update(%s) ...", block["blocked"])
+ obfuscation.update(block["blocked"])
continue
logger.warning("Cannot deobfuscate block[blocked]='%s',blocker='%s',software='%s' - SKIPPED!", block["blocked"], blocker, software)
if not obfuscation.is_added(block["blocked"]):
- logger.debug("Invoking add(%s)", block["blocked"])
+ logger.debug("Invoking obfuscation.add(%s) ...", block["blocked"])
obfuscation.add(block["blocked"])
+ else:
+ logger.debug("Invoking obfuscation.update(%s) ...", block["blocked"])
+ obfuscation.update(block["blocked"])
continue
logger.debug("EXIT!")
+def update (pattern: str) -> None:
+ logger.debug("pattern='%s' - CALLED!", pattern)
+ if not isinstance(pattern, str):
+ raise ValueError(f"pattern[]='{type(pattern)}' is not of type 'str'")
+ elif pattern == "":
+ raise ValueError("Parametern 'pattern' is an empty string")
+ elif not is_added(pattern):
+ raise Exception(f"pattern='{pattern}' is not added but function was invoked")
+
+ database.cursor.execute("UPDATE obfuscation SET last_used=? WHERE pattern=? LIMIT 1", (
+ time.time(),
+ pattern
+ ))
+
+ logger.debug("EXIT!")
+
def delete (pattern: str) -> None:
logger.debug("pattern='%s' - CALLED!", pattern)
if not isinstance(pattern, str):