Created
November 6, 2021 16:47
-
-
Save yarshure/2ed55eb4391c04a1c5e9de0c83d40fc3 to your computer and use it in GitHub Desktop.
extract_pe_from_diags_body.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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