feature: check if payload fits in code section

This commit is contained in:
Dobin
2024-02-17 19:44:52 +00:00
parent 3bb7562bfa
commit 16f4300d62
5 changed files with 17 additions and 3 deletions
+7
View File
@@ -200,6 +200,13 @@ def start():
# inject merged loader into an exe
exit_code = 0
if project.inject:
l = len(file_readall_binary(main_shc_file))
if l + 128 > project.exe_info.code_size:
logger.error("Error: Shellcode {}+128 too small for target code section {}".format(
l, project.exe_info.code_size
))
return
phases.injector.inject_exe(
shellcode_in = main_shc_file,
exe_in = project.inject_exe_in,