mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
fix: unittest paths
This commit is contained in:
@@ -3,13 +3,13 @@ from typing import List
|
||||
import unittest
|
||||
import logging
|
||||
import os
|
||||
|
||||
from model.defs import *
|
||||
from model.exehost import ExeHost
|
||||
from phases.datareuse import ReusedataAsmFileParser
|
||||
|
||||
class DataReuseTest(unittest.TestCase):
|
||||
def test_relocation_list(self):
|
||||
exe_host = ExeHost("data/exes/7z.exe")
|
||||
exe_host = ExeHost(PATH_EXES + "7z.exe")
|
||||
exe_host.init()
|
||||
|
||||
relocs = exe_host.get_relocations_for_section(".rdata")
|
||||
@@ -22,7 +22,7 @@ class DataReuseTest(unittest.TestCase):
|
||||
|
||||
|
||||
def test_largestgap(self):
|
||||
exe_host = ExeHost("data/exes/7z.exe")
|
||||
exe_host = ExeHost(PATH_EXES + "7z.exe")
|
||||
exe_host.init()
|
||||
rm = exe_host.get_rdata_relocmanager()
|
||||
start, stop = rm.find_hole(100)
|
||||
|
||||
@@ -6,9 +6,9 @@ import logging
|
||||
from model.exehost import ExeHost
|
||||
from model.defs import *
|
||||
from pe.pehelper import extract_code_from_exe_file
|
||||
from helper import hexdump
|
||||
from utils import hexdump
|
||||
from observer import observer
|
||||
|
||||
from model.defs import *
|
||||
from pe.derbackdoorer import PeBackdoor
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@ class DerBackdoorerTest(unittest.TestCase):
|
||||
|
||||
def test_backdoor_ep(self):
|
||||
# Write example shellcode
|
||||
shellcode_path = "data/exes/shellcode.test"
|
||||
shellcode_path = PATH_EXES + "shellcode.test"
|
||||
shellcode = b"\x90" * 200
|
||||
with open(shellcode_path, "wb") as f:
|
||||
f.write(shellcode)
|
||||
|
||||
exe_path = "data/exes/iattest-full.exe"
|
||||
exe_out_path = "data/exes/iattest-full-test.exe"
|
||||
exe_path = PATH_EXES + "iattest-full.exe"
|
||||
exe_out_path = PATH_EXES + "iattest-full.test.exe"
|
||||
|
||||
shutil.copyfile(exe_path, exe_out_path)
|
||||
|
||||
@@ -59,12 +59,12 @@ class DerBackdoorerTest(unittest.TestCase):
|
||||
def test_backdoor_hijack(self):
|
||||
# Write example shellcode
|
||||
shellcode = b"\x90" * 200
|
||||
with open("data/exes/shellcode.test", "wb") as f:
|
||||
with open(PATH_EXES + "shellcode.test", "wb") as f:
|
||||
f.write(shellcode)
|
||||
|
||||
shellcode_path = "data/exes/shellcode.test"
|
||||
exe_path = "data/exes/7z.exe"
|
||||
exe_out_path = "data/exes/7z-test.exe"
|
||||
shellcode_path = PATH_EXES + "shellcode.test"
|
||||
exe_path = PATH_EXES + "7z.exe"
|
||||
exe_out_path = PATH_EXES + "7z.test.exe"
|
||||
|
||||
shutil.copyfile(exe_path, exe_out_path)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ from typing import List
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
from model.defs import *
|
||||
from pe.superpe import SuperPe
|
||||
from model.exehost import ExeHost
|
||||
from model.rangemanager import RangeManager
|
||||
@@ -22,7 +23,7 @@ class RangeManagerTest(unittest.TestCase):
|
||||
|
||||
|
||||
def test_relocmanager(self):
|
||||
exehost = ExeHost("data/exes/procexp64.exe")
|
||||
exehost = ExeHost(PATH_EXES + "procexp64.exe")
|
||||
exehost.init()
|
||||
section = exehost.superpe.get_section_by_name(".rdata")
|
||||
rm = exehost.get_rdata_relocmanager()
|
||||
|
||||
Reference in New Issue
Block a user