Module refinery.units.obfuscation.vba

A package containing deobfuscators for Visual Basic for Applications (VBA).

Expand source code Browse git
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A package containing deobfuscators for Visual Basic for Applications (VBA).
"""


def string_unquote(string: str) -> str:
    if string[0] != '"' or string[~0] != '"':
        raise ValueError(string)
    return string[1:-1].replace('""', '"')


def string_quote(string: str) -> str:
    return '"{}"'.format(string.replace('"', '""'))

Sub-modules

refinery.units.obfuscation.vba.all
refinery.units.obfuscation.vba.arithmetic
refinery.units.obfuscation.vba.brackets
refinery.units.obfuscation.vba.char
refinery.units.obfuscation.vba.comments
refinery.units.obfuscation.vba.concat
refinery.units.obfuscation.vba.constants
refinery.units.obfuscation.vba.dummies
refinery.units.obfuscation.vba.stringreplace
refinery.units.obfuscation.vba.stringreverse
refinery.units.obfuscation.vba.vba

Functions

def string_unquote(string)
Expand source code Browse git
def string_unquote(string: str) -> str:
    if string[0] != '"' or string[~0] != '"':
        raise ValueError(string)
    return string[1:-1].replace('""', '"')
def string_quote(string)
Expand source code Browse git
def string_quote(string: str) -> str:
    return '"{}"'.format(string.replace('"', '""'))