Skip to content

Commit

Permalink
More Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraTenshi committed Dec 5, 2023
1 parent a138753 commit b8d5ae4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions zig-bait/detour.zig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn restore(opt: *option.detour.Option) void {
pub fn init(alloc: Allocator, target_ptr: anytype, victim_address: usize, comptime total_size: usize) interface.Hook {
tools.checkIsFnPtr(target_ptr);

const opt = option.detour.Option.init(alloc, target_ptr, victim_address, total_size);
const self = interface.Hook.init(&hook, &restore, option.Option{ .detour = opt });
const opt = option.detour.Option.init(alloc, target_ptr, victim_address, total_size, &hook, &restore);
const self = interface.Hook.init(option.Option{ .detour = opt });
return self;
}
2 changes: 1 addition & 1 deletion zig-bait/option/detour.zig
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ pub const Option = struct {
alloc: Allocator,
target_ptr: anytype,
victim_address: usize,
comptime total_size: usize,
hook: HookFunc,
restore: RestoreFunc,
comptime total_size: usize,
) Option {
return Option{
.ops = null,
Expand Down
2 changes: 1 addition & 1 deletion zig-bait/safe_vmt.zig
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ fn restore(opt: *option.safe_vmt.Option) void {

pub fn init(alloc: Allocator, base_class: tools.AbstractClass, comptime positions: []const usize, targets: []const usize) !interface.Hook {
const opt = try option.safe_vmt.Option.init(alloc, base_class, positions, targets, &hook, &restore);
const self = interface.Hook.init(opt);
const self = interface.Hook.init(option.Option{ .safe_vmt = opt });
return self;
}
2 changes: 1 addition & 1 deletion zig-bait/vmt.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ fn restore(opt: *option.vmt.Option) void {

pub fn init(alloc: Allocator, base_class: tools.AbstractClass, comptime positions: []const usize, targets: []const usize) !interface.Hook {
const opt = try option.vmt.VmtOption.init(alloc, base_class, positions, targets, &hook, &restore);
const self = interface.Hook.init(opt);
const self = interface.Hook.init(option.Option{ .vmt = opt });
return self;
}

0 comments on commit b8d5ae4

Please sign in to comment.