Skip to content

Commit

Permalink
fix injector: add some error processing
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice committed Jun 7, 2022
1 parent 63c7a76 commit 75efec4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/injector/injector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ struct injector {
std::wstring_view filename) {
handle mapping =
create_mapping(get_port_mapping_name(pid), sizeof(std::uint16_t));
if (!mapping) {
return false;
}

mapped_buffer port_buf(mapping.get());
*(std::uint16_t *)port_buf.get() = port;
Expand All @@ -78,6 +81,9 @@ struct injector {
#else
load_library;
#endif
if (!current_load_library) {
return false;
}

handle thread = CreateRemoteThread(
proc, nullptr, 0, (LPTHREAD_START_ROUTINE)current_load_library,
Expand Down

0 comments on commit 75efec4

Please sign in to comment.