refactor: move working directory to projects/ for web

This commit is contained in:
Dobin
2024-03-29 19:18:57 +00:00
parent a6dbbe69ac
commit 70eb0bf798
16 changed files with 468 additions and 50 deletions
+2 -1
View File
@@ -10,12 +10,13 @@ VerifyFilename: FilePath = r'C:\Temp\a'
# Directory structure
PATH_EXES = "data/binary/exes/"
PATH_SHELLCODES = "data/binary/shellcodes/"
PATH_CARRIER = "data/source/carrier/"
PATH_PEB_WALK = "data/source/carrier/peb_walk/"
PATH_IAT_REUSE = "data/source/carrier/iat_reuse/"
PATH_PAYLOAD = "data/source/payload/"
PATH_DECODER = "data/source/carrier/decoder/"
PATH_WEB_PROJECT = "app/projects/" # web only
PATH_WEB_PROJECT = "projects/"
# Correlated with real template files
+13 -3
View File
@@ -2,7 +2,7 @@ from model.defs import *
class Settings():
def __init__(self):
def __init__(self, web=""):
self.payload_path: FilePath = ""
# Settings
@@ -29,10 +29,20 @@ class Settings():
def prep(self):
self.main_dir = "data/source/carrier/" + self.source_style.value + "/"
self.main_dir = "{}{}/".format(PATH_CARRIER, self.source_style.value)
self.template_path = self.main_dir + "template.c"
self.main_c_path = self.main_dir + "main.c"
self.main_asm_path = self.main_dir + "main.asm"
self.main_exe_path = self.main_dir + "main.exe"
self.main_shc_path = self.main_dir + "main.bin"
def prep_web(self, project_name):
self.main_dir = "{}{}/".format(PATH_WEB_PROJECT, project_name)
self.template_path = self.main_dir + "template.c"
self.main_c_path = self.main_dir + "main.c"
self.main_asm_path = self.main_dir + "main.asm"
self.main_exe_path = self.main_dir + "main.exe"
self.main_shc_path = self.main_dir + "main.bin"
self.inject_exe_out = "{}{}".format(
self.main_dir, os.path.basename(self.inject_exe_in).replace(".exe", ".infected.exe"))