(cert, exe, output)
| 117 | |
| 118 | |
| 119 | def writeCert(cert, exe, output): |
| 120 | flItms = gather_file_info_win(exe) |
| 121 | |
| 122 | if not output: |
| 123 | output = output = str(exe) + "_signed" |
| 124 | |
| 125 | shutil.copy2(exe, output) |
| 126 | |
| 127 | print("Output file: {0}".format(output)) |
| 128 | |
| 129 | with open(exe, 'rb') as g: |
| 130 | with open(output, 'wb') as f: |
| 131 | f.write(g.read()) |
| 132 | f.seek(0) |
| 133 | f.seek(flItms['CertTableLOC'], 0) |
| 134 | f.write(struct.pack("<I", len(open(exe, 'rb').read()))) |
| 135 | f.write(struct.pack("<I", len(cert))) |
| 136 | f.seek(0, io.SEEK_END) |
| 137 | f.write(cert) |
| 138 | |
| 139 | print("Signature appended. \nFIN.") |
| 140 | |
| 141 | |
| 142 | def outputCert(exe, output): |
no test coverage detected