feature: templates, project

This commit is contained in:
Dobin
2024-02-10 13:43:35 +00:00
parent 1eba815e93
commit 72e4c4ffe5
13 changed files with 276 additions and 218 deletions
+16 -2
View File
@@ -5,9 +5,10 @@ import shutil
import pathlib
import sys
import pefile
import glob
from config import config
from project import project
SHC_VERIFY_SLEEP = 0.1
@@ -94,7 +95,10 @@ def run_process_checkret(args):
print(ret.stdout)
print(ret.stderr)
raise Exception("Command failed")
if project.show_command_output:
print("> " + " ".join(args))
print(ret.stdout)
print(ret.stderr)
def try_start_shellcode(shc_file):
print("--[ Blindly execute shellcode: {} ]".format(shc_file))
@@ -114,3 +118,13 @@ def file_readall_binary(filepath) -> bytes:
with open(filepath, "rb") as f:
data = f.read()
return data
def delete_all_files_in_directory(directory_path):
files = glob.glob(os.path.join(directory_path, '*'))
for file_path in files:
try:
os.remove(file_path)
#print(f"Deleted {file_path}")
except Exception as e:
print(f"Error deleting {file_path}: {e}")