37 #include <sys/types.h>
52 #define INJERR_SUCCESS 0
53 #define INJERR_OTHER -1
54 #define INJERR_NO_MEMORY -2
55 #define INJERR_NO_PROCESS -3
56 #define INJERR_NO_LIBRARY -4
57 #define INJERR_NO_FUNCTION -4
58 #define INJERR_ERROR_IN_TARGET -5
59 #define INJERR_FILE_NOT_FOUND -6
60 #define INJERR_INVALID_MEMORY_AREA -7
61 #define INJERR_PERMISSION -8
62 #define INJERR_UNSUPPORTED_TARGET -9
63 #define INJERR_INVALID_ELF_FORMAT -10
64 #define INJERR_WAIT_TRACEE -11
65 #define INJERR_FUNCTION_MISSING -12
67 typedef struct injector injector_t;
111 #if defined(INJECTOR_DOC) || defined(__linux__) || defined(__APPLE__)
137 #if defined(INJECTOR_DOC) || defined(__linux__) || defined(_WIN32)
138 #define INJECTOR_HAS_REMOTE_CALL_FUNCS 1
211 #if defined(INJECTOR_DOC) || defined(_WIN32)
222 #if defined(INJECTOR_DOC) || (defined(__linux__) && defined(__x86_64__))
223 #define INJECTOR_HAS_INJECT_IN_CLONED_THREAD 1
235 int injector_inject_in_cloned_thread(injector_t *injector, const char *path, void **handle);
pid_t injector_pid_t
Platform-dependent process id type (pid_t on Unix. DWORD on Windows)
Definition: injector.h:42
int injector_remote_vcall(injector_t *injector, intptr_t *retval, size_t func_addr, va_list ap)
Call the function in the target process (Linux and Windows only)
int injector_remote_call(injector_t *injector, intptr_t *retval, size_t func_addr,...)
Call the function in the target process (Linux and Windows only)
int injector_call(injector_t *injector, void *handle, const char *name)
Call the specified function taking no arguments in the target process (Linux and macOS only)
int injector_remote_func_addr(injector_t *injector, void *handle, const char *name, size_t *func_addr_out)
Get the function address in the target process (Linux and Windows only)
const char * injector_error(void)
Get the message of the last error.
int injector_inject(injector_t *injector, const char *path, void **handle)
Inject the specified shared library into the target process.
int injector_attach(injector_t **injector, injector_pid_t pid)
Attach to the specified process.
int injector_inject_w(injector_t *injector, const wchar_t *path, void **handle)
Same with injector_inject except the type of the path argument. (Windows only)
int injector_uninject(injector_t *injector, void *handle)
Uninject the shared library specified by handle.
int injector_detach(injector_t *injector)
Detach from the attached process and destroy the specified handle.