From f93c9a86e89e658c46b25a7571d8bff69ec7450f Mon Sep 17 00:00:00 2001
From: Striven <sg.striven@cutecat.club>
Date: Sat, 31 Jan 2026 18:36:44 +0000
Subject: [PATCH] Update minhook-zig, export minhook
---
src/hook_singleton.zig | 6 +++++-
build.zig.zon | 4 ++--
src/root.zig | 6 ++++--
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/build.zig.zon b/build.zig.zon
index 135fb59..5e5dc98 100644
--- a/build.zig.zon
+++ b/build.zig.zon
@@ -7,8 +7,8 @@
.hash = "zigwin32-25.0.28-preview-AAAAAGeI5ANWTScxLlUycxTkQN25FlWjLnrYPNBjImlH",
},
.minhook = .{
- .url = "git+https://github.com/ScapegoatHS/minhook-zig#b558d4e7021fba0e87008ab50927455f2ecdd8f8",
- .hash = "minhook-0.1.0-SLhoAxtHAAAVqUbG6KPQWPGA5sFaSCIO4VV226UkVwJI",
+ .url = "git+https://github.com/ScapegoatHS/minhook-zig#f5d7164c9931b122da4af44e61e9783fe8ba09d9",
+ .hash = "minhook-0.1.0-SLhoA2lHAAAYsR-f9ScFMlqsNAgi5DtCjsJCnCjF2KWO",
},
},
.paths = .{
diff --git a/src/hook_singleton.zig b/src/hook_singleton.zig
index 849fc70..aa7863d 100644
--- a/src/hook_singleton.zig
+++ b/src/hook_singleton.zig
@@ -4,7 +4,11 @@
const memory = @import("memory.zig");
-pub fn HookSingleton(comptime log_scope: @Type(.enum_literal), comptime function_ref: memory.Function, comptime detour_function: anytype) type {
+pub fn HookSingleton(
+ comptime log_scope: @Type(.enum_literal),
+ comptime function_ref: memory.Function,
+ comptime detour_function: anytype,
+) type {
return struct {
pub const scope = log_scope;
pub const log = std.log.scoped(log_scope);
diff --git a/src/root.zig b/src/root.zig
index df73da5..06fb287 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -1,9 +1,11 @@
+pub const minhook = @import("minhook");
+
pub const HookSingleton = @import("hook_singleton.zig").HookSingleton;
pub const memory = @import("memory.zig");
pub const Module = @import("Module.zig");
pub const Pattern = @import("Pattern.zig");
-comptime {
- _ = @import("Pattern.zig");
+pub fn init() !void {
+ try minhook.init();
}
--
Gitblit v1.10.0