From 224d252e787ec27a8b33edca131bb412b940f873 Mon Sep 17 00:00:00 2001 From: Dobin Date: Sun, 18 Feb 2024 13:55:55 +0000 Subject: [PATCH] fix: cleanup temp files --- tests/test_derbackdoorer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_derbackdoorer.py b/tests/test_derbackdoorer.py index 6bcc5c5..11fd7f6 100644 --- a/tests/test_derbackdoorer.py +++ b/tests/test_derbackdoorer.py @@ -23,11 +23,11 @@ from derbackdoorer.derbackdoorer import PeBackdoor class DerBackdoorerTest(unittest.TestCase): def test_backdoor_ep(self): # Write example shellcode + shellcode_path = "exes/shellcode.test" shellcode = b"\x90" * 200 - with open("exes/shellcode.test", "wb") as f: + with open(shellcode_path, "wb") as f: f.write(shellcode) - shellcode_path = "exes/shellcode.test" exe_path = "exes/iattest-full.exe" exe_out_path = "exes/iattest-full-test.exe" @@ -48,6 +48,7 @@ class DerBackdoorerTest(unittest.TestCase): self.assertEqual(shellcode, extracted_code) os.remove(exe_out_path) + os.remove(shellcode_path) def test_backdoor_hijack(self):