Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/nix/entrypoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
#include "../util/util.h"
#include "./plthook/plthook.h"

#if defined(__APPLE__)
#define PLTHOOK_OPEN_BY_HANDLE_OR_ADDRESS plthook_open_by_handle
#else
#define PLTHOOK_OPEN_BY_HANDLE_OR_ADDRESS plthook_open_by_address
#endif

void capture_mono_path(void *handle) {
char_t *result;
get_module_path(handle, &result, NULL, 0);
Expand Down Expand Up @@ -74,7 +80,7 @@ __attribute__((constructor)) void doorstop_ctor() {

void *unity_player = plthook_handle_by_name("UnityPlayer");

if (unity_player && plthook_open_by_handle(&hook, unity_player) == 0) {
if (unity_player && PLTHOOK_OPEN_BY_HANDLE_OR_ADDRESS(&hook, unity_player) == 0) {
LOG("Found UnityPlayer, hooking into it instead");
} else if (plthook_open(&hook, NULL) != 0) {
LOG("Failed to open current process PLT! Cannot run Doorstop! "
Expand Down