miasm
Reverse engineering framework
miasm.os_dep.linux_stdlib Namespace Reference

Classes

class  c_linobjs
 

Functions

def xxx___libc_start_main (jitter)
 
def xxx_isprint (jitter)
 
def xxx_memcpy (jitter)
 
def xxx_memset (jitter)
 
def xxx_puts (jitter)
 
def get_fmt_args (jitter, fmt, cur_arg)
 
def xxx_snprintf (jitter)
 
def xxx_sprintf (jitter)
 
def xxx_printf (jitter)
 
def xxx_strcpy (jitter)
 
def xxx_strlen (jitter)
 
def xxx_malloc (jitter)
 
def xxx_free (jitter)
 
def xxx_strcmp (jitter)
 
def xxx_strncmp (jitter)
 

Variables

 stdout = stdout.buffer
 
 linobjs = c_linobjs()
 
int ABORT_ADDR = 0x1337beef
 

Function Documentation

◆ get_fmt_args()

def miasm.os_dep.linux_stdlib.get_fmt_args (   jitter,
  fmt,
  cur_arg 
)
Here is the caller graph for this function:

◆ xxx___libc_start_main()

def miasm.os_dep.linux_stdlib.xxx___libc_start_main (   jitter)
Basic implementation of __libc_start_main

int __libc_start_main(int *(main) (int, char * *, char * *), int argc,
                      char * * ubp_av, void (*init) (void),
                      void (*fini) (void), void (*rtld_fini) (void),
                      void (* stack_end));

Note:
 - init, fini, rtld_fini are ignored
 - return address is forced to ABORT_ADDR, to avoid calling abort/hlt/...
 - in powerpc, signature is:

int __libc_start_main (int argc, char **argv, char **ev, ElfW (auxv_t) *
                   auxvec, void (*rtld_fini) (void), struct startup_info
                   *stinfo, char **stack_on_entry)

◆ xxx_free()

def miasm.os_dep.linux_stdlib.xxx_free (   jitter)

◆ xxx_isprint()

def miasm.os_dep.linux_stdlib.xxx_isprint (   jitter)
#include <ctype.h>
int isprint(int c);

checks for any printable character including space.

◆ xxx_malloc()

def miasm.os_dep.linux_stdlib.xxx_malloc (   jitter)

◆ xxx_memcpy()

def miasm.os_dep.linux_stdlib.xxx_memcpy (   jitter)
#include <string.h>
void *memcpy(void *dest, const void *src, size_t n);

copies n bytes from memory area src to memory area dest.

◆ xxx_memset()

def miasm.os_dep.linux_stdlib.xxx_memset (   jitter)
#include <string.h>
void *memset(void *s, int c, size_t n);

fills the first n bytes of the memory area pointed to by s with the constant
byte c.
Here is the call graph for this function:

◆ xxx_printf()

def miasm.os_dep.linux_stdlib.xxx_printf (   jitter)
Here is the call graph for this function:

◆ xxx_puts()

def miasm.os_dep.linux_stdlib.xxx_puts (   jitter)
#include <stdio.h>
int puts(const char *s);

writes the string s and a trailing newline to stdout.

◆ xxx_snprintf()

def miasm.os_dep.linux_stdlib.xxx_snprintf (   jitter)
Here is the call graph for this function:

◆ xxx_sprintf()

def miasm.os_dep.linux_stdlib.xxx_sprintf (   jitter)
Here is the call graph for this function:

◆ xxx_strcmp()

def miasm.os_dep.linux_stdlib.xxx_strcmp (   jitter)
Here is the call graph for this function:

◆ xxx_strcpy()

def miasm.os_dep.linux_stdlib.xxx_strcpy (   jitter)

◆ xxx_strlen()

def miasm.os_dep.linux_stdlib.xxx_strlen (   jitter)

◆ xxx_strncmp()

def miasm.os_dep.linux_stdlib.xxx_strncmp (   jitter)
Here is the call graph for this function:

Variable Documentation

◆ ABORT_ADDR

int miasm.os_dep.linux_stdlib.ABORT_ADDR = 0x1337beef

◆ linobjs

miasm.os_dep.linux_stdlib.linobjs = c_linobjs()

◆ stdout

miasm.os_dep.linux_stdlib.stdout = stdout.buffer