コード例 #1
0
def deobfuscate(
    vbs: SourceFile,
    level: int,
    rename_symbols: bool,
    classifier: Optional[ManglingClassifier] = None,
) -> Dict[str, AST]:
    program = Compiler.compile_file(vbs)
    deobfuscator = Deobfuscator(
        program,
        evaluation_level=level,
        rename_symbols=rename_symbols,
        mangling_classifier=classifier,
    )
    clean_asts = {
        module: deobfuscator.deobfuscate(ast)
        for module, ast in program.asts.items()
    }

    return clean_asts
コード例 #2
0
def compile_single_file(vbs: SourceFile) -> Result:
    return Compiler.compile_file(vbs).to_dict()
コード例 #3
0
def test_serialization_deserialization():
    program = Compiler.compile_file(source_path("interpreter_01"))
    serial = Serializer.serialize(program)
    deserial = Serializer.deserialize(serial)
    assert_equals(type(program), type(deserial))
    assert_equals(program.to_dict(), deserial.to_dict())