fix(inject): set read_image_file_exec_options to 0

This commit is contained in:
es3n1n
2025-05-13 17:10:36 +09:00
parent 4c24a20988
commit 33202c4c8f
3 changed files with 37 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
#include "core/core.hpp"
#include "shared/defer.hpp"
#include "shared/native.hpp"
#include <print>
#include <stdexcept>
@@ -19,6 +21,9 @@ namespace loader {
.bInheritHandle = TRUE,
};
/// \xref: https://github.com/es3n1n/defendnot/issues/7#issuecomment-2874903650
native::get_peb()->read_image_file_exec_options = 0;
std::println("** booting {}", proc_name);
if (!CreateProcessA(nullptr, const_cast<char*>(proc_name.data()), &sa, &sa, FALSE, CREATE_SUSPENDED, nullptr, nullptr, &si, &pi)) {
throw std::runtime_error(std::format("unable to create process: {}", GetLastError()));