| 208 | return dst_file |
| 209 | |
| 210 | def _sign_executable(self, dst_file): |
| 211 | app_path = self.params['sign_app'] |
| 212 | if not app_path: |
| 213 | raise ValueError('No path selected for the spoofed application!') |
| 214 | |
| 215 | sign_out_file = dst_file[:-4] + '_signed.exe' |
| 216 | sign_cmd = [ |
| 217 | sys.executable, |
| 218 | os.path.join('sign', 'sigthief.py'), |
| 219 | '-i', app_path, |
| 220 | '-t', dst_file, |
| 221 | '-o', sign_out_file |
| 222 | ] |
| 223 | |
| 224 | result = subprocess.run(sign_cmd, capture_output=True, text=True, encoding='utf-8', errors='ignore', check=True) |
| 225 | self.log_signal.emit(result.stdout) |
| 226 | if result.stderr: |
| 227 | self.log_signal.emit(result.stderr) |
| 228 | |
| 229 | shutil.move(sign_out_file, dst_file) |
| 230 | self.log_signal.emit(f'Spoofed signature completed: {dst_file}') |