Skip to content

Commit

Permalink
fix this macro
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool authored Jan 1, 2024
1 parent f777222 commit 35a9c9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libraries/dobby/include/dobby.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ typedef struct {
} DobbyRegisterContext;
#endif

#define install_hook_name(name, fn_ret_t, fn_args_t...) \
static fn_ret_t fake_##name(fn_args_t); \
static fn_ret_t (*orig_##name)(fn_args_t); \
#define install_hook_name(name, fn_ret_t, ...) \
static fn_ret_t fake_##name(__VA_ARGS__); \
static fn_ret_t (*orig_##name)(__VA_ARGS__); \
/* __attribute__((constructor)) */ static void install_hook_##name(void *sym_addr) { \
DobbyHook(sym_addr, (dobby_dummy_func_t)fake_##name, (dobby_dummy_func_t *)&orig_##name); \
return; \
} \
fn_ret_t fake_##name(fn_args_t)
fn_ret_t fake_##name(__VA_ARGS__)

// memory code patch
int DobbyCodePatch(void *address, uint8_t *buffer, uint32_t buffer_size);
Expand Down

0 comments on commit 35a9c9d

Please sign in to comment.