![]() |
miasm
Reverse engineering framework
|


Public Member Functions | |
| def | __init__ (self, elf_phdr_vaddr, entry_point, linux_env, **kwargs) |
| def | data_to_map (self) |
| def | iteritems (self) |
Public Attributes | |
| info | |
| ptrs | |
Static Public Attributes | |
| int | AT_PHDR = 3 |
| int | AT_PHNUM = 5 |
| int | AT_PAGESZ = 6 |
| int | AT_ENTRY = 9 |
| int | AT_UID = 11 |
| int | AT_EUID = 12 |
| int | AT_GID = 13 |
| int | AT_EGID = 14 |
| int | AT_PLATFORM = 15 |
| int | AT_HWCAP = 16 |
| int | AT_SECURE = 23 |
| int | AT_RANDOM = 25 |
| int | AT_SYSINFO_EHDR = 33 |
| def | items = iteritems |
Auxiliary vector abstraction, filled with default values
(mainly based on https://lwn.net/Articles/519085)
# Standard usage
>>> auxv = AuxVec(elf_base_addr, cont_target.entry_point, linux_env)
# Enable AT_SECURE
>>> auxv = AuxVec(..., AuxVec.AT_SECURE=1)
# Modify AT_RANDOM
>>> auxv = AuxVec(..., AuxVec.AT_RANDOM="\x00"*0x10)
# Using AuxVec instance for stack preparation
# First, fill memory with vectors data
>>> for AT_number, data in auxv.data_to_map():
dest_ptr = ...
copy_to_dest(data, dest_ptr)
auxv.ptrs[AT_number] = dest_ptr
# Then, get the key: value (with value being sometime a pointer)
>>> for auxid, auxval in auxv.iteritems():
...
| def miasm.os_dep.linux.environment.AuxVec.__init__ | ( | self, | |
| elf_phdr_vaddr, | |||
| entry_point, | |||
| linux_env, | |||
| ** | kwargs | ||
| ) |
Instantiate an AuxVec, with required elements: - elf_phdr_vaddr: virtual address of the ELF's PHDR in memory - entry_point: virtual address of the ELF entry point - linux_env: LinuxEnvironment instance, used to provides some of the option values Others options can be overridden by named arguments
| def miasm.os_dep.linux.environment.AuxVec.data_to_map | ( | self | ) |
Iterator on (AT_number, data) Once the data has been mapped, the corresponding ptr must be set in 'self.ptrs[AT_number]'
| def miasm.os_dep.linux.environment.AuxVec.iteritems | ( | self | ) |
Iterator on auxiliary vector id and values
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| miasm.os_dep.linux.environment.AuxVec.info |
|
static |
| miasm.os_dep.linux.environment.AuxVec.ptrs |