Created
May 30, 2020 07:00
-
-
Save kohnakagawa/136d395db998b8544e504874074b8ba8 to your computer and use it in GitHub Desktop.
LIEF rebuild PE
This file contains hidden or 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
import lief | |
lief.Logger.set_level(lief.LOGGING_LEVEL.DEBUG) | |
fileParsed = lief.parse("calc.exe") | |
builder = lief.PE.Builder(fileParsed) | |
# Configure it to rebuild and patch the imports | |
builder.build_imports(True).patch_imports(True) | |
# builder.build_imports(False).patch_imports(False) | |
# Build ! | |
builder.build() | |
# Save the result | |
builder.write("calc_patched.exe") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment