def main()

in cortado/rtas/sevenzip_encrypted.py [0:0]


def main():
    password = "s0l33t"

    # create 7z.exe with not-7zip name, and exfil
    svnz2 = Path("a.exe").resolve()
    sevenzip_exe_path = _common.get_resource_path(SEVENZIP_EXE)
    _common.copy_file(sevenzip_exe_path, svnz2)
    exfil = create_exfil()

    exts = ["7z", "zip", "gzip", "tar", "bz2", "bzip2", "xz"]
    out_jpg = Path("out.jpg").resolve()

    for ext in exts:
        # Write archive for each type
        out_file = Path("out." + ext).resolve()
        _ = _common.execute_command([str(svnz2), "a", str(out_file), "-p" + password, str(exfil)])
        _common.remove_file(out_file)

        # Write archive for each type with -t flag
        if ext == "bz2":
            continue

        _ = _common.execute_command([str(svnz2), "a", str(out_jpg), "-p" + password, "-t" + ext, str(exfil)])
        _common.remove_file(out_jpg)

    _ = _common.execute_command([str(sevenzip_exe_path), "a", str(out_jpg), "-p" + password, str(exfil)])
    _common.remove_files([exfil, svnz2, out_jpg])