@@ -6,7 +6,6 @@ const alloc = root.alloc;
66const util = root .util ;
77
88const plthook = @import ("plthook" );
9- const plthook_ext = @import ("nix/plthook_ext.zig" );
109const iatHook = if (builtin .os .tag == .windows ) @import ("windows/iat_hook.zig" ).iatHook ;
1110
1211const nix = if (builtin .os .tag != .windows ) @import ("nix/hooks.zig" );
@@ -105,7 +104,7 @@ fn tryPltHook(hook: *plthook.c.plthook_t, funcname: [:0]const u8, funcaddr: *any
105104}
106105
107106pub fn installHooksNix () callconv (.c ) void {
108- const hook = plthook_ext . plthook_open_by_filename ( "UnityPlayer" ) catch | e | {
107+ const hook = plthook . openByFilename ( comptime "UnityPlayer" ++ builtin . os . tag . dynamicLibSuffix () ) catch | e | {
109108 const s : [* :0 ]const u8 = switch (e ) {
110109 error .FileNotFound = > "FileNotFound" ,
111110 else = > plthook .c .plthook_error (),
@@ -136,7 +135,7 @@ pub fn installHooksNix() callconv(.c) void {
136135 if (plthook .c .plthook_replace (hook , "mono_jit_init_version" , @constCast (& bootstrap .init_mono ), null ) != 0 ) {
137136 root .logger .err ("Failed to hook mono_jit_init_version. Error: {s}" , .{plthook .c .plthook_error ()});
138137 } else {
139- const mono_handle = plthook_ext . macos . plthook_handle_by_filename ( "libmono" );
138+ const mono_handle = plthook . system . handleByFilename ( comptime "libmono" ++ builtin . os . tag . dynamicLibSuffix () );
140139 if (mono_handle ) | handle | {
141140 runtimes .mono .load (handle );
142141 }
0 commit comments