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

Function signfile

sign/sigthief.py:191–212  ·  view source on GitHub ↗
(exe, sigfile, output)

Source from the content-addressed store, hash-verified

189
190
191def signfile(exe, sigfile, output):
192 flItms = gather_file_info_win(exe)
193
194 cert = open(sigfile, 'rb').read()
195
196 if not output:
197 output = output = str(exe) + "_signed"
198
199 shutil.copy2(exe, output)
200
201 print("Output file: {0}".format(output))
202
203 with open(exe, 'rb') as g:
204 with open(output, 'wb') as f:
205 f.write(g.read())
206 f.seek(0)
207 f.seek(flItms['CertTableLOC'], 0)
208 f.write(struct.pack("<I", len(open(exe, 'rb').read())))
209 f.write(struct.pack("<I", len(cert)))
210 f.seek(0, io.SEEK_END)
211 f.write(cert)
212 print("Signature appended. \nFIN.")
213
214
215if __name__ == "__main__":

Callers 1

sigthief.pyFile · 0.85

Calls 1

gather_file_info_winFunction · 0.85

Tested by

no test coverage detected