MCPcopy Create free account
hub / github.com/echQoQ/RustSL / writeCert

Function writeCert

sign/sigthief.py:119–139  ·  view source on GitHub ↗
(cert, exe, output)

Source from the content-addressed store, hash-verified

117
118
119def 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
142def outputCert(exe, output):

Callers 1

sigthief.pyFile · 0.85

Calls 1

gather_file_info_winFunction · 0.85

Tested by

no test coverage detected