miasm
Reverse engineering framework
miasm.os_dep.linux.syscall Namespace Reference

Functions

def sys_x86_64_rt_sigaction (jitter, linux_env)
 
def sys_generic_brk (jitter, linux_env)
 
def sys_x86_32_newuname (jitter, linux_env)
 
def sys_x86_64_newuname (jitter, linux_env)
 
def sys_arml_newuname (jitter, linux_env)
 
def sys_generic_access (jitter, linux_env)
 
def sys_x86_64_openat (jitter, linux_env)
 
def sys_x86_64_newstat (jitter, linux_env)
 
def sys_arml_stat64 (jitter, linux_env)
 
def sys_x86_64_writev (jitter, linux_env)
 
def sys_arml_writev (jitter, linux_env)
 
def sys_generic_exit_group (jitter, linux_env)
 
def sys_generic_read (jitter, linux_env)
 
def sys_x86_64_fstat (jitter, linux_env)
 
def sys_arml_fstat64 (jitter, linux_env)
 
def sys_generic_mmap (jitter, linux_env)
 
def sys_generic_mmap2 (jitter, linux_env)
 
def sys_generic_mprotect (jitter, linux_env)
 
def sys_generic_close (jitter, linux_env)
 
def sys_x86_64_arch_prctl (jitter, linux_env)
 
def sys_x86_64_set_tid_address (jitter, linux_env)
 
def sys_x86_64_set_robust_list (jitter, linux_env)
 
def sys_x86_64_rt_sigprocmask (jitter, linux_env)
 
def sys_x86_64_prlimit64 (jitter, linux_env)
 
def sys_x86_64_statfs (jitter, linux_env)
 
def sys_x86_64_ioctl (jitter, linux_env)
 
def sys_arml_ioctl (jitter, linux_env)
 
def sys_generic_open (jitter, linux_env)
 
def sys_generic_write (jitter, linux_env)
 
def sys_x86_64_getdents (jitter, linux_env)
 
def sys_arml_getdents64 (jitter, linux_env)
 
def sys_x86_64_newlstat (jitter, linux_env)
 
def sys_arml_lstat64 (jitter, linux_env)
 
def sys_x86_64_lgetxattr (jitter, linux_env)
 
def sys_x86_64_getxattr (jitter, linux_env)
 
def sys_x86_64_socket (jitter, linux_env)
 
def sys_x86_64_connect (jitter, linux_env)
 
def sys_x86_64_clock_gettime (jitter, linux_env)
 
def sys_x86_64_lseek (jitter, linux_env)
 
def sys_x86_64_munmap (jitter, linux_env)
 
def sys_x86_64_readlink (jitter, linux_env)
 
def sys_x86_64_getpid (jitter, linux_env)
 
def sys_x86_64_sysinfo (jitter, linux_env)
 
def sys_generic_geteuid (jitter, linux_env)
 
def sys_generic_getegid (jitter, linux_env)
 
def sys_generic_getuid (jitter, linux_env)
 
def sys_generic_getgid (jitter, linux_env)
 
def sys_generic_setgid (jitter, linux_env)
 
def sys_generic_setuid (jitter, linux_env)
 
def sys_arml_set_tls (jitter, linux_env)
 
def sys_generic_fcntl64 (jitter, linux_env)
 
def sys_x86_64_pread64 (jitter, linux_env)
 
def sys_arml_gettimeofday (jitter, linux_env)
 
def syscall_x86_64_exception_handler (linux_env, syscall_callbacks, jitter)
 
def syscall_x86_32_exception_handler (linux_env, syscall_callbacks, jitter)
 
def syscall_arml_exception_handler (linux_env, syscall_callbacks, jitter)
 
def enable_syscall_handling (jitter, linux_env, syscall_callbacks)
 

Variables

 log = logging.getLogger('syscalls')
 
 hnd = logging.StreamHandler()
 
dictionary syscall_callbacks_x86_32
 
dictionary syscall_callbacks_x86_64
 
dictionary syscall_callbacks_arml
 

Function Documentation

◆ enable_syscall_handling()

def miasm.os_dep.linux.syscall.enable_syscall_handling (   jitter,
  linux_env,
  syscall_callbacks 
)
Activate handling of syscall for the current jitter instance.
Syscall handlers are provided by @syscall_callbacks
@linux_env: LinuxEnvironment instance
@syscall_callbacks: syscall number -> func(jitter, linux_env)

Example of use:
>>> linux_env = LinuxEnvironment_x86_64()
>>> enable_syscall_handling(jitter, linux_env, syscall_callbacks_x86_64)

◆ sys_arml_fstat64()

def miasm.os_dep.linux.syscall.sys_arml_fstat64 (   jitter,
  linux_env 
)

◆ sys_arml_getdents64()

def miasm.os_dep.linux.syscall.sys_arml_getdents64 (   jitter,
  linux_env 
)

◆ sys_arml_gettimeofday()

def miasm.os_dep.linux.syscall.sys_arml_gettimeofday (   jitter,
  linux_env 
)

◆ sys_arml_ioctl()

def miasm.os_dep.linux.syscall.sys_arml_ioctl (   jitter,
  linux_env 
)

◆ sys_arml_lstat64()

def miasm.os_dep.linux.syscall.sys_arml_lstat64 (   jitter,
  linux_env 
)

◆ sys_arml_newuname()

def miasm.os_dep.linux.syscall.sys_arml_newuname (   jitter,
  linux_env 
)

◆ sys_arml_set_tls()

def miasm.os_dep.linux.syscall.sys_arml_set_tls (   jitter,
  linux_env 
)

◆ sys_arml_stat64()

def miasm.os_dep.linux.syscall.sys_arml_stat64 (   jitter,
  linux_env 
)

◆ sys_arml_writev()

def miasm.os_dep.linux.syscall.sys_arml_writev (   jitter,
  linux_env 
)

◆ sys_generic_access()

def miasm.os_dep.linux.syscall.sys_generic_access (   jitter,
  linux_env 
)

◆ sys_generic_brk()

def miasm.os_dep.linux.syscall.sys_generic_brk (   jitter,
  linux_env 
)

◆ sys_generic_close()

def miasm.os_dep.linux.syscall.sys_generic_close (   jitter,
  linux_env 
)

◆ sys_generic_exit_group()

def miasm.os_dep.linux.syscall.sys_generic_exit_group (   jitter,
  linux_env 
)

◆ sys_generic_fcntl64()

def miasm.os_dep.linux.syscall.sys_generic_fcntl64 (   jitter,
  linux_env 
)

◆ sys_generic_getegid()

def miasm.os_dep.linux.syscall.sys_generic_getegid (   jitter,
  linux_env 
)

◆ sys_generic_geteuid()

def miasm.os_dep.linux.syscall.sys_generic_geteuid (   jitter,
  linux_env 
)

◆ sys_generic_getgid()

def miasm.os_dep.linux.syscall.sys_generic_getgid (   jitter,
  linux_env 
)

◆ sys_generic_getuid()

def miasm.os_dep.linux.syscall.sys_generic_getuid (   jitter,
  linux_env 
)

◆ sys_generic_mmap()

def miasm.os_dep.linux.syscall.sys_generic_mmap (   jitter,
  linux_env 
)

◆ sys_generic_mmap2()

def miasm.os_dep.linux.syscall.sys_generic_mmap2 (   jitter,
  linux_env 
)

◆ sys_generic_mprotect()

def miasm.os_dep.linux.syscall.sys_generic_mprotect (   jitter,
  linux_env 
)

◆ sys_generic_open()

def miasm.os_dep.linux.syscall.sys_generic_open (   jitter,
  linux_env 
)

◆ sys_generic_read()

def miasm.os_dep.linux.syscall.sys_generic_read (   jitter,
  linux_env 
)

◆ sys_generic_setgid()

def miasm.os_dep.linux.syscall.sys_generic_setgid (   jitter,
  linux_env 
)

◆ sys_generic_setuid()

def miasm.os_dep.linux.syscall.sys_generic_setuid (   jitter,
  linux_env 
)

◆ sys_generic_write()

def miasm.os_dep.linux.syscall.sys_generic_write (   jitter,
  linux_env 
)

◆ sys_x86_32_newuname()

def miasm.os_dep.linux.syscall.sys_x86_32_newuname (   jitter,
  linux_env 
)

◆ sys_x86_64_arch_prctl()

def miasm.os_dep.linux.syscall.sys_x86_64_arch_prctl (   jitter,
  linux_env 
)

◆ sys_x86_64_clock_gettime()

def miasm.os_dep.linux.syscall.sys_x86_64_clock_gettime (   jitter,
  linux_env 
)

◆ sys_x86_64_connect()

def miasm.os_dep.linux.syscall.sys_x86_64_connect (   jitter,
  linux_env 
)

◆ sys_x86_64_fstat()

def miasm.os_dep.linux.syscall.sys_x86_64_fstat (   jitter,
  linux_env 
)

◆ sys_x86_64_getdents()

def miasm.os_dep.linux.syscall.sys_x86_64_getdents (   jitter,
  linux_env 
)

◆ sys_x86_64_getpid()

def miasm.os_dep.linux.syscall.sys_x86_64_getpid (   jitter,
  linux_env 
)

◆ sys_x86_64_getxattr()

def miasm.os_dep.linux.syscall.sys_x86_64_getxattr (   jitter,
  linux_env 
)

◆ sys_x86_64_ioctl()

def miasm.os_dep.linux.syscall.sys_x86_64_ioctl (   jitter,
  linux_env 
)

◆ sys_x86_64_lgetxattr()

def miasm.os_dep.linux.syscall.sys_x86_64_lgetxattr (   jitter,
  linux_env 
)

◆ sys_x86_64_lseek()

def miasm.os_dep.linux.syscall.sys_x86_64_lseek (   jitter,
  linux_env 
)

◆ sys_x86_64_munmap()

def miasm.os_dep.linux.syscall.sys_x86_64_munmap (   jitter,
  linux_env 
)

◆ sys_x86_64_newlstat()

def miasm.os_dep.linux.syscall.sys_x86_64_newlstat (   jitter,
  linux_env 
)

◆ sys_x86_64_newstat()

def miasm.os_dep.linux.syscall.sys_x86_64_newstat (   jitter,
  linux_env 
)

◆ sys_x86_64_newuname()

def miasm.os_dep.linux.syscall.sys_x86_64_newuname (   jitter,
  linux_env 
)

◆ sys_x86_64_openat()

def miasm.os_dep.linux.syscall.sys_x86_64_openat (   jitter,
  linux_env 
)

◆ sys_x86_64_pread64()

def miasm.os_dep.linux.syscall.sys_x86_64_pread64 (   jitter,
  linux_env 
)

◆ sys_x86_64_prlimit64()

def miasm.os_dep.linux.syscall.sys_x86_64_prlimit64 (   jitter,
  linux_env 
)

◆ sys_x86_64_readlink()

def miasm.os_dep.linux.syscall.sys_x86_64_readlink (   jitter,
  linux_env 
)

◆ sys_x86_64_rt_sigaction()

def miasm.os_dep.linux.syscall.sys_x86_64_rt_sigaction (   jitter,
  linux_env 
)

◆ sys_x86_64_rt_sigprocmask()

def miasm.os_dep.linux.syscall.sys_x86_64_rt_sigprocmask (   jitter,
  linux_env 
)

◆ sys_x86_64_set_robust_list()

def miasm.os_dep.linux.syscall.sys_x86_64_set_robust_list (   jitter,
  linux_env 
)

◆ sys_x86_64_set_tid_address()

def miasm.os_dep.linux.syscall.sys_x86_64_set_tid_address (   jitter,
  linux_env 
)

◆ sys_x86_64_socket()

def miasm.os_dep.linux.syscall.sys_x86_64_socket (   jitter,
  linux_env 
)

◆ sys_x86_64_statfs()

def miasm.os_dep.linux.syscall.sys_x86_64_statfs (   jitter,
  linux_env 
)

◆ sys_x86_64_sysinfo()

def miasm.os_dep.linux.syscall.sys_x86_64_sysinfo (   jitter,
  linux_env 
)

◆ sys_x86_64_writev()

def miasm.os_dep.linux.syscall.sys_x86_64_writev (   jitter,
  linux_env 
)

◆ syscall_arml_exception_handler()

def miasm.os_dep.linux.syscall.syscall_arml_exception_handler (   linux_env,
  syscall_callbacks,
  jitter 
)
Call to actually handle an EXCEPT_PRIV_INSN exception
In the case of an error raised by a SYSCALL, call the corresponding
syscall_callbacks
@linux_env: LinuxEnvironment_arml instance
@syscall_callbacks: syscall number -> func(jitter, linux_env)

◆ syscall_x86_32_exception_handler()

def miasm.os_dep.linux.syscall.syscall_x86_32_exception_handler (   linux_env,
  syscall_callbacks,
  jitter 
)
Call to actually handle an EXCEPT_INT_XX exception
In the case of an error raised by a SYSCALL, call the corresponding
syscall_callbacks
@linux_env: LinuxEnvironment_x86_32 instance
@syscall_callbacks: syscall number -> func(jitter, linux_env)

◆ syscall_x86_64_exception_handler()

def miasm.os_dep.linux.syscall.syscall_x86_64_exception_handler (   linux_env,
  syscall_callbacks,
  jitter 
)
Call to actually handle an EXCEPT_SYSCALL exception
In the case of an error raised by a SYSCALL, call the corresponding
syscall_callbacks
@linux_env: LinuxEnvironment_x86_64 instance
@syscall_callbacks: syscall number -> func(jitter, linux_env)

Variable Documentation

◆ hnd

miasm.os_dep.linux.syscall.hnd = logging.StreamHandler()

◆ log

miasm.os_dep.linux.syscall.log = logging.getLogger('syscalls')

◆ syscall_callbacks_arml

dictionary miasm.os_dep.linux.syscall.syscall_callbacks_arml
Initial value:
1 = {
2 
3  0x3: sys_generic_read,
4  0x4: sys_generic_write,
5  0x5: sys_generic_open,
6  0x6: sys_generic_close,
7  0x2d: sys_generic_brk,
8  0x21: sys_generic_access,
9  0x36: sys_arml_ioctl,
10  0x7a: sys_arml_newuname,
11  0x7d: sys_generic_mprotect,
12  0x92: sys_arml_writev,
13  0xc0: sys_generic_mmap2,
14  0xc3: sys_arml_stat64,
15  0xc4: sys_arml_lstat64,
16  0xc5: sys_arml_fstat64,
17  0xc7: sys_generic_getuid,
18  0xc8: sys_generic_getgid,
19  0xc9: sys_generic_geteuid,
20  0xcA: sys_generic_getegid,
21  0x4e: sys_arml_gettimeofday,
22  0xd5: sys_generic_setuid,
23  0xd6: sys_generic_setgid,
24  0xd9: sys_arml_getdents64,
25  0xdd: sys_generic_fcntl64,
26  0xf8: sys_generic_exit_group,
27 
28  # ARM-specific ARM_NR_BASE == 0x0f0000
29  0xf0005: sys_arml_set_tls,
30 }

◆ syscall_callbacks_x86_32

dictionary miasm.os_dep.linux.syscall.syscall_callbacks_x86_32
Initial value:
1 = {
2  0x7A: sys_x86_32_newuname,
3 }

◆ syscall_callbacks_x86_64

dictionary miasm.os_dep.linux.syscall.syscall_callbacks_x86_64