The Pedigree Project  0.1
Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
X64SyscallState Class Reference

#include <state.h>

+ Collaboration diagram for X64SyscallState:

Public Member Functions

uintptr_t getStackPointer () const
 
void setStackPointer (uintptr_t stackPointer)
 
uintptr_t getInstructionPointer () const
 
void setInstructionPointer (uintptr_t instructionPointer)
 
uintptr_t getBasePointer () const
 
void setBasePointer (uintptr_t basePointer)
 
size_t getRegisterCount () const
 
processor_register_t getRegister (size_t index) const
 
const char * getRegisterName (size_t index) const
 
size_t getRegisterSize (size_t index) const
 
size_t getSyscallService () const
 
size_t getSyscallNumber () const
 
uintptr_t getSyscallParameter (size_t n) const
 
void setSyscallReturnValue (uintptr_t val)
 
void setSyscallErrno (uintptr_t val)
 
uint64_t getFlags () const
 
void setFlags (uint64_t newFlags)
 

Public Attributes

uint64_t m_R15
 
uint64_t m_R14
 
uint64_t m_R13
 
uint64_t m_R12
 
uint64_t m_R10
 
uint64_t m_R9
 
uint64_t m_R8
 
uint64_t m_Rbp
 
uint64_t m_Rsi
 
uint64_t m_Rdi
 

Private Attributes

uint64_t m_Rdx
 
uint64_t m_Rbx
 
uint64_t m_Rax
 
uint64_t m_RFlagsR11
 
uint64_t m_RipRcx
 
uint64_t m_Rsp
 

Friends

class X64ProcessorState
 
class X64SyscallManager
 

Detailed Description

x64 Syscall State

Definition at line 169 of file x64/state.h.

Member Function Documentation

uintptr_t X64SyscallState::getBasePointer ( ) const
inline

Get the base-pointer

Returns
the base-pointer

Definition at line 444 of file x64/state.h.

References X64InterruptState::m_Rbp.

uintptr_t X64SyscallState::getInstructionPointer ( ) const
inline

Get the instruction-pointer of the next instruction that is executed after the syscall is processed

Returns
the instruction-pointer

Definition at line 436 of file x64/state.h.

processor_register_t X64SyscallState::getRegister ( size_t  index) const
size_t X64SyscallState::getRegisterCount ( ) const

Get the number of registers

Returns
the number of registers

Definition at line 119 of file x64/state.cc.

const char * X64SyscallState::getRegisterName ( size_t  index) const

Get the name of a specific register

Parameters
[in]indexthe index of the register (from 0 to getRegisterCount() - 1)
Returns
the name of the register

Definition at line 159 of file x64/state.cc.

size_t X64SyscallState::getRegisterSize ( size_t  index) const
inline

Get the register's size in bytes

Parameters
[in]indexthe index of the register (from 0 to getRegisterCount() - 1)
Returns
the register size in bytes

Definition at line 452 of file x64/state.h.

uintptr_t X64SyscallState::getStackPointer ( ) const
inline

Get the stack-pointer before the syscall occured

Returns
the stack-pointer before the syscall

Definition at line 428 of file x64/state.h.

References X64InterruptState::m_Rsp.

size_t X64SyscallState::getSyscallNumber ( ) const
inline

Get the syscall function number

Returns
the syscall function number

Definition at line 461 of file x64/state.h.

References X64InterruptState::m_Rax.

uintptr_t X64SyscallState::getSyscallParameter ( size_t  n) const
inline
size_t X64SyscallState::getSyscallService ( ) const
inline

Get the syscall service number

Returns
the syscall service number

Definition at line 457 of file x64/state.h.

References X64InterruptState::m_Rax.

void X64SyscallState::setBasePointer ( uintptr_t  basePointer)
inline

Set the base-pointer

Parameters
[in]basePointerthe new base-pointer

Definition at line 448 of file x64/state.h.

References X64InterruptState::m_Rbp.

void X64SyscallState::setInstructionPointer ( uintptr_t  instructionPointer)
inline

Set the instruction-pointer

Parameters
[in]instructionPointerthe new instruction-pointer

Definition at line 440 of file x64/state.h.

void X64SyscallState::setStackPointer ( uintptr_t  stackPointer)
inline

Set the userspace stack-pointer

Parameters
[in]stackPointerthe new stack-pointer

Definition at line 432 of file x64/state.h.

References X64InterruptState::m_Rsp.

Member Data Documentation

uint64_t X64SyscallState::m_R10

The R10 general purpose register

Definition at line 244 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_R12

The R12 general purpose register

Definition at line 242 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_R13

The R14 general purpose register

Definition at line 240 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_R14

The R14 general purpose register

Definition at line 238 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_R15

The R15 general purpose register

Definition at line 236 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_R8

The R8 general purpose register

Definition at line 248 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_R9

The R9 general purpose register

Definition at line 246 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_Rax
private

The RAX general purpose register

Definition at line 264 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_Rbp

The base-pointer

Definition at line 250 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_Rbx
private

The RBX general purpose register

Definition at line 262 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_Rdi

The RDI general purpose register

Definition at line 256 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_Rdx
private

The RDX general purpose register

Definition at line 260 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_RFlagsR11
private

The R11/RFlags register

Definition at line 266 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_RipRcx
private

The RIP/RCX register

Definition at line 268 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_Rsi

The RSI general purpose register

Definition at line 254 of file x64/state.h.

Referenced by X64ProcessorState::operator=().

uint64_t X64SyscallState::m_Rsp
private

The stack-pointer

Definition at line 270 of file x64/state.h.

Referenced by X64ProcessorState::operator=().


The documentation for this class was generated from the following files: