Arion 1.0.2-alpha
A high-performance C++ framework for emulating executable binaries.
 
Loading...
Searching...
No Matches
arion Namespace Reference

Classes

struct  ABI_CALLING_CONVENTION
 Unicorn registers involved in calling convention. More...
 
struct  ABI_REGISTERS
 Unicorn PC and SP registers for genericity. More...
 
struct  ABI_SYSCALLING_CONVENTION
 Unicorn registers involved in syscalling convention. More...
 
struct  ANALYSIS_HIT
 This structure holds data relative to a trace hit (e.g : instruction, basic block...). More...
 
struct  ARCH_ATTRIBUTES
 Multiple architecture specific attributes, grouped in a structure for genericity purpose. More...
 
class  ArchManager
 
class  Arion
 An emulation unit associated with a process. More...
 
struct  ARION_AFL_PARAM
 This structure is placed in the UnicornAFL user_data parameter. More...
 
struct  ARION_CONTEXT
 Stores the whole context of an Arion instance that can be saved and restored to resume emulation from a given point. More...
 
struct  ARION_FILE
 Stores attributes related to a file which was opened during emulation. More...
 
struct  ARION_FUTEX
 This structure holds data about a Fast Userspace muTEX. More...
 
struct  ARION_HOOK
 This structure holds information about an Arion hook. More...
 
struct  ARION_HOOK_PARAM
 This structure is placed in the Unicorn user_data parameter of hooks. More...
 
struct  ARION_MAPPING
 This structure holds data associated with a memory mapping. More...
 
struct  ARION_MEM_EDIT
 This structure holds data associated with a memory modification event. More...
 
struct  ARION_SOCKET
 This structure holds data about a UNIX socket. More...
 
struct  ARION_TGROUP_ENTRY
 
struct  ARION_THREAD
 This structure holds data about a UNIX thread. More...
 
class  ArionAfl
 This class is used to managed a UnicornAFL fuzzing session from an Arion instance. More...
 
class  ArionGroup
 Group of Arion instances that run together. This allows IPC as well as sandboxing between groups. More...
 
struct  ARM_TRAP
 Structure representing a kernel trap entry for the 32-bit ARM architecture. More...
 
struct  AUXV_PTRS
 Structure holding allocated memory addresses for string data placed on the stack for AUXV. More...
 
class  BaremetalManager
 
struct  CODE_HIT
 
class  CodeTraceAnalyzer
 This class is used to analyze data held in a trace file with various methods. More...
 
class  CodeTraceComparator
 This class is used to compare data held in two different trace files with various methods. More...
 
class  CodeTracer
 This class is used to perform tracing operations over an Arion emulation and store the result in a dedicated file. More...
 
class  CodeTraceReader
 This class is used to read and parse an execution trace generated by an arion::CodeTracer instance. More...
 
class  colorstream
 A stringstream extended class, which allows the use of LOG_COLOR colors for logging. More...
 
class  Config
 This class is responsible for storing a configuration which conditions the emulation of an Arion instance. More...
 
class  ContextManager
 
struct  ELF_COREDUMP_ATTRS
 Structure holding attributes extracted from an ELF core dump, primarily threads' register states. More...
 
struct  ELF_COREDUMP_THREAD
 Structure holding register data for a single thread extracted from an ELF core dump. More...
 
struct  ELF_PARSER_ATTRIBUTES
 Extended attributes structure for the ELF file parser. More...
 
class  ElfCoredumpParser
 Helper class responsible for parsing the specific NOTE sections of an ELF core dump file. More...
 
class  ElfLoader
 A Linux loader implementation responsible for parsing and mapping ELF binaries (executables and dynamic loaders). More...
 
class  ElfParser
 Primary class for parsing ELF executables, shared objects, or core dumps. Inherits from ExecutableParser. More...
 
struct  EXECUTABLE_PARSER_ATTRIBUTES
 Stores attributes which are filled during the parsing of an executable. More...
 
class  ExecutableParser
 This class is responsible for extracting specific data from an executable file. More...
 
class  FileSystemManager
 This class is used to emulate interactions with the rootfs specified by user. More...
 
class  GdtManager
 A class used to setup and interact with the Global Descriptor Table (GDT). More...
 
class  HooksManager
 This class purpose is to manage user-defined Arion hooks including hook creation, deletion, trigger handling... More...
 
class  LinuxArchManager
 Abstract base class for managing Linux architecture-specific details, particularly for core dump parsing. More...
 
class  LinuxBaremetalLoader
 A Linux loader implementation for baremetal (shellcode) injection/execution without a full ELF file structure. More...
 
class  LinuxLoader
 Abstract base class for Linux-specific executable loading and setup routines. More...
 
class  LinuxSyscallManager
 Manages the emulation and dispatching of Linux system calls. More...
 
struct  LNX_LOADER_PARAMS
 Structure holding the key load addresses of the emulated process. More...
 
class  Logger
 This class is responsible for managing logging in the Arion emulation framework. More...
 
struct  MD5_CTXT
 This structure holds the context for MD5 calculation. More...
 
class  MemoryManager
 
class  MemoryRecorder
 This class is responsible for recording memory accesses to an Arion instance. More...
 
struct  PARSED_COREDUMP_THREAD
 Structure holding the fully parsed register state for a thread retrieved from a core dump. More...
 
class  ProcFSManager
 This class is used to emulate the behavior of the procfs filesystem. More...
 
union  RVAL
 Identifies a size-agnostic register value. More...
 
struct  SEGMENT
 Identifies an OS memory segment. More...
 
struct  SIGNAL
 Identifies an OS signal. More...
 
class  SignalManager
 This class manages signal handling within an Arion emulation session. More...
 
class  SocketManager
 
struct  SYSCALL_FUNC
 Structure defining a system call function and its parameter signature for logging/analysis. More...
 
class  ThreadingManager
 
struct  TRACE_MODULE
 This structure holds data relative to a module being traced (e.g : a library) in virtual memory space. More...
 
struct  TRACER_MAPPING
 Stores general data over a memory mapping to be stored in the output trace file. More...
 

Typedefs

using KERNEL_SEG_FLAGS = uint8_t
 Flags telling the loader which architecture specific segments should stand in memory.
 
using ADDR = uint64_t
 Identifies a memory address.
 
using PROT_FLAGS = uint8_t
 Identifies memory protection rights.
 
using BYTE = uint8_t
 Identifies an 8-bit integer.
 
using REG = uint64_t
 Identifies a Unicorn register.
 
using RVAL8 = uint8_t
 Identifies a 8-bit register value.
 
using RVAL16 = uint16_t
 Identifies a 16-bit register value.
 
using RVAL32 = uint32_t
 Identifies a 32-bit register value.
 
using RVAL64 = uint64_t
 Identifies a 64-bit register value.
 
using RVAL128 = std::array< BYTE, 16 >
 Identifies a 128-bit register value.
 
using RVAL256 = std::array< BYTE, 32 >
 Identifies a 256-bit register value.
 
using RVAL512 = std::array< BYTE, 64 >
 Identifies a 512-bit register value.
 
using SYS_PARAM = uint64_t
 Identifies a syscall parameter.
 
using HOOK_ID = uint64_t
 ID associated with a hook when created.
 
using NO_PARAM_HOOK_CALLBACK = std::function< void(std::shared_ptr< Arion > arion, void *user_data)>
 
using NO_PARAM_BOOL_HOOK_CALLBACK = std::function< bool(std::shared_ptr< Arion > arion, void *user_data)>
 
using U32_HOOK_CALLBACK = std::function< void(std::shared_ptr< Arion > arion, uint32_t val, void *user_data)>
 
using ADDR_SZ_HOOK_CALLBACK = std::function< void(std::shared_ptr< Arion > arion, ADDR addr, size_t sz, void *user_data)>
 
using MEM_HOOK_CALLBACK = std::function< bool(std::shared_ptr< Arion > arion, uc_mem_type type, uint64_t addr, int size, int64_t val, void *user_data)>
 
using EDGE_HOOK_CALLBACK = std::function< void(std::shared_ptr< Arion > arion, uc_tb *cur, uc_tb *prev, void *user_data)>
 
using TCG_HOOK_CALLBACK = std::function< void(std::shared_ptr< Arion > arion, uint64_t addr, uint64_t arg1, uint64_t arg2, int size, void *user_data)>
 
using TLB_HOOK_CALLBACK = std::function< bool(std::shared_ptr< Arion > arion, uint64_t addr, uc_mem_type type, uc_tlb_entry *result, void *user_data)>
 
using PROCESS_HOOK_CALLBACK = std::function< void(std::shared_ptr< Arion > arion, std::shared_ptr< Arion > child, void *user_data)>
 
using SYSCALL_HOOK_CALLBACK = std::function< void(std::shared_ptr< Arion > arion, uint64_t sysno, std::vector< SYS_PARAM > params, bool *handled, void *user_data)>
 
using HOOK_CALLBACK = std::variant< NO_PARAM_HOOK_CALLBACK, NO_PARAM_BOOL_HOOK_CALLBACK, U32_HOOK_CALLBACK, ADDR_SZ_HOOK_CALLBACK, MEM_HOOK_CALLBACK, EDGE_HOOK_CALLBACK, TCG_HOOK_CALLBACK, TLB_HOOK_CALLBACK, PROCESS_HOOK_CALLBACK, SYSCALL_HOOK_CALLBACK >
 Variant type that represents any possible hook callback type supported by Arion.
 
using ARION_AFL_INPUT_CALLBACK = std::function< bool(std::shared_ptr< Arion > arion, char *input, size_t input_sz, uint32_t persistent_round, void *user_data)>
 
using ARION_AFL_CRASH_CALLBACK = std::function< bool(std::shared_ptr< Arion > arion, uc_err res, char *input, size_t input_sz, uint32_t persistent_round, void *user_data)>
 
using ANALYZER_HIT_CALLBACK = std::function< bool(std::unique_ptr< ANALYSIS_HIT > hit)>
 Callback called when a hit is being processed by a CodeTraceAnalyzer instance.
 
using COMPARATOR_HIT_CALLBACK = std::function< bool(std::unique_ptr< ANALYSIS_HIT > hit1, std::unique_ptr< ANALYSIS_HIT > hit2)>
 Callback called when a hit is being processed by a CodeTraceComparator instance.
 
using RD_BIN_CALLBACK = std::function< void(std::array< BYTE, ARION_BUF_SZ > buf, ADDR off, size_t sz)>
 Callback type used for processing chunks of binary data read from a file.
 

Enumerations

enum  CPU_INTR {
  DIVIDE_ERROR , DEBUG_EXCEPTION , NON_MASKABLE_INTR , BREAKPOINT ,
  OVERFLOW , BOUND_RANGE_EXCEEDED , INVALID_OPCODE , DEVICE_NOT_AVAILABLE ,
  DOUBLE_FAULT , COPROCESSOR_SEGMENT_OVERRUN , INVALID_TSS , SEGMENT_NOT_PRESENT ,
  STACK_SEGMENT_FAULT , GENERAL_PROTECTION_FAULT , PAGE_FAULT , RESERVED ,
  X87_FLOATING_POINT_EXCEPTION , ALIGNMENT_CHECK , MACHINE_CHECK , SIMD_FLOATING_POINT_ERROR ,
  UDEF , PREFETCH_ABORT , DATA_ABORT , IRQ ,
  FIQ , BKPT , EXCEPTION_EXIT , KERNEL_TRAP ,
  HVC , HYP_TRAP , SMC , VIRQ ,
  VFIQ , SEMIHOST , NOCP , INVSTATE ,
  STKOF , LAZYFP , LSERR , UNALIGNED
}
 Fields for Interrupt Descriptor Tables. More...
 
enum  TRACE_MODE : uint8_t {
  INSTR , CTXT , BLOCK , DRCOV ,
  UNKNOWN
}
 These modes are used to configure the output file format. More...
 
enum  LINKAGE_TYPE { UNKNOWN_LINKAGE , DYNAMIC_LINKAGE , STATIC_LINKAGE }
 Identifies the method used to link an executable. More...
 
enum  CPU_ARCH {
  UNKNOWN_ARCH , X86_ARCH , X8664_ARCH , ARM_ARCH ,
  ARM64_ARCH
}
 Identifies a CPU architecture. More...
 
enum  PLATFORM { UNKNOWN_PLATFORM , LINUX , WINDOWS , MACOS }
 Identifies an Operating System (OS). More...
 
enum  LOG_LEVEL {
  TRACE , DEBUG , INFO , WARN ,
  ERROR , CRITICAL , OFF
}
 Identifies a logging level. More...
 
enum  ARION_HOOK_TYPE {
  INTR_HOOK , INSN_HOOK , CODE_HOOK , BLOCK_HOOK ,
  MEM_READ_UNMAPPED_HOOK , MEM_WRITE_UNMAPPED_HOOK , MEM_FETCH_UNMAPPED_HOOK , MEM_READ_PROT_HOOK ,
  MEM_WRITE_PROT_HOOK , MEM_FETCH_PROT_HOOK , MEM_READ_HOOK , MEM_WRITE_HOOK ,
  MEM_FETCH_HOOK , MEM_READ_AFTER_HOOK , INSN_INVALID_HOOK , EDGE_GENERATED_HOOK ,
  TCG_OPCODE_HOOK , TLB_FILL_HOOK , FORK_HOOK , EXECVE_HOOK ,
  SYSCALL_HOOK
}
 Types for Arion hooks. More...
 
enum  LOG_COLOR {
  DEFAULT , BLACK , DARK_RED , DARK_GREEN ,
  DARK_YELLOW , DARK_BLUE , DARK_MAGENTA , DARK_CYAN ,
  LIGHT_GRAY , DARK_GRAY , RED , GREEN ,
  ORANGE , BLUE , MAGENTA , CYAN ,
  WHITE
}
 These colors can be used for logging. More...
 
enum  ARION_MEM_STRATEGY { RECORD_EDITS , RESTORE_MAPPINGS , RAW_RESTORE , MANUAL_MANAGEMENT }
 Memory restoring strategies for the fuzzed Arion instance. More...
 
enum  ELF_FILE_TYPE {
  UNKNOWN_FILE , REL , EXEC , DYN ,
  CORE , NUM
}
 Enumeration of possible ELF file types relevant to the Arion emulator. More...
 
enum  AUXV {
  AT_NULL = 0 , AT_IGNORE = 1 , AT_EXECFD = 2 , AT_PHDR = 3 ,
  AT_PHENT = 4 , AT_PHNUM = 5 , AT_PAGESZ = 6 , AT_BASE = 7 ,
  AT_FLAGS = 8 , AT_ENTRY = 9 , AT_NOTELF = 10 , AT_UID = 11 ,
  AT_EUID = 12 , AT_GID = 13 , AT_EGID = 14 , AT_PLATFORM = 15 ,
  AT_HWCAP = 16 , AT_CLKTCK = 17 , AT_SECURE = 23 , AT_BASE_PLATFORM = 24 ,
  AT_RANDOM = 25 , AT_HWCAP2 = 26 , AT_RSEQ_FEATURE_SIZE = 27 , AT_RSEQ_ALIGN = 28 ,
  AT_HWCAP3 = 29 , AT_HWCAP4 = 30 , AT_EXECFN = 31 , AT_SYSINFO = 32 ,
  AT_SYSINFO_EHDR = 33 , AT_MINSIGSTKSZ = 51
}
 Enumeration of Auxiliary Vector (AUXV) keys passed by the kernel to the user space. More...
 

Functions

std::vector< BYTEserialize_arion_file (ARION_FILE *arion_f)
 
ARION_FILEdeserialize_arion_file (std::vector< BYTE > srz_file)
 
void arion_intr_hook (uc_engine *uc, uint32_t intno, void *user_data)
 
void arion_insn_hook (uc_engine *uc, void *user_data)
 
void arion_code_hook (uc_engine *uc, uint64_t address, uint32_t size, void *user_data)
 
void arion_block_hook (uc_engine *uc, uint64_t address, uint32_t size, void *user_data)
 
bool arion_mem_read_unmapped_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_write_unmapped_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_fetch_unmapped_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_read_prot_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_write_prot_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_fetch_prot_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_read_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_write_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_fetch_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_mem_read_after_hook (uc_engine *uc, uc_mem_type access, uint64_t addr, int size, int64_t val, void *user_data)
 
bool arion_insn_invalid_hook (uc_engine *uc, void *user_data)
 
void arion_edge_generated_hook (uc_engine *uc, uc_tb *cur, uc_tb *prev, void *user_data)
 
void arion_tcg_opcode_hook (uc_engine *uc, uint64_t addr, uint64_t arg1, uint64_t arg2, int size, void *user_data)
 
bool arion_tlb_fill_hook (uc_engine *uc, uint64_t addr, uc_mem_type type, uc_tlb_entry *result, void *user_data)
 
std::vector< BYTEserialize_arion_mapping (ARION_MAPPING *arion_m)
 
ARION_MAPPINGdeserialize_arion_mapping (std::vector< BYTE > srz_mapping)
 
std::vector< BYTEserialize_arion_socket (ARION_SOCKET *arion_s)
 
ARION_SOCKETdeserialize_arion_socket (std::vector< BYTE > srz_socket)
 
std::vector< BYTEserialize_arion_futex (ARION_FUTEX *arion_f)
 
ARION_FUTEXdeserialize_arion_futex (std::vector< BYTE > srz_futex)
 
std::vector< BYTEserialize_arion_thread (ARION_THREAD *arion_t)
 
ARION_THREADdeserialize_arion_thread (std::vector< BYTE > srz_thread)
 
uint32_t rotate_left (uint32_t x, uint32_t n)
 
void md5_init (MD5_CTXT *ctx)
 
void md5_step (uint32_t *buffer, uint32_t *input)
 
void md5_update (MD5_CTXT *ctx, uint8_t *input_buffer, size_t input_len)
 
void md5_finalize (MD5_CTXT *ctx)
 
void md5_string (char *input, uint8_t *result)
 
void md5_file (FILE *file, uint8_t *result)
 
uint64_t sys_getpid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getuid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getgid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setuid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setgid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_geteuid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getegid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setpgid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getppid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getpgrp (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setsid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setreuid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setregid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getgroups (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setgroups (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setresuid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getresuid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setresgid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getresgid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getpgid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setfsuid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setfsgid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getsid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_gettid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_newuname (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_gettimeofday (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getrlimit (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_sysinfo (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_capget (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_capset (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_arch_prctl (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_prlimit64 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getcpu (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_read (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_write (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_open (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_close (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_newstat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_newfstat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_newlstat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_poll (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_lseek (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_ioctl (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_pread64 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_pwrite64 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_readv (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_writev (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_access (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_select (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_dup (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_dup2 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_socket (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_socketcall (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_connect (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_accept (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_sendto (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_send (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_recvfrom (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_recv (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_sendmsg (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_recvmsg (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_shutdown (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_bind (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_listen (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getsockname (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getpeername (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_socketpair (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_setsockopt (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getsockopt (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_fcntl (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_truncate (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_ftruncate (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_faccessat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getcwd (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_chdir (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_fchdir (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_rename (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_mkdir (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_rmdir (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_creat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_link (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_unlink (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_symlink (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_readlink (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_statfs (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_fstatfs (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getdents64 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_openat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_newfstatat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_renameat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_readlinkat (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_pselect6 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_ppoll (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_accept4 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_recvmmsg (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_sendmmsg (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_renameat2 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_statx (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getxattr (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_lgetxattr (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_mmap (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_mmap2 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_mprotect (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_munmap (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_brk (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_getrandom (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_clone (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_fork (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_execve (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_exit (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_futex (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_futex_time64 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_set_tid_address (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_set_thread_area (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_set_tls (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_exit_group (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_clone3 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_set_robust_list (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_rseq (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_rt_sigaction (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_rt_sigreturn (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_sigreturn (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_pause (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_wait4 (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_kill (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_tgkill (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_waitid (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_sched_rr_get_interval (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_time (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_clock_gettime (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_clock_getres (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
uint64_t sys_clock_nanosleep (std::shared_ptr< Arion > arion, std::vector< SYS_PARAM > params, bool &cancel)
 
std::string str_to_uppercase (const std::string &input)
 
std::string str_to_lowercase (const std::string &input)
 
template<typename T >
std::string int_to_hex (T value, uint8_t padding=0, bool prefix=true)
 
std::string prot_flags_to_str (PROT_FLAGS flags)
 
std::string demangle_cxx_symbol (std::string mangled_name)
 
std::string strip_str (const std::string &str)
 
std::string ipv4_addr_to_string (in_addr_t addr)
 
std::string ipv6_addr_to_string (const uint8_t addr[16])
 
std::string name_from_path (const std::string &path)
 
void read_bin_file (std::string file_path, ADDR off, size_t sz, RD_BIN_CALLBACK callback)
 
std::string gen_tmp_path ()
 
std::string md5_hash_file (std::string file_path)
 
bool check_fd_status (int fd, short int &revents)
 
CPU_ARCH get_host_cpu_arch ()
 
std::vector< BYTEgen_random_bytes (std::size_t n)
 

Variables

std::map< CPU_ARCH, std::pair< uc_arch, uc_mode > > ARION_TO_UC_ARCH
 Ensures the conversion between Arion CPU_ARCH and Unicorn CPU architectures and modes.
 
std::map< CPU_ARCH, std::vector< std::pair< ks_arch, ks_mode > > > ARION_TO_KS_ARCH
 Ensures the conversion between Arion CPU_ARCH and Keystone CPU architectures and modes.
 
std::map< CPU_ARCH, std::vector< std::pair< cs_arch, cs_mode > > > ARION_TO_CS_ARCH
 Ensures the conversion between Arion CPU_ARCH and Capstone CPU architectures and modes.
 
const char TRACER_FILE_MAGIC [] = "ARIONTRC"
 Magic string for headers of Arion tracer files.
 
const float TRACER_FILE_VERSION = 1.0
 Version number of Arion tracer file format.
 
const uint16_t TRACER_FILE_HEADER_SIZE = 0x28
 Header size of Arion tracer files.
 
const char CONTEXT_FILE_MAGIC [] = "ARIONCTX"
 Magic string for headers of Arion context files.
 
const float CONTEXT_FILE_VERSION = 1.0
 Version number of Arion context file format.
 
const size_t EMPTY = 0
 A 64-bit zero-initialized value for various purposes.
 
std::map< std::string, CPU_ARCHARCH_FROM_NAME
 A map identifying a CPU architecture given its name.
 
std::map< CPU_ARCH, std::string > NAME_FROM_ARCH
 A map identifying a name corresponding a given CPU architecture.
 
std::map< ARION_HOOK_TYPE, uc_hook_type > ARION_UC_HOOK_TYPES
 A map identifying a Unicorn hook type given its associated Arion hook type.
 
std::map< ARION_HOOK_TYPE, void * > ARION_UC_HOOK_FUNCS
 A map identifying a hook function given its associated Arion hook type.
 
std::map< LOG_COLOR, std::string > arion_log_colors_str
 A map identifying an ANSI color code given its associated Arion LOG_COLOR.
 
std::map< uc_afl_ret, std::string > UC_AFL_ERR_STR
 A map identifying a UnicornAFL error message given its error code.
 
static uint32_t S []
 Array of shift amounts S[i] used in the MD5 algorithm.
 
static uint32_t K []
 Array of 64 pre-calculated sine constants K[i] used in the MD5 algorithm.
 
static uint8_t PADDING []
 The MD5 padding constant array.
 
std::map< LIEF::ELF::Header::FILE_TYPE, ELF_FILE_TYPElief_arion_file_types
 Mapping from LIEF's internal ELF file type enumeration to Arion's ELF_FILE_TYPE.
 
std::map< std::string, uint8_t > PARAMS_N_BY_SYSCALL_NAME
 Global map storing the number of parameters required for a syscall, indexed by its string name.
 

Typedef Documentation

◆ ADDR

using arion::ADDR = typedef uint64_t

Identifies a memory address.

◆ ADDR_SZ_HOOK_CALLBACK

using arion::ADDR_SZ_HOOK_CALLBACK = typedef std::function<void(std::shared_ptr<Arion> arion, ADDR addr, size_t sz, void *user_data)>

Hook that takes address and size parameters and returns void.

Parameters
[in]arionArion instance that triggered the hook.
[in]addrA memory address, specific to the hook context.
[in]szA memory size, specific to the hook context.
[in]user_dataOptional user-defined data passed to the hook.

◆ ANALYZER_HIT_CALLBACK

using arion::ANALYZER_HIT_CALLBACK = typedef std::function<bool(std::unique_ptr<ANALYSIS_HIT> hit)>

Callback called when a hit is being processed by a CodeTraceAnalyzer instance.

◆ ARION_AFL_CRASH_CALLBACK

using arion::ARION_AFL_CRASH_CALLBACK = typedef std::function<bool(std::shared_ptr<Arion> arion, uc_err res, char *input, size_t input_sz, uint32_t persistent_round, void *user_data)>

A callback that gets triggered at each target crash detected by AFL.

Parameters
[in]arionThe Arion instance being fuzzed.
[in]resError code returned from Unicorn engine.
[in]inputThe buffer containing the input generated by AFL.
[in]input_szThe size of the buffer containing the input generated by AFL.
[in]persistent_roundThe number of remaining rounds before a fork occurs to restore a perfect state.
[in]user_dataOptional user-defined data passed to the hook.
Returns
True if the execution should indeed be considered a crash.

◆ ARION_AFL_INPUT_CALLBACK

using arion::ARION_AFL_INPUT_CALLBACK = typedef std::function<bool(std::shared_ptr<Arion> arion, char *input, size_t input_sz, uint32_t persistent_round, void *user_data)>

A callback that gets triggered at each input generation by AFL.

Parameters
[in]arionThe Arion instance being fuzzed.
[in]inputThe buffer containing the input generated by AFL.
[in]input_szThe size of the buffer containing the input generated by AFL.
[in]persistent_roundThe number of remaining rounds before a fork occurs to restore a perfect state.
[in]user_dataOptional user-defined data passed to the hook.
Returns
True if the input is accepted.

◆ BYTE

using arion::BYTE = typedef uint8_t

Identifies an 8-bit integer.

◆ COMPARATOR_HIT_CALLBACK

using arion::COMPARATOR_HIT_CALLBACK = typedef std::function<bool(std::unique_ptr<ANALYSIS_HIT> hit1, std::unique_ptr<ANALYSIS_HIT> hit2)>

Callback called when a hit is being processed by a CodeTraceComparator instance.

◆ EDGE_HOOK_CALLBACK

using arion::EDGE_HOOK_CALLBACK = typedef std::function<void(std::shared_ptr<Arion> arion, uc_tb *cur, uc_tb *prev, void *user_data)>

Hook that is called when execution transitions between two translation blocks.

Parameters
[in]arionArion instance that triggered the hook.
[in]curCurrent translation block.
[in]prevPrevious translation block.
[in]user_dataOptional user-defined data passed to the hook.

◆ HOOK_CALLBACK

◆ HOOK_ID

using arion::HOOK_ID = typedef uint64_t

ID associated with a hook when created.

◆ KERNEL_SEG_FLAGS

using arion::KERNEL_SEG_FLAGS = typedef uint8_t

Flags telling the loader which architecture specific segments should stand in memory.

◆ MEM_HOOK_CALLBACK

using arion::MEM_HOOK_CALLBACK = typedef std::function<bool(std::shared_ptr<Arion> arion, uc_mem_type type, uint64_t addr, int size, int64_t val, void *user_data)>

Hook associated with a memory operation.

Parameters
[in]arionArion instance that triggered the hook.
[in]typeType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrThe memory address being accessed.
[in]sizeSize of the memory access.
[in]valValue being read or written (if applicable).
[in]user_dataOptional user-defined data passed to the hook.
Returns
True if the hook handled the event and should suppress default behavior; false otherwise.

◆ NO_PARAM_BOOL_HOOK_CALLBACK

using arion::NO_PARAM_BOOL_HOOK_CALLBACK = typedef std::function<bool(std::shared_ptr<Arion> arion, void *user_data)>

Hook that takes no additional parameter and returns a boolean.

Parameters
[in]arionArion instance that triggered the hook.
[in]user_dataOptional user-defined data passed to the hook.
Returns
A boolean, specific to the hook context.

◆ NO_PARAM_HOOK_CALLBACK

using arion::NO_PARAM_HOOK_CALLBACK = typedef std::function<void(std::shared_ptr<Arion> arion, void *user_data)>

Hook that takes no additional parameter and returns void.

Parameters
[in]arionArion instance that triggered the hook.
[in]user_dataOptional user-defined data passed to the hook.

◆ PROCESS_HOOK_CALLBACK

using arion::PROCESS_HOOK_CALLBACK = typedef std::function<void(std::shared_ptr<Arion> arion, std::shared_ptr<Arion> child, void *user_data)>

Hook that is triggered when a new process is created (e.g., via fork or clone).

Parameters
[in]arionParent Arion instance that triggered the hook.
[in]childChild Arion instance that got created.
[in]user_dataOptional user-defined data passed to the hook.

◆ PROT_FLAGS

using arion::PROT_FLAGS = typedef uint8_t

Identifies memory protection rights.

◆ RD_BIN_CALLBACK

using arion::RD_BIN_CALLBACK = typedef std::function<void(std::array<BYTE, ARION_BUF_SZ> buf, ADDR off, size_t sz)>

Callback type used for processing chunks of binary data read from a file.

◆ REG

using arion::REG = typedef uint64_t

Identifies a Unicorn register.

◆ RVAL128

using arion::RVAL128 = typedef std::array<BYTE, 16>

Identifies a 128-bit register value.

◆ RVAL16

using arion::RVAL16 = typedef uint16_t

Identifies a 16-bit register value.

◆ RVAL256

using arion::RVAL256 = typedef std::array<BYTE, 32>

Identifies a 256-bit register value.

◆ RVAL32

using arion::RVAL32 = typedef uint32_t

Identifies a 32-bit register value.

◆ RVAL512

using arion::RVAL512 = typedef std::array<BYTE, 64>

Identifies a 512-bit register value.

◆ RVAL64

using arion::RVAL64 = typedef uint64_t

Identifies a 64-bit register value.

◆ RVAL8

using arion::RVAL8 = typedef uint8_t

Identifies a 8-bit register value.

◆ SYS_PARAM

typedef uint64_t arion::SYS_PARAM

Identifies a syscall parameter.

Type alias for system call parameters.

◆ SYSCALL_HOOK_CALLBACK

using arion::SYSCALL_HOOK_CALLBACK = typedef std::function<void(std::shared_ptr<Arion> arion, uint64_t sysno, std::vector<SYS_PARAM> params, bool *handled, void *user_data)>

Hook that is triggered on syscall invocation.

Parameters
[in]arionArion instance that triggered the hook.
[in]sysnoSystem call number.
[in]paramsVector of system call parameters.
[out]handledOutput flag; set to true if the hook fully handled the syscall and default handling should be skipped.
[in]user_dataOptional user-defined data passed to the hook.

◆ TCG_HOOK_CALLBACK

using arion::TCG_HOOK_CALLBACK = typedef std::function<void(std::shared_ptr<Arion> arion, uint64_t addr, uint64_t arg1, uint64_t arg2, int size, void *user_data)>

Hook for TCG-level emulation events.

Parameters
[in]arionArion instance that triggered the hook.
[in]addrGuest address where the event occurred.
[in]arg1First argument associated with the event.
[in]arg2Second argument associated with the event.
[in]sizeSize (in bytes) of the operation or data.
[in]user_dataOptional user-defined data passed to the hook.

◆ TLB_HOOK_CALLBACK

using arion::TLB_HOOK_CALLBACK = typedef std::function<bool(std::shared_ptr<Arion> arion, uint64_t addr, uc_mem_type type, uc_tlb_entry *result, void *user_data)>

Hook that intercepts TLB (Translation Lookaside Buffer) resolution events.

Parameters
[in]arionArion instance that triggered the hook.
[in]addrGuest virtual address being translated.
[in]typeType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in,out]resultResulting TLB entry.
[in]user_dataOptional user-defined data passed to the hook.
Returns
True if the hook provided a custom translation; false to continue normal translation.

◆ U32_HOOK_CALLBACK

using arion::U32_HOOK_CALLBACK = typedef std::function<void(std::shared_ptr<Arion> arion, uint32_t val, void *user_data)>

Hook that takes a boolean parameter and returns void.

Parameters
[in]arionArion instance that triggered the hook.
[in]valA uint32_t value, specific to the hook context.
[in]user_dataOptional user-defined data passed to the hook.

Enumeration Type Documentation

◆ ARION_HOOK_TYPE

Types for Arion hooks.

Enumerator
INTR_HOOK 

Triggered when an interrupt occurs (e.g., software or hardware interrupt).

INSN_HOOK 

Triggered before or after executing a specific instruction.

CODE_HOOK 

Triggered when code execution reaches a specified address or range.

BLOCK_HOOK 

Triggered at the start of a new basic block or translation block (TB).

MEM_READ_UNMAPPED_HOOK 

Triggered on a memory read from an unmapped region.

MEM_WRITE_UNMAPPED_HOOK 

Triggered on a memory write to an unmapped region.

MEM_FETCH_UNMAPPED_HOOK 

Triggered when fetching instructions from an unmapped region.

MEM_READ_PROT_HOOK 

Triggered on a memory read violating protection flags (e.g., non-readable region).

MEM_WRITE_PROT_HOOK 

Triggered on a memory write violating protection flags (e.g., read-only region).

MEM_FETCH_PROT_HOOK 

Triggered when fetching instructions from a non-executable or protected region.

MEM_READ_HOOK 

Triggered on every valid memory read access.

MEM_WRITE_HOOK 

Triggered on every valid memory write access.

MEM_FETCH_HOOK 

Triggered when fetching instructions from valid mapped memory.

MEM_READ_AFTER_HOOK 

Triggered after a memory read operation completes (e.g., for tracing or logging).

INSN_INVALID_HOOK 

Triggered when an invalid or unimplemented instruction is encountered.

EDGE_GENERATED_HOOK 

Triggered when a new control-flow edge (TB → TB) is generated during emulation.

TCG_OPCODE_HOOK 

Triggered for each TCG opcode during translation (for instrumentation or analysis).

TLB_FILL_HOOK 

Triggered when the TLB is filled or a translation lookup occurs.

FORK_HOOK 

Triggered when a process forks or clones (child Arion instance is created).

EXECVE_HOOK 

Triggered when a process performs an execve-like operation (program replacement).

SYSCALL_HOOK 

Triggered on system call invocation (before or after handling).

◆ ARION_MEM_STRATEGY

Memory restoring strategies for the fuzzed Arion instance.

Enumerator
RECORD_EDITS 

All memory changes are tracked, in order to restore only edited regions.

RESTORE_MAPPINGS 

Memory regions are restored, without caring about the data they contain.

RAW_RESTORE 

Everything is restored.

MANUAL_MANAGEMENT 

Nothing is restored.

◆ AUXV

Enumeration of Auxiliary Vector (AUXV) keys passed by the kernel to the user space.

Enumerator
AT_NULL 

End of the auxiliary vector.

AT_IGNORE 

Entry ignored.

AT_EXECFD 

File descriptor of the executable.

AT_PHDR 

Program header table address.

AT_PHENT 

Size of program header table entry.

AT_PHNUM 

Number of program header entries.

AT_PAGESZ 

System page size.

AT_BASE 

Base address of the interpreter/dynamic linker.

AT_FLAGS 

Flags for the executable.

AT_ENTRY 

Entry point of the executable.

AT_NOTELF 

Value is non-zero if the executable is not an ELF file.

AT_UID 

Real User ID.

AT_EUID 

Effective User ID.

AT_GID 

Real Group ID.

AT_EGID 

Effective Group ID.

AT_PLATFORM 

String identifying the kernel platform (e.g., "x86_64").

AT_HWCAP 

Bitmask of CPU hardware capabilities.

AT_CLKTCK 

Clock tick frequency (jiffies).

AT_SECURE 

Non-zero if the process is being run with a security taint.

AT_BASE_PLATFORM 

String identifying the base platform.

AT_RANDOM 

Address of 16 bytes of random data.

AT_HWCAP2 

Additional bitmask of CPU hardware capabilities.

AT_RSEQ_FEATURE_SIZE 

Size of the rseq structure.

AT_RSEQ_ALIGN 

Alignment of the rseq structure.

AT_HWCAP3 

Third bitmask of CPU hardware capabilities.

AT_HWCAP4 

Fourth bitmask of CPU hardware capabilities.

AT_EXECFN 

Address of the executable's pathname string.

AT_SYSINFO 

Address of a function to call for vsyscall/vdso.

AT_SYSINFO_EHDR 

Address of the VDSO/VSYSCALL ELF header.

AT_MINSIGSTKSZ 

Minimum stack size for a signal handler.

◆ CPU_ARCH

Identifies a CPU architecture.

Enumerator
UNKNOWN_ARCH 

Unknown CPU architecture.

X86_ARCH 

The x86 CPU architecture.

X8664_ARCH 

The x86-64 CPU architecture.

ARM_ARCH 

The ARM CPU architecture.

ARM64_ARCH 

The ARM64 CPU architecture.

◆ CPU_INTR

Fields for Interrupt Descriptor Tables.

Enumerator
DIVIDE_ERROR 

Divide-by-zero error.

DEBUG_EXCEPTION 

Debug exception.

NON_MASKABLE_INTR 

Non-maskable interrupt.

BREAKPOINT 

Breakpoint exception.

OVERFLOW 

Overflow exception.

BOUND_RANGE_EXCEEDED 

Bound range exceeded.

INVALID_OPCODE 

Invalid opcode exception.

DEVICE_NOT_AVAILABLE 

Device not available.

DOUBLE_FAULT 

Double fault.

COPROCESSOR_SEGMENT_OVERRUN 

Coprocessor segment overrun.

INVALID_TSS 

Invalid Task State Segment.

SEGMENT_NOT_PRESENT 

Segment not present.

STACK_SEGMENT_FAULT 

Stack segment fault.

GENERAL_PROTECTION_FAULT 

General protection fault.

PAGE_FAULT 

Page fault.

RESERVED 

Reserved interrupt vector.

X87_FLOATING_POINT_EXCEPTION 

x87 Floating-point exception.

ALIGNMENT_CHECK 

Alignment check.

MACHINE_CHECK 

Machine check.

SIMD_FLOATING_POINT_ERROR 

SIMD Floating-point exception.

UDEF 

Undefined instruction.

PREFETCH_ABORT 

Prefetch abort.

DATA_ABORT 

Data abort.

IRQ 

Normal interrupt request.

FIQ 

Fast interrupt request.

BKPT 

Breakpoint.

EXCEPTION_EXIT 

Exception exit handler.

KERNEL_TRAP 

Kernel trap.

HVC 

Hypervisor call.

HYP_TRAP 

Hypervisor trap.

SMC 

Secure monitor call.

VIRQ 

Virtual IRQ.

VFIQ 

Virtual FIQ.

SEMIHOST 

Semihosting trap.

NOCP 

No coprocessor present.

INVSTATE 

Invalid processor state.

STKOF 

Stack overflow.

LAZYFP 

Lazy floating-point state preservation.

LSERR 

Lock-step error.

UNALIGNED 

Unaligned access.

◆ ELF_FILE_TYPE

Enumeration of possible ELF file types relevant to the Arion emulator.

Enumerator
UNKNOWN_FILE 

Unknown ELF file type.

REL 

Relocatable file.

EXEC 

Executable file.

DYN 

Shared object file (dynamic library).

CORE 

Core dump file.

NUM 

Sentinel for the number of types.

◆ LINKAGE_TYPE

Identifies the method used to link an executable.

Enumerator
UNKNOWN_LINKAGE 

Unknown linkage method.

DYNAMIC_LINKAGE 

The executable was dynamically linked.

STATIC_LINKAGE 

The executable was statically linked.

◆ LOG_COLOR

These colors can be used for logging.

Enumerator
DEFAULT 

Default foreground color.

BLACK 

Black.

DARK_RED 

Dark red.

DARK_GREEN 

Dark green.

DARK_YELLOW 

Dark yellow.

DARK_BLUE 

Dark blue.

DARK_MAGENTA 

Dark magenta.

DARK_CYAN 

Dark cyan.

LIGHT_GRAY 

Light gray.

DARK_GRAY 

Dark gray.

RED 

Red.

GREEN 

Green.

ORANGE 

Orange.

BLUE 

Blue.

MAGENTA 

Magenta.

CYAN 

Cyan.

WHITE 

White.

◆ LOG_LEVEL

Identifies a logging level.

Enumerator
TRACE 

Fine-grained informational events, typically for debugging.

DEBUG 

Debug-level messages, useful for development and troubleshooting.

INFO 

General informational messages about application progress.

WARN 

Potentially harmful situations or warnings.

ERROR 

Error events that might allow the application to continue running.

CRITICAL 

Severe error events that will likely lead to application termination.

OFF 

Disables all logging output.

◆ PLATFORM

Identifies an Operating System (OS).

Enumerator
UNKNOWN_PLATFORM 

Unknown OS.

LINUX 

Linux.

WINDOWS 

Windows.

MACOS 

macOS.

◆ TRACE_MODE

enum arion::TRACE_MODE : uint8_t

These modes are used to configure the output file format.

Enumerator
INSTR 

Arion tracer file which stores the address of every executed instruction.

CTXT 

Arion tracer file which stores the CPU context of every executed instruction.

BLOCK 

Arion tracer file which stores the address of every executed basic block (in control flow).

DRCOV 

DrCov file format. Useful for compatibility with disassembler plugins.

UNKNOWN 

Unknown file format, should not be used.

Function Documentation

◆ arion_block_hook()

void arion::arion_block_hook ( uc_engine *  uc,
uint64_t  address,
uint32_t  size,
void *  user_data 
)

Unicorn hook that gets triggered at the start of a new basic block or translation block (TB).

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]addressStart memory address of the block.
[in]sizeSize of the translation block in bytes.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.

◆ arion_code_hook()

void arion::arion_code_hook ( uc_engine *  uc,
uint64_t  address,
uint32_t  size,
void *  user_data 
)

Unicorn hook that gets triggered when code execution reaches a specified address or range.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]addressMemory address of the instruction being executed.
[in]sizeSize of the executed instruction or block in bytes.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.

◆ arion_edge_generated_hook()

void arion::arion_edge_generated_hook ( uc_engine *  uc,
uc_tb *  cur,
uc_tb *  prev,
void *  user_data 
)

Unicorn hook that gets triggered when a new control-flow edge (translation block to translation block) is generated.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]curCurrent translation block.
[in]prevPrevious translation block.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.

◆ arion_insn_hook()

void arion::arion_insn_hook ( uc_engine *  uc,
void *  user_data 
)

Unicorn hook that gets triggered before or after executing a specific instruction.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.

◆ arion_insn_invalid_hook()

bool arion::arion_insn_invalid_hook ( uc_engine *  uc,
void *  user_data 
)

Unicorn hook that gets triggered when an invalid or unimplemented instruction is encountered.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the invalid instruction and default behavior should be suppressed.

◆ arion_intr_hook()

void arion::arion_intr_hook ( uc_engine *  uc,
uint32_t  intno,
void *  user_data 
)

Unicorn hook that gets triggered when an interrupt occurs (e.g., software or hardware interrupt).

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]intnoInterrupt number.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.

◆ arion_mem_fetch_hook()

bool arion::arion_mem_fetch_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered when fetching instructions from valid mapped memory.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being fetched from.
[in]sizeSize of the fetch operation.
[in]valIgnored for fetch operations.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_fetch_prot_hook()

bool arion::arion_mem_fetch_prot_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered when fetching instructions from a protected region.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being fetched from.
[in]sizeSize of the fetch operation.
[in]valIgnored for fetch operations.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_fetch_unmapped_hook()

bool arion::arion_mem_fetch_unmapped_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered when fetching instructions from an unmapped region.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being fetched from.
[in]sizeSize of the fetch operation.
[in]valIgnored for fetch operations.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_read_after_hook()

bool arion::arion_mem_read_after_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered after a memory read operation completes.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address that was read.
[in]sizeSize of the read operation.
[in]valValue read from memory.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_read_hook()

bool arion::arion_mem_read_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered on every valid memory read access.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being read.
[in]sizeSize of the memory read.
[in]valValue read from memory.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_read_prot_hook()

bool arion::arion_mem_read_prot_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered on a memory read violating protection flags.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being accessed.
[in]sizeSize of the memory access.
[in]valValue attempted to be read.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_read_unmapped_hook()

bool arion::arion_mem_read_unmapped_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered on a memory read from an unmapped region.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being accessed.
[in]sizeSize of the memory access.
[in]valValue attempted to be read.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_write_hook()

bool arion::arion_mem_write_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered on every valid memory write access.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being written.
[in]sizeSize of the memory write.
[in]valValue written to memory.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_write_prot_hook()

bool arion::arion_mem_write_prot_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered on a memory write violating protection flags.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being accessed.
[in]sizeSize of the memory access.
[in]valValue attempted to be written.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_mem_write_unmapped_hook()

bool arion::arion_mem_write_unmapped_hook ( uc_engine *  uc,
uc_mem_type  access,
uint64_t  addr,
int  size,
int64_t  val,
void *  user_data 
)

Unicorn hook that gets triggered on a memory write to an unmapped region.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in]addrMemory address being accessed.
[in]sizeSize of the memory access.
[in]valValue attempted to be written.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the access and default behavior should be suppressed.

◆ arion_tcg_opcode_hook()

void arion::arion_tcg_opcode_hook ( uc_engine *  uc,
uint64_t  addr,
uint64_t  arg1,
uint64_t  arg2,
int  size,
void *  user_data 
)

Unicorn hook that gets triggered for each TCG opcode during translation or emulation.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]addrGuest address of the instruction or opcode.
[in]arg1First argument associated with the opcode.
[in]arg2Second argument associated with the opcode.
[in]sizeSize of the operation or data in bytes.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.

◆ arion_tlb_fill_hook()

bool arion::arion_tlb_fill_hook ( uc_engine *  uc,
uint64_t  addr,
uc_mem_type  type,
uc_tlb_entry *  result,
void *  user_data 
)

Unicorn hook that gets triggered when a TLB entry is filled or a translation lookup occurs.

Parameters
[in]ucThe unicorn engine that triggered the hook.
[in]addrGuest virtual address being translated.
[in]accessType of memory access (e.g., UC_MEM_READ, UC_MEM_WRITE, UC_MEM_FETCH).
[in,out]resultResulting TLB entry, which can be modified by the hook.
[in]user_dataA ARION_HOOK_PARAM structure which holds data related to the associated Arion hook.
Returns
True if the hook handled the translation and default behavior should be suppressed.

◆ check_fd_status()

bool arion::check_fd_status ( int  fd,
short int &  revents 
)

Checks the I/O status (readiness) of a given file descriptor using poll().

Parameters
[in]fdThe file descriptor to check.
[out]reventsThe returned events bitmap (e.g., POLLIN, POLLOUT).
Returns
true if the poll was successful, false otherwise.

◆ demangle_cxx_symbol()

std::string arion::demangle_cxx_symbol ( std::string  mangled_name)
inline

Demangles a C++ symbol name if it is mangled.

Parameters
[in]mangled_nameThe potentially mangled C++ symbol name.
Returns
The demangled name if successful, otherwise the original mangled name.

◆ deserialize_arion_file()

ARION_FILE * arion::deserialize_arion_file ( std::vector< BYTE srz_file)

◆ deserialize_arion_futex()

ARION_FUTEX * arion::deserialize_arion_futex ( std::vector< BYTE srz_futex)

◆ deserialize_arion_mapping()

ARION_MAPPING * arion::deserialize_arion_mapping ( std::vector< BYTE srz_mapping)

◆ deserialize_arion_socket()

ARION_SOCKET * arion::deserialize_arion_socket ( std::vector< BYTE srz_socket)

◆ deserialize_arion_thread()

ARION_THREAD * arion::deserialize_arion_thread ( std::vector< BYTE srz_thread)

◆ gen_random_bytes()

std::vector< BYTE > arion::gen_random_bytes ( std::size_t  n)

Generates a vector of cryptographically secure pseudo-random bytes.

Parameters
[in]nThe number of random bytes to generate.
Returns
A std::vector<BYTE> containing the requested number of random bytes.

◆ gen_tmp_path()

std::string arion::gen_tmp_path ( )

Generates a unique temporary file path.

Returns
A string containing the path to a newly generated temporary file.

◆ get_host_cpu_arch()

CPU_ARCH arion::get_host_cpu_arch ( )
inline

Retrieves the CPU architecture of the host system. This function uses preprocessor macros to determine the host architecture at compile time.

Returns
The CPU_ARCH enumeration value corresponding to the host system's architecture.
Exceptions
arion_exception::UnsupportedHostCpuArchExceptionIf the host architecture is not supported (though this is typically prevented by a compile-time error using #error).

◆ int_to_hex()

template<typename T >
std::string arion::int_to_hex ( value,
uint8_t  padding = 0,
bool  prefix = true 
)
inline

Converts an integral value to its hexadecimal string representation.

Template Parameters
TThe integral type of the value.
Parameters
[in]valueThe integral value to convert.
[in]paddingThe width of the padding (number of characters to fill with leading zeros). Default is 0 (no padding).
[in]prefixWhether to include the "0x" prefix. Default is true.
Returns
The hexadecimal string representation of the value.

◆ ipv4_addr_to_string()

std::string arion::ipv4_addr_to_string ( in_addr_t  addr)
inline

Converts a 32-bit IPv4 address (in_addr_t) to a dotted-decimal string.

Parameters
[in]addrThe 32-bit IPv4 address.
Returns
The dotted-decimal string representation (e.g., "192.168.1.1"), or an empty string on error.

◆ ipv6_addr_to_string()

std::string arion::ipv6_addr_to_string ( const uint8_t  addr[16])
inline

Converts a 128-bit IPv6 address (represented as a 16-byte array) to a standard string format.

Parameters
[in]addrPointer to the 16-byte IPv6 address array.
Returns
The standard string representation of the IPv6 address, or an empty string on error.

◆ md5_file()

void arion::md5_file ( FILE *  file,
uint8_t *  result 
)
inline

Calculates the MD5 hash of a file's content. The file stream must be open and readable.

Parameters
[in]filePointer to the open FILE stream.
[out]resultPointer to a 16-byte array where the MD5 digest will be stored.

◆ md5_finalize()

void arion::md5_finalize ( MD5_CTXT ctx)
inline

Finalizes the MD5 calculation. Applies padding, processes the last block, and stores the digest.

Parameters
[in,out]ctxPointer to the MD5 context structure. The final digest is stored in ctx->digest.

◆ md5_hash_file()

std::string arion::md5_hash_file ( std::string  file_path)

Calculates the MD5 hash checksum of a given file.

Parameters
[in]file_pathPath to the file to be hashed.
Returns
The MD5 hash of the file content as a hexadecimal string.

◆ md5_init()

void arion::md5_init ( MD5_CTXT ctx)
inline

Initializes the MD5 context. Sets the size to 0 and the buffers (A, B, C, D) to their initial values.

Parameters
[in]ctxPointer to the MD5 context structure.

◆ md5_step()

void arion::md5_step ( uint32_t *  buffer,
uint32_t *  input 
)
inline

Performs a single MD5 transformation step on a 64-byte block.

Parameters
[in,out]bufferThe current state of the four 32-bit buffers.
[in]inputThe 16 32-bit words (64 bytes) of the block to process.

◆ md5_string()

void arion::md5_string ( char *  input,
uint8_t *  result 
)
inline

Calculates the MD5 hash of a null-terminated string.

Parameters
[in]inputThe null-terminated C string to hash.
[out]resultPointer to a 16-byte array where the MD5 digest will be stored.

◆ md5_update()

void arion::md5_update ( MD5_CTXT ctx,
uint8_t *  input_buffer,
size_t  input_len 
)
inline

Updates the MD5 context with a portion of the input data. Processes full 64-byte blocks and updates the context's total size.

Parameters
[in,out]ctxPointer to the MD5 context structure.
[in]input_bufferPointer to the input data buffer.
[in]input_lenThe length of the input data in bytes.

◆ name_from_path()

std::string arion::name_from_path ( const std::string &  path)
inline

Extracts the filename/name component from a full path string.

Parameters
[in]pathThe full path string.
Returns
The name following the last '/' character, or the original path if no '/' is found.

◆ prot_flags_to_str()

std::string arion::prot_flags_to_str ( PROT_FLAGS  flags)
inline

Converts memory protection flags (PROT_FLAGS) to a simplified "rwx" string format.

Parameters
[in]flagsThe PROT_FLAGS value (e.g., PROT_READ | PROT_WRITE).
Returns
A string representing the permissions (e.g., "rw-").

◆ read_bin_file()

void arion::read_bin_file ( std::string  file_path,
ADDR  off,
size_t  sz,
RD_BIN_CALLBACK  callback 
)

Reads chunks of a binary file and passes them to a callback function. This function reads the file starting at a specific offset for a specific size.

Parameters
[in]file_pathPath to the binary file.
[in]offThe starting byte offset in the file to begin reading.
[in]szThe total number of bytes to read from the file.
[in]callbackThe callback function to receive and process each chunk of data.

◆ rotate_left()

uint32_t arion::rotate_left ( uint32_t  x,
uint32_t  n 
)
inline

Performs a left bitwise rotation on a 32-bit word.

Parameters
[in]xThe 32-bit word to rotate.
[in]nThe number of bits to rotate left by.
Returns
The result of the left rotation.

◆ serialize_arion_file()

std::vector< BYTE > arion::serialize_arion_file ( ARION_FILE arion_f)

◆ serialize_arion_futex()

std::vector< BYTE > arion::serialize_arion_futex ( ARION_FUTEX arion_f)

◆ serialize_arion_mapping()

std::vector< BYTE > arion::serialize_arion_mapping ( ARION_MAPPING arion_m)

◆ serialize_arion_socket()

std::vector< BYTE > arion::serialize_arion_socket ( ARION_SOCKET arion_s)

◆ serialize_arion_thread()

std::vector< BYTE > arion::serialize_arion_thread ( ARION_THREAD arion_t)

◆ str_to_lowercase()

std::string arion::str_to_lowercase ( const std::string &  input)
inline

Converts a string to lowercase.

Parameters
[in]inputThe string to convert.
Returns
The lowercase version of the input string.

◆ str_to_uppercase()

std::string arion::str_to_uppercase ( const std::string &  input)
inline

Converts a string to uppercase.

Parameters
[in]inputThe string to convert.
Returns
The uppercase version of the input string.

◆ strip_str()

std::string arion::strip_str ( const std::string &  str)
inline

Removes leading and trailing whitespace from a string.

Parameters
[in]strThe string to strip.
Returns
The stripped string.

◆ sys_accept()

uint64_t arion::sys_accept ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux accept() syscall, accepting a connection on a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, addr_ptr, addrlen_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new connected socket file descriptor on success, or -1 on error.

◆ sys_accept4()

uint64_t arion::sys_accept4 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux accept4() syscall, accepting a connection with extra flags.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, addr_ptr, addrlen_ptr, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new connected socket file descriptor on success, or -1 on error.

◆ sys_access()

uint64_t arion::sys_access ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux access() syscall, checking user permissions for a file.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, mode).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success (access granted), or -1 on error.

◆ sys_arch_prctl()

uint64_t arion::sys_arch_prctl ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux arch_prctl() syscall, for architecture-specific process control operations (primarily x86-64 thread segment bases).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (function code, address/value).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_bind()

uint64_t arion::sys_bind ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux bind() syscall, assigning a local address to a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, addr_ptr, addrlen).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_brk()

uint64_t arion::sys_brk ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux brk() syscall, changing the size of the data segment (program break).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (addr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new program break address on success, or the current break address on failure.

◆ sys_capget()

uint64_t arion::sys_capget ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux capget() syscall, getting process capabilities.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (header pointer, data pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_capset()

uint64_t arion::sys_capset ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux capset() syscall, setting process capabilities.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (header pointer, data pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_chdir()

uint64_t arion::sys_chdir ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux chdir() syscall, changing the current working directory.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (path_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_clock_getres()

uint64_t arion::sys_clock_getres ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux clock_getres() syscall, getting the resolution of a specified clock.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (clockid, timespec pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_clock_gettime()

uint64_t arion::sys_clock_gettime ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux clock_gettime() syscall, getting the time of a specified clock.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (clockid, timespec pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_clock_nanosleep()

uint64_t arion::sys_clock_nanosleep ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux clock_nanosleep() syscall, suspending execution for an interval with respect to a clock.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (clockid, flags, request timespec pointer, remain timespec pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or an error number on failure.

◆ sys_clone()

uint64_t arion::sys_clone ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux clone() syscall, creating a child process/thread with fine-grained control over what is shared.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (flags, child_stack_ptr, ptid_ptr, ctid_ptr, new_tls).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The thread ID (TID) of the child on success in the parent, 0 in the child, or -1 on error.

◆ sys_clone3()

uint64_t arion::sys_clone3 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux clone3() syscall, creating a child process/thread with an extended argument structure (new modern clone).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (cl_args_ptr, size).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The PID/TID of the child on success in the parent, 0 in the child, or -1 on error.

◆ sys_close()

uint64_t arion::sys_close ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux close() syscall, closing a file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_connect()

uint64_t arion::sys_connect ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux connect() syscall, initiating a connection on a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, addr_ptr, addrlen).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_creat()

uint64_t arion::sys_creat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux creat() syscall, creating a new file or rewriting an existing one.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, mode).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new file descriptor on success, or -1 on error.

◆ sys_dup()

uint64_t arion::sys_dup ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux dup() syscall, duplicating an open file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (oldfd).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new file descriptor on success, or -1 on error.

◆ sys_dup2()

uint64_t arion::sys_dup2 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux dup2() syscall, duplicating an old file descriptor to a specified new file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (oldfd, newfd).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new file descriptor on success, or -1 on error.

◆ sys_execve()

uint64_t arion::sys_execve ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux execve() syscall, executing a program.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, argv_ptr, envp_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
Does not return on success; returns -1 on error.

◆ sys_exit()

uint64_t arion::sys_exit ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux exit() syscall, terminating the calling thread/process with a specified exit status.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (exit_code).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
Does not return.

◆ sys_exit_group()

uint64_t arion::sys_exit_group ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux exit_group() syscall, terminating all threads in the process with a specified exit status.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (exit_code).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
Does not return.

◆ sys_faccessat()

uint64_t arion::sys_faccessat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux faccessat() syscall, checking user permissions relative to a directory file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (dirfd, pathname_ptr, mode, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_fchdir()

uint64_t arion::sys_fchdir ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux fchdir() syscall, changing the current working directory to one specified by a file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_fcntl()

uint64_t arion::sys_fcntl ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux fcntl() syscall, manipulating file descriptor properties.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, cmd, arg).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
A value dependent on the command, or -1 on error.

◆ sys_fork()

uint64_t arion::sys_fork ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux fork() syscall, creating a child process that is a near duplicate of the parent.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The process ID (PID) of the child on success in the parent, 0 in the child, or -1 on error.

◆ sys_fstatfs()

uint64_t arion::sys_fstatfs ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux fstatfs() syscall, getting file system statistics via a file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, statfs structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_ftruncate()

uint64_t arion::sys_ftruncate ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux ftruncate() syscall, truncating a file referred to by a file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, length).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_futex()

uint64_t arion::sys_futex ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux futex() syscall, a fast user-space locking mechanism.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (uaddr, op, val, timeout_ptr, uaddr2, val3).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
A non-negative value on success (meaning depends on op), or -1 on error.

◆ sys_futex_time64()

uint64_t arion::sys_futex_time64 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux futex_time64() syscall, a fast user-space locking mechanism with 64-bit timeout parameter (for compatibility).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (uaddr, op, val, timeout_ptr, uaddr2, val3).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
A non-negative value on success (meaning depends on op), or -1 on error.

◆ sys_getcpu()

uint64_t arion::sys_getcpu ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getcpu() syscall, determining the current CPU and NUMA node.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (cpu_ptr, node_ptr, tcache_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_getcwd()

uint64_t arion::sys_getcwd ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getcwd() syscall, getting the current working directory.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (buf_ptr, size).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The address of the buffer on success, or -1 on error.

◆ sys_getdents64()

uint64_t arion::sys_getdents64 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getdents64() syscall, reading directory entries (64-bit version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, dirent_ptr, count).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes read on success, 0 for EOF, or -1 on error.

◆ sys_getegid()

uint64_t arion::sys_getegid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getegid() syscall, retrieving the effective group ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The effective group ID (EGID) of the calling process.

◆ sys_geteuid()

uint64_t arion::sys_geteuid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux geteuid() syscall, retrieving the effective user ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The effective user ID (EUID) of the calling process.

◆ sys_getgid()

uint64_t arion::sys_getgid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getgid() syscall, retrieving the real group ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The real group ID (GID) of the calling process.

◆ sys_getgroups()

uint64_t arion::sys_getgroups ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getgroups() syscall, getting the list of supplementary group IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (size, list_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of supplementary group IDs on success, or -1 on error.

◆ sys_getpeername()

uint64_t arion::sys_getpeername ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getpeername() syscall, retrieving the remote address of a connected socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, addr_ptr, addrlen_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_getpgid()

uint64_t arion::sys_getpgid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getpgid() syscall, retrieving the process group ID for a specific process ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The process group ID on success, or -1 on error.

◆ sys_getpgrp()

uint64_t arion::sys_getpgrp ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getpgrp() syscall, retrieving the process group ID of the calling process.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The process group ID (PGRP) of the calling process.

◆ sys_getpid()

uint64_t arion::sys_getpid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getpid() syscall, retrieving the process ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The process ID (PID) of the calling process.

◆ sys_getppid()

uint64_t arion::sys_getppid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getppid() syscall, retrieving the parent process ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The parent process ID (PPID) of the calling process.

◆ sys_getrandom()

uint64_t arion::sys_getrandom ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getrandom() syscall, filling a buffer with random bytes.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (buf_ptr, buflen, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes stored in the buffer on success, or -1 on error.

◆ sys_getresgid()

uint64_t arion::sys_getresgid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getresgid() syscall, retrieving the real, effective, and saved set-group IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (real_gid_ptr, effective_gid_ptr, saved_gid_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_getresuid()

uint64_t arion::sys_getresuid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getresuid() syscall, retrieving the real, effective, and saved set-user IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (real_uid_ptr, effective_uid_ptr, saved_uid_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_getrlimit()

uint64_t arion::sys_getrlimit ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getrlimit() syscall, getting resource limits.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (resource, rlimit structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_getsid()

uint64_t arion::sys_getsid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getsid() syscall, retrieving the session ID for a specific process ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The session ID on success, or -1 on error.

◆ sys_getsockname()

uint64_t arion::sys_getsockname ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getsockname() syscall, retrieving the local address of a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, addr_ptr, addrlen_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_getsockopt()

uint64_t arion::sys_getsockopt ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getsockopt() syscall, getting options on a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, level, optname, optval_ptr, optlen_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_gettid()

uint64_t arion::sys_gettid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux gettid() syscall, retrieving the thread ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The thread ID (TID) of the calling thread.

◆ sys_gettimeofday()

uint64_t arion::sys_gettimeofday ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux gettimeofday() syscall, getting the current time and timezone information.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (timeval pointer, timezone pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_getuid()

uint64_t arion::sys_getuid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getuid() syscall, retrieving the real user ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The real user ID (UID) of the calling process.

◆ sys_getxattr()

uint64_t arion::sys_getxattr ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux getxattr() syscall, retrieving an extended attribute value.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (path_ptr, name_ptr, value_ptr, size).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The size of the attribute value, or -1 on error.

◆ sys_ioctl()

uint64_t arion::sys_ioctl ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux ioctl() syscall, controlling devices.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, request, argument).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
A value dependent on the request, or -1 on error.

◆ sys_kill()

uint64_t arion::sys_kill ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux kill() syscall, sending a signal to a process or process group.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pid, sig).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_lgetxattr()

uint64_t arion::sys_lgetxattr ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux lgetxattr() syscall, retrieving an extended attribute value from a symbolic link.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (path_ptr, name_ptr, value_ptr, size).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The size of the attribute value, or -1 on error.

◆ sys_link()

uint64_t arion::sys_link ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux link() syscall, creating a new hard link to an existing file.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (oldpath_ptr, newpath_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_listen()

uint64_t arion::sys_listen ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux listen() syscall, listening for connections on a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, backlog).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_lseek()

uint64_t arion::sys_lseek ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux lseek() syscall, repositioning the offset of an open file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, offset, whence).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The resulting offset location on success, or -1 on error.

◆ sys_mkdir()

uint64_t arion::sys_mkdir ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux mkdir() syscall, creating a directory.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, mode).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_mmap()

uint64_t arion::sys_mmap ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux mmap() syscall, mapping files or devices into memory.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (addr, len, prot, flags, fd, offset).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The address of the mapped area on success, or MAP_FAILED (-1) on error.

◆ sys_mmap2()

uint64_t arion::sys_mmap2 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux mmap2() syscall, mapping files or devices into memory (32-bit Linux optimized version using page-sized offset).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (addr, len, prot, flags, fd, pgoffset).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The address of the mapped area on success, or MAP_FAILED (-1) on error.

◆ sys_mprotect()

uint64_t arion::sys_mprotect ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux mprotect() syscall, setting protection on a region of memory.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (addr, len, prot).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_munmap()

uint64_t arion::sys_munmap ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux munmap() syscall, unmapping files or devices from memory.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (addr, len).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_newfstat()

uint64_t arion::sys_newfstat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux fstat() syscall, getting file status from a file descriptor (new version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, stat structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_newfstatat()

uint64_t arion::sys_newfstatat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux fstatat() syscall, getting file status relative to a directory file descriptor (new version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (dirfd, pathname_ptr, stat structure pointer, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_newlstat()

uint64_t arion::sys_newlstat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux lstat() syscall, getting file status for a symbolic link (new version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, stat structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_newstat()

uint64_t arion::sys_newstat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux stat() syscall, getting file status (new version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, stat structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_newuname()

uint64_t arion::sys_newuname ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux newuname() syscall, retrieving system information.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (struct newutsname pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_open()

uint64_t arion::sys_open ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux open() syscall, opening a file and returning a file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, flags, mode).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new file descriptor on success, or -1 on error.

◆ sys_openat()

uint64_t arion::sys_openat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux openat() syscall, opening a file relative to a directory file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (dirfd, pathname_ptr, flags, mode).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new file descriptor on success, or -1 on error.

◆ sys_pause()

uint64_t arion::sys_pause ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux pause() syscall, suspending the process until a signal is received.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
Always returns -1 with EINTR (interrupted system call).

◆ sys_poll()

uint64_t arion::sys_poll ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux poll() syscall, waiting for some event on a file descriptor set.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pollfd array pointer, number of file descriptors, timeout).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of file descriptors ready for I/O, 0 if timed out, or -1 on error.

◆ sys_ppoll()

uint64_t arion::sys_ppoll ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux ppoll() syscall, waiting for some event on a file descriptor set with a signal mask.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pollfd array pointer, number of file descriptors, timeout_ptr, sigmask_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of file descriptors ready for I/O, 0 if timed out, or -1 on error.

◆ sys_pread64()

uint64_t arion::sys_pread64 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux pread64() syscall, reading data at a specified offset.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, buf_ptr, count, offset).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes read on success, 0 for EOF, or -1 on error.

◆ sys_prlimit64()

uint64_t arion::sys_prlimit64 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux prlimit64() syscall, getting/setting resource limits for an arbitrary process.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pid, resource, new_rlimit pointer, old_rlimit pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_pselect6()

uint64_t arion::sys_pselect6 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux pselect6() syscall, synchronous I/O multiplexing with a signal mask.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (nfds, readfds_ptr, writefds_ptr, exceptfds_ptr, timeout_ptr, sigmask_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of ready file descriptors, 0 if timed out, or -1 on error.

◆ sys_pwrite64()

uint64_t arion::sys_pwrite64 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux pwrite64() syscall, writing data at a specified offset.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, buf_ptr, count, offset).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes written on success, or -1 on error.

◆ sys_read()

uint64_t arion::sys_read ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux read() syscall, reading data from a file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, buf_ptr, count).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes read on success, 0 for EOF, or -1 on error.

◆ sys_readlink()

uint64_t arion::sys_readlink ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux readlink() syscall, reading the value of a symbolic link.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, buf_ptr, bufsiz).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes placed in the buffer on success, or -1 on error.

◆ sys_readlinkat()

uint64_t arion::sys_readlinkat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux readlinkat() syscall, reading the value of a symbolic link relative to a directory file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (dirfd, pathname_ptr, buf_ptr, bufsiz).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes placed in the buffer on success, or -1 on error.

◆ sys_readv()

uint64_t arion::sys_readv ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux readv() syscall, reading data into multiple buffers.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, iovec array pointer, count).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The total number of bytes read on success, or -1 on error.

◆ sys_recv()

uint64_t arion::sys_recv ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux recv() syscall, receiving data on a connected socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, buf_ptr, len, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes received on success, or -1 on error.

◆ sys_recvfrom()

uint64_t arion::sys_recvfrom ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux recvfrom() syscall, receiving a message from a socket and recording the source address.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, buf_ptr, len, flags, src_addr_ptr, addrlen_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes received on success, or -1 on error.

◆ sys_recvmmsg()

uint64_t arion::sys_recvmmsg ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux recvmmsg() syscall, receiving multiple messages from a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, mmsghdr array pointer, vlen, flags, timeout_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of messages received on success, or -1 on error.

◆ sys_recvmsg()

uint64_t arion::sys_recvmsg ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux recvmsg() syscall, receiving a message using a msghdr structure.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, msghdr structure pointer, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes received on success, or -1 on error.

◆ sys_rename()

uint64_t arion::sys_rename ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux rename() syscall, changing the name or location of a file.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (oldpath_ptr, newpath_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_renameat()

uint64_t arion::sys_renameat ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux renameat() syscall, changing the name or location of a file relative to directory file descriptors.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (olddirfd, oldpath_ptr, newdirfd, newpath_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_renameat2()

uint64_t arion::sys_renameat2 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux renameat2() syscall, renaming a file with extra flags.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (olddirfd, oldpath_ptr, newdirfd, newpath_ptr, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_rmdir()

uint64_t arion::sys_rmdir ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux rmdir() syscall, deleting a directory.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_rseq()

uint64_t arion::sys_rseq ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux rseq() syscall, registering a Restartable Sequence for fast user-space synchronization.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (rseq_addr, rseq_len, flags, sig).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_rt_sigaction()

uint64_t arion::sys_rt_sigaction ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux rt_sigaction() syscall, allowing examination and change of a signal action (real-time safe version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (signum, act_ptr, oldact_ptr, sigsetsize).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_rt_sigreturn()

uint64_t arion::sys_rt_sigreturn ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux rt_sigreturn() syscall, returning from a signal handler (real-time safe version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
Does not return on success; returns -1 on error if it attempts to return.

◆ sys_sched_rr_get_interval()

uint64_t arion::sys_sched_rr_get_interval ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux sched_rr_get_interval() syscall, retrieving the time slice allocated to a round-robin thread.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pid, timespec pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_select()

uint64_t arion::sys_select ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux select() syscall, synchronous I/O multiplexing.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (nfds, readfds_ptr, writefds_ptr, exceptfds_ptr, timeout_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of ready file descriptors, 0 if timed out, or -1 on error.

◆ sys_send()

uint64_t arion::sys_send ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux send() syscall, sending data on a connected socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, buf_ptr, len, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes sent on success, or -1 on error.

◆ sys_sendmmsg()

uint64_t arion::sys_sendmmsg ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux sendmmsg() syscall, sending multiple messages on a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, mmsghdr array pointer, vlen, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of messages sent on success, or -1 on error.

◆ sys_sendmsg()

uint64_t arion::sys_sendmsg ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux sendmsg() syscall, sending a message using a msghdr structure.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, msghdr structure pointer, flags).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes sent on success, or -1 on error.

◆ sys_sendto()

uint64_t arion::sys_sendto ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux sendto() syscall, sending a message on a socket to a specified address.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, buf_ptr, len, flags, dest_addr_ptr, addrlen).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes sent on success, or -1 on error.

◆ sys_set_robust_list()

uint64_t arion::sys_set_robust_list ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux set_robust_list() syscall, setting the head of the thread's robust futex list.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (head_ptr, len).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_set_thread_area()

uint64_t arion::sys_set_thread_area ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux set_thread_area() syscall, setting a Thread Local Storage (TLS) segment register for the calling thread (legacy x86).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (user_desc_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_set_tid_address()

uint64_t arion::sys_set_tid_address ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux set_tid_address() syscall, setting a pointer to the thread ID for the futex mechanism.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (tidptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The thread ID (TID) of the calling thread.

◆ sys_set_tls()

uint64_t arion::sys_set_tls ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux set_tls() syscall, setting the Thread Local Storage (TLS) for the calling thread (modern architecture version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (tls_val).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setfsgid()

uint64_t arion::sys_setfsgid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setfsgid() syscall, setting the File System Group ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fsgid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The previous File System Group ID.

◆ sys_setfsuid()

uint64_t arion::sys_setfsuid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setfsuid() syscall, setting the File System User ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fsuid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The previous File System User ID.

◆ sys_setgid()

uint64_t arion::sys_setgid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setgid() syscall, setting the effective group ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (new GID).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setgroups()

uint64_t arion::sys_setgroups ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setgroups() syscall, setting the list of supplementary group IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (size, list_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setpgid()

uint64_t arion::sys_setpgid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setpgid() syscall, setting the process group ID of a process.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pid, pgid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setregid()

uint64_t arion::sys_setregid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setregid() syscall, setting the real and effective group IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (real_gid, effective_gid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setresgid()

uint64_t arion::sys_setresgid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setresgid() syscall, setting the real, effective, and saved set-group IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (real_gid, effective_gid, saved_gid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setresuid()

uint64_t arion::sys_setresuid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setresuid() syscall, setting the real, effective, and saved set-user IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (real_uid, effective_uid, saved_uid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setreuid()

uint64_t arion::sys_setreuid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setreuid() syscall, setting the real and effective user IDs.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (real_uid, effective_uid).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setsid()

uint64_t arion::sys_setsid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setsid() syscall, creating a new session and setting the process group ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new session ID (SID) on success, or -1 on error.

◆ sys_setsockopt()

uint64_t arion::sys_setsockopt ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setsockopt() syscall, setting options on a socket.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, level, optname, optval_ptr, optlen).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_setuid()

uint64_t arion::sys_setuid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux setuid() syscall, setting the effective user ID.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (new UID).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_shutdown()

uint64_t arion::sys_shutdown ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux shutdown() syscall, shutting down part of a full-duplex connection.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sockfd, how).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_sigreturn()

uint64_t arion::sys_sigreturn ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux sigreturn() syscall, returning from a signal handler (legacy version).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters.
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
Does not return on success; returns -1 on error if it attempts to return.

◆ sys_socket()

uint64_t arion::sys_socket ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux socket() syscall, creating an endpoint for communication.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (domain, type, protocol).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The new socket file descriptor on success, or -1 on error.

◆ sys_socketcall()

uint64_t arion::sys_socketcall ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux socketcall() syscall (legacy/32-bit Linux wrapper for socket-related calls).

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (call, args_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The result of the underlying socket operation, or -1 on error.

◆ sys_socketpair()

uint64_t arion::sys_socketpair ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux socketpair() syscall, creating a pair of connected sockets.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (domain, type, protocol, sv_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_statfs()

uint64_t arion::sys_statfs ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux statfs() syscall, getting file system statistics.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr, statfs structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_statx()

uint64_t arion::sys_statx ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux statx() syscall, getting file status with extended information.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (dirfd, pathname_ptr, flags, mask, statx structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_symlink()

uint64_t arion::sys_symlink ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux symlink() syscall, creating a new symbolic link.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (target_ptr, linkpath_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_sysinfo()

uint64_t arion::sys_sysinfo ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux sysinfo() syscall, retrieving overall system statistics.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (sysinfo structure pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_tgkill()

uint64_t arion::sys_tgkill ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux tgkill() syscall, sending a signal to a specific thread within a process group.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (tgid, tid, sig).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_time()

uint64_t arion::sys_time ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux time() syscall, retrieving the current time as seconds since the Epoch.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (time_t pointer).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The current time on success, or -1 on error.

◆ sys_truncate()

uint64_t arion::sys_truncate ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux truncate() syscall, truncating a file to a specified length.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (path_ptr, length).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_unlink()

uint64_t arion::sys_unlink ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux unlink() syscall, deleting a name and possibly the file it refers to.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pathname_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_wait4()

uint64_t arion::sys_wait4 ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux wait4() syscall, waiting for process termination, reporting resource usage.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (pid, wstatus_ptr, options, rusage_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The PID of the terminated child, 0 if non-blocking and no child has exited, or -1 on error.

◆ sys_waitid()

uint64_t arion::sys_waitid ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux waitid() syscall, waiting for a state change in a child process.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (idtype, id, infop_ptr, options, rusage_ptr).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
0 on success, or -1 on error.

◆ sys_write()

uint64_t arion::sys_write ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux write() syscall, writing data to a file descriptor.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, buf_ptr, count).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The number of bytes written on success, or -1 on error.

◆ sys_writev()

uint64_t arion::sys_writev ( std::shared_ptr< Arion arion,
std::vector< SYS_PARAM params,
bool &  cancel 
)

Emulates the Linux writev() syscall, writing data from multiple buffers.

Parameters
[in]arionShared pointer to the main Arion instance.
[in]paramsVector of system call parameters (fd, iovec array pointer, count).
[out]cancel**(Output)** If set to true, the syscall execution is deferred, the PC is rewound, and the return value is ignored.
Returns
The total number of bytes written on success, or -1 on error.

Variable Documentation

◆ ARCH_FROM_NAME

std::map<std::string, CPU_ARCH> arion::ARCH_FROM_NAME
inline
Initial value:
{{"UNKNOWN", CPU_ARCH::UNKNOWN_ARCH},
{"X86", CPU_ARCH::X86_ARCH},
{"X86-64", CPU_ARCH::X8664_ARCH},
{"ARM", CPU_ARCH::ARM_ARCH},
{"ARM64", CPU_ARCH::ARM64_ARCH}}

A map identifying a CPU architecture given its name.

◆ arion_log_colors_str

std::map<LOG_COLOR, std::string> arion::arion_log_colors_str
inline
Initial value:
= {
{LOG_COLOR::DEFAULT, "\033[39m"}, {LOG_COLOR::BLACK, "\033[30m"}, {LOG_COLOR::DARK_RED, "\033[31m"},
{LOG_COLOR::DARK_GREEN, "\033[32m"}, {LOG_COLOR::DARK_YELLOW, "\033[33m"}, {LOG_COLOR::DARK_BLUE, "\033[34m"},
{LOG_COLOR::DARK_MAGENTA, "\033[35m"}, {LOG_COLOR::DARK_CYAN, "\033[36m"}, {LOG_COLOR::LIGHT_GRAY, "\033[37m"},
{LOG_COLOR::DARK_GRAY, "\033[90m"}, {LOG_COLOR::RED, "\033[91m"}, {LOG_COLOR::GREEN, "\033[92m"},
{LOG_COLOR::ORANGE, "\033[93m"}, {LOG_COLOR::BLUE, "\033[94m"}, {LOG_COLOR::MAGENTA, "\033[95m"},
{LOG_COLOR::CYAN, "\033[96m"}, {LOG_COLOR::WHITE, "\033[97m"},
}

A map identifying an ANSI color code given its associated Arion LOG_COLOR.

◆ ARION_TO_CS_ARCH

std::map<CPU_ARCH, std::vector<std::pair<cs_arch, cs_mode> > > arion::ARION_TO_CS_ARCH
extern

Ensures the conversion between Arion CPU_ARCH and Capstone CPU architectures and modes.

◆ ARION_TO_KS_ARCH

std::map<CPU_ARCH, std::vector<std::pair<ks_arch, ks_mode> > > arion::ARION_TO_KS_ARCH
extern

Ensures the conversion between Arion CPU_ARCH and Keystone CPU architectures and modes.

◆ ARION_TO_UC_ARCH

std::map<CPU_ARCH, std::pair<uc_arch, uc_mode> > arion::ARION_TO_UC_ARCH
extern

Ensures the conversion between Arion CPU_ARCH and Unicorn CPU architectures and modes.

◆ ARION_UC_HOOK_FUNCS

std::map<ARION_HOOK_TYPE, void *> arion::ARION_UC_HOOK_FUNCS
extern

A map identifying a hook function given its associated Arion hook type.

◆ ARION_UC_HOOK_TYPES

std::map<ARION_HOOK_TYPE, uc_hook_type> arion::ARION_UC_HOOK_TYPES
extern

A map identifying a Unicorn hook type given its associated Arion hook type.

◆ CONTEXT_FILE_MAGIC

const char arion::CONTEXT_FILE_MAGIC[] = "ARIONCTX"

Magic string for headers of Arion context files.

◆ CONTEXT_FILE_VERSION

const float arion::CONTEXT_FILE_VERSION = 1.0

Version number of Arion context file format.

◆ EMPTY

const size_t arion::EMPTY = 0

A 64-bit zero-initialized value for various purposes.

◆ K

uint32_t arion::K[]
static
Initial value:
= {0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391}

Array of 64 pre-calculated sine constants K[i] used in the MD5 algorithm.

◆ lief_arion_file_types

std::map<LIEF::ELF::Header::FILE_TYPE, ELF_FILE_TYPE> arion::lief_arion_file_types
extern

Mapping from LIEF's internal ELF file type enumeration to Arion's ELF_FILE_TYPE.

◆ NAME_FROM_ARCH

std::map<CPU_ARCH, std::string> arion::NAME_FROM_ARCH
inline
Initial value:
{{CPU_ARCH::UNKNOWN_ARCH, "UNKNOWN"},
{CPU_ARCH::X86_ARCH, "X86"},
{CPU_ARCH::X8664_ARCH, "X86-64"},
{CPU_ARCH::ARM_ARCH, "ARM"},
{CPU_ARCH::ARM64_ARCH, "ARM64"}}

A map identifying a name corresponding a given CPU architecture.

◆ PADDING

uint8_t arion::PADDING[]
static
Initial value:
= {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

The MD5 padding constant array.

◆ PARAMS_N_BY_SYSCALL_NAME

std::map<std::string, uint8_t> arion::PARAMS_N_BY_SYSCALL_NAME
extern

Global map storing the number of parameters required for a syscall, indexed by its string name.

◆ S

uint32_t arion::S[]
static
Initial value:
= {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9,
14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21}

Array of shift amounts S[i] used in the MD5 algorithm.

◆ TRACER_FILE_HEADER_SIZE

const uint16_t arion::TRACER_FILE_HEADER_SIZE = 0x28

Header size of Arion tracer files.

◆ TRACER_FILE_MAGIC

const char arion::TRACER_FILE_MAGIC[] = "ARIONTRC"

Magic string for headers of Arion tracer files.

◆ TRACER_FILE_VERSION

const float arion::TRACER_FILE_VERSION = 1.0

Version number of Arion tracer file format.

◆ UC_AFL_ERR_STR

std::map<uc_afl_ret, std::string> arion::UC_AFL_ERR_STR
inline
Initial value:
= {
{UC_AFL_RET_CHILD, "Fork worked. We are a child (no error)."},
{UC_AFL_RET_NO_AFL, "No AFL, no need to fork (but no real error)."},
{UC_AFL_RET_FINISHED, "We forked before but now AFL is gone (time to quit)."},
{UC_AFL_RET_CALLED_TWICE, "Forkserver already running. This may be an error."},
{UC_AFL_RET_ERROR, "Something went horribly wrong in the parent."}}

A map identifying a UnicornAFL error message given its error code.