#ifndef HOOK_INJECT_FRIDA_SHIM_H
#define HOOK_INJECT_FRIDA_SHIM_H
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct HookFridaCtx HookFridaCtx;
typedef enum {
HOOK_FRIDA_ERROR_NONE = 0,
HOOK_FRIDA_ERROR_INVALID_ARGUMENT = 1,
HOOK_FRIDA_ERROR_NOT_SUPPORTED = 2,
HOOK_FRIDA_ERROR_PERMISSION_DENIED = 3,
HOOK_FRIDA_ERROR_PROCESS_NOT_FOUND = 4,
HOOK_FRIDA_ERROR_RUNTIME = 5
} HookFridaErrorKind;
HookFridaCtx * hook_frida_new(int32_t * error_kind_out, char ** error_out);
void hook_frida_free(HookFridaCtx * ctx);
int hook_frida_inject_process(HookFridaCtx * ctx,
int32_t pid,
const char * library_path,
const char * entrypoint,
const char * data,
uint32_t * out_id,
int32_t * error_kind_out,
char ** error_out);
int hook_frida_inject_blob(HookFridaCtx * ctx,
int32_t pid,
const uint8_t * blob,
size_t blob_len,
const char * entrypoint,
const char * data,
uint32_t * out_id,
int32_t * error_kind_out,
char ** error_out);
int hook_frida_inject_launch(HookFridaCtx * ctx,
const char * program,
const char * const * argv,
const char * const * envp,
const char * cwd,
int32_t stdio,
const char * library_path,
const char * entrypoint,
const char * data,
uint32_t * out_pid,
uint32_t * out_id,
int32_t * error_kind_out,
char ** error_out);
int hook_frida_spawn(HookFridaCtx * ctx,
const char * program,
const char * const * argv,
const char * const * envp,
const char * cwd,
int32_t stdio,
uint32_t * out_pid,
int32_t * error_kind_out,
char ** error_out);
int hook_frida_resume(HookFridaCtx * ctx,
uint32_t pid,
int32_t * error_kind_out,
char ** error_out);
int hook_frida_demonitor(HookFridaCtx * ctx,
uint32_t id,
int32_t * error_kind_out,
char ** error_out);
void hook_frida_string_free(char * s);
#ifdef __cplusplus
}
#endif
#endif