(OLD) Process and function hooking library for Windows
Striven
2026-02-20 4bd7cd564db8876de3c683d472ea87b4373d961e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const std = @import("std");
 
pub fn build(b: *std.Build) !void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});
 
    const zigwin32_dependency = b.dependency("zigwin32", .{});
    const minhook_dependency = b.dependency("minhook", .{});
 
    const process_module = b.addModule("blame", .{
        .root_source_file = b.path("src/root.zig"),
        .target = target,
        .optimize = optimize,
        .imports = &.{
            .{ .name = "win32", .module = zigwin32_dependency.module("win32") },
            .{ .name = "minhook", .module = minhook_dependency.module("minhook") },
        },
    });
 
    process_module.linkSystemLibrary("Advapi32", .{});
    process_module.linkLibrary(minhook_dependency.artifact("minhook"));
 
    const test_exe = b.addTest(.{
        .root_module = process_module,
    });
 
    const test_step = b.step("test", "");
    test_step.dependOn(&b.addRunArtifact(test_exe).step);
}