This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import lxml.etree as ET | |
import olefile | |
import magic | |
from io import BytesIO | |
from oletools import oleobj | |
from oletools.olevba3 import VBA_Parser | |
from operator import itemgetter | |
from zipfile import ZipFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binascii | |
import re | |
def rtf_to_text(rtf): | |
def clear_cmd(rtf_parsed): | |
if rtf_parsed.get("cmd") == "f" and rtf_parsed.get("lvl") == 1: | |
encoding = rtf_parsed.get("fonts").get(rtf_parsed.get("cmd") + rtf_parsed.get("arg"), {}).get("encoding", "1252") | |
rtf_parsed["encoding"] = encoding | |
elif rtf_parsed.get("cmd") == "ansicpg": |
OlderNewer