From 6aec7aea229f69ebd3fa9fe73796dc75805c6a4f Mon Sep 17 00:00:00 2001 From: "Mariusz B. / mgeeky" Date: Fri, 26 Aug 2022 10:26:22 +0200 Subject: [PATCH] updated tamperUpx.py --- file-formats/tamperUpx.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/file-formats/tamperUpx.py b/file-formats/tamperUpx.py index 01b7542..55e2a22 100644 --- a/file-formats/tamperUpx.py +++ b/file-formats/tamperUpx.py @@ -6,7 +6,12 @@ import os, sys 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 = ( '.text', @@ -144,6 +149,8 @@ def main(argv): if tamperUpx(outfile): print('[+] Success. UPX should have some issues decompressing output artifact now.') + else: + print('[-] FAILED: Could not tamper input file.') if __name__ == '__main__': - main(sys.argv) \ No newline at end of file + main(sys.argv)