25 lines
733 B
Python
25 lines
733 B
Python
# Full brotli extraction of embedded frontend assets from Haze.exe
|
|
import brotli, os
|
|
exe = open(os.path.expandvars(r"%LOCALAPPDATA%\Programs\Haze\Haze.exe"),'rb').read()
|
|
os.makedirs('front2', exist_ok=True)
|
|
i = exe.find(b'/assets/index-')
|
|
start = max(0, i-3_000_000)
|
|
count=0
|
|
off=0
|
|
limit=min(34_000_000, len(exe)-start)
|
|
while off < limit:
|
|
try:
|
|
d=brotli.Decompressor()
|
|
out=d.process(exe[start+off:start+off+30_000_000])
|
|
if len(out)>50_000:
|
|
p=f'front2/blob_{off}.bin'
|
|
open(p,'wb').write(out)
|
|
print(p, len(out), flush=True)
|
|
count+=1
|
|
off += max(1,len(out)//10)
|
|
continue
|
|
except Exception:
|
|
pass
|
|
off+=1
|
|
print('blobs:',count)
|