github.com/Rookout/GoSDK@v0.1.48/pkg/services/instrumentation/hooker/hook_api.h (about)

     1  #ifndef _HOOK_API_H
     2  #define _HOOK_API_H
     3  
     4  #include <stddef.h>
     5  #include <stdint.h>
     6  
     7  #ifdef __cplusplus
     8  extern "C" {
     9  #endif
    10  
    11  
    12  
    13  int RookoutInit(void *user_addr_hint);
    14  
    15  
    16  int RookoutDestroy();
    17  
    18  
    19  int RookoutRegisterFunctionBreakpointsState(void *function_entry_addr, void *function_end_addr, int num_breakpoints,
    20                                              void *breakpoints_addrs, void *breakpoint_failed_counters,
    21                                              void *breakpoint_execution_callback_addr, void *prologue_addr,
    22                                              int prologue_len, int has_stack_frame);
    23  
    24  
    25  void *RookoutGetInstructionMapping(void *function_entry_addr, void *function_end_addr, int state_id);
    26  
    27  
    28  int RookoutGetFunctionType(void *function_entry_addr, void *function_end_addr);
    29  
    30  
    31  uint64_t RookoutGetDangerZoneStartAddress(void *function_entry_addr, void *function_end_addr);
    32  
    33  
    34  uint64_t RookoutGetDangerZoneEndAddress(void *function_entry_addr, void *function_end_addr);
    35  
    36  
    37  uint64_t RookoutGetHookAddress(void *function_entry_addr, void *function_end_addr, int state_id);
    38  
    39  
    40  int RookoutGetHookSizeBytes(void *function_entry_addr, void *function_end_addr, int state_id);
    41  
    42  
    43  void *RookoutGetHookBytesView(void *function_entry_addr, void *function_end_addr, int state_id);
    44  
    45  
    46  int RookoutApplyBreakpointsState(void *function_entry_addr, void *function_end_addr, int state_id);
    47  
    48  
    49  int RookoutClearAllBreakpoints(void *function_entry_addr, void *function_end_addr);
    50  
    51  
    52  int RookoutTriggerWatchDog(unsigned long long timeout_ms);
    53  
    54  
    55  void RookoutDefuseWatchDog();
    56  
    57  
    58  const char *RookoutGetHookerLastError();
    59  
    60  #ifdef __cplusplus
    61  }
    62  #endif
    63  #endif