Skip to content

Commit e786dd5

Browse files
committed
added safety
1 parent ac32ef7 commit e786dd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/yail.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ namespace yail
436436
const auto* shell_code_start = resolve_ilt(reinterpret_cast<void*>(&remote_shellcode));
437437
const auto* shell_code_end = resolve_ilt(reinterpret_cast<void*>(&remote_shellcode_end));
438438
auto size_of_shell_code = static_cast<std::size_t>(shell_code_end - shell_code_start);
439-
if (size_of_shell_code < 0x100)
440-
size_of_shell_code = 0x1000; // safety floor
439+
if (size_of_shell_code < 0x100 || size_of_shell_code > 0x1000)
440+
size_of_shell_code = 2400; // safety floor
441441

442442
constexpr std::size_t data_aligned = (sizeof(RemoteLoaderData) + 0xF) & ~0xF;
443443
const std::size_t total_shellcode = data_aligned + size_of_shell_code;

0 commit comments

Comments
 (0)