#pragma once #include "interface_types.hpp" extern "C" { // Exposed rewire functions - to be used by wirekit err_t rewire_syscall_hook(reg_t syscall, hook_t entry, hook_t exit); err_t rewire_syscall_unhook(reg_t syscall); // Alias for rewire_syscall_hook(syscall, nullptr, nullptr) err_t rewire_syscall_hook_default(hook_t entry, hook_t exit); err_t rewire_syscall_unhook_default(); // Alias for rewire_syscall_hook_default(nullptr, nullptr); err_t rewire_subject_id(pid_t* pid); err_t rewire_subject_get_regs(user_regs_struct* regs); err_t rewire_subject_set_regs(const user_regs_struct* regs); err_t rewire_subject_load_cstr(const char* subject_addr, char* buf, uint32_t* read, uint32_t n); // Wirekit control functions - called by rewire for setup err_t wirekit_prepare(); // NOCTX - Called when wirekit is loaded err_t wirekit_command_start(int argc, const char* const* argv); // NOCTX - Called before command is executed void wirekit_command_exit(); // Optional, NOCTX - Called after command finished executing void wirekit_subject_start(); // Optional - Called when a new thread starts working on the current command void wirekit_subject_exit(); // Optional - Called when a thread stops working on the current command }