Skip to content

Instantly share code, notes, and snippets.

@yarshure
Created November 6, 2021 16:47
Show Gist options
  • Save yarshure/2ed55eb4391c04a1c5e9de0c83d40fc3 to your computer and use it in GitHub Desktop.
Save yarshure/2ed55eb4391c04a1c5e9de0c83d40fc3 to your computer and use it in GitHub Desktop.
extract_pe_from_diags_body.py
# sudo pip install uefi_firmware
#python3 e.py input output
import sys
from uefi_firmware import efi_compressor
handle=open(sys.argv[1], "rb")
content=handle.read()
newc=content[7:]
c=efi_compressor.TianoDecompress(newc,len(newc))
d=open(sys.argv[2], "wb")
st_mz=c.find(b"MZ")
d.write(c[st_mz:])
d.close()
handle.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment