updated tamperUpx.py

This commit is contained in:
Mariusz B. / mgeeky 2022-08-26 10:26:22 +02:00
parent d697207e5f
commit 6aec7aea22

View File

@ -6,7 +6,12 @@ import os, sys
def tamperUpx(outfile): def tamperUpx(outfile):
pe = pefile.PE(outfile) pe = None
try:
pe = pefile.PE(outfile)
except:
print('[!] Input PE file corrupted. Unable to proceed.')
return False
newSectionNames = ( newSectionNames = (
'.text', '.text',
@ -144,6 +149,8 @@ def main(argv):
if tamperUpx(outfile): if tamperUpx(outfile):
print('[+] Success. UPX should have some issues decompressing output artifact now.') print('[+] Success. UPX should have some issues decompressing output artifact now.')
else:
print('[-] FAILED: Could not tamper input file.')
if __name__ == '__main__': if __name__ == '__main__':
main(sys.argv) main(sys.argv)