Skip to content

Instantly share code, notes, and snippets.

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
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":