Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macos support. Fix run script. #27

Merged
merged 2 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
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
15 changes: 12 additions & 3 deletions assets/nix/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,18 @@ doorstop_directory="${BASEDIR}/"
doorstop_name="libdoorstop.${lib_extension}"

export LD_LIBRARY_PATH="${doorstop_directory}:${corlib_dir}:${LD_LIBRARY_PATH}"
export LD_PRELOAD="${doorstop_name}:${LD_PRELOAD}"
export DYLD_LIBRARY_PATH="${doorstop_directory}:${corlib_dir}:${DYLD_LIBRARY_PATH}"
export DYLD_INSERT_LIBRARIES="${doorstop_name}:${DYLD_INSERT_LIBRARIES}"
if [ -z "$LD_PRELOAD" ]; then
export LD_PRELOAD="${doorstop_name}"
else
export LD_PRELOAD="${doorstop_name}:${LD_PRELOAD}"
fi

export DYLD_LIBRARY_PATH="${doorstop_directory}:${DYLD_LIBRARY_PATH}"
if [ -z "$DYLD_INSERT_LIBRARIES" ]; then
export DYLD_INSERT_LIBRARIES="${doorstop_name}"
else
export DYLD_INSERT_LIBRARIES="${doorstop_name}:${DYLD_INSERT_LIBRARIES}"
fi

# shellcheck disable=SC2086
exec "$executable_path" $rest_args
3 changes: 1 addition & 2 deletions src/nix/entrypoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ __attribute__((constructor)) void doorstop_ctor() {

void *unity_player = plthook_handle_by_name("UnityPlayer");

// TODO: Chekc if this still works on macOS
if (unity_player && plthook_open_by_address(&hook, unity_player) == 0) {
if (unity_player && plthook_open_by_handle(&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