miasm
Reverse engineering framework
run_with_linuxenv Namespace Reference

Variables

 parser = ArgumentParser("Run an ELF in a Linux-like environment")
 
 help
 
 nargs
 
 default
 
 action
 
 args = parser.parse_args()
 
 loc_db = LocationDB()
 
 cont_target_tmp = Container.from_stream(open(args.target, 'rb'), loc_db)
 
 ld_path = bytes(cont_target_tmp.executable.getsectionbyname(".interp").content).strip(b"\x00")
 
int elf_base_addr = 0x40000000
 
 machine = Machine(cont_target_tmp.arch)
 
 jitter = machine.jitter(loc_db, args.jitter)
 
 LinuxEnvironment = environment.LinuxEnvironment_arml
 
 syscall_callbacks = syscall.syscall_callbacks_arml
 
 prepare_loader = environment.prepare_loader_arml
 
 linux_env = LinuxEnvironment()
 
 cont_ld
 
 cont_target
 
 elf_phdr_header
 
list argv = [args.target.encode()] + [arg.encode() for arg in args.extra_args]
 
dictionary envp = {b"PATH": b"/usr/local/bin", b"USER": linux_env.user_name}
 
 auxv
 

Variable Documentation

◆ action

run_with_linuxenv.action

◆ args

run_with_linuxenv.args = parser.parse_args()

◆ argv

list run_with_linuxenv.argv = [args.target.encode()] + [arg.encode() for arg in args.extra_args]

◆ auxv

run_with_linuxenv.auxv
Initial value:
1 = environment.AuxVec(
2  elf_base_addr + elf_phdr_header.vaddr,
3  cont_target.entry_point, linux_env
4 )

◆ cont_ld

run_with_linuxenv.cont_ld
Initial value:
1 = Container.from_stream(
2  open(ld_path, "rb"),
3  vm=jitter.vm,
4  addr=0x80000000,
5  apply_reloc=True
6 )

◆ cont_target

run_with_linuxenv.cont_target
Initial value:
1 = Container.from_stream(
2  open(args.target, "rb"),
3  vm=jitter.vm,
4  loc_db=loc_db,
5  addr=elf_base_addr,
6  apply_reloc=False
7 )

◆ cont_target_tmp

run_with_linuxenv.cont_target_tmp = Container.from_stream(open(args.target, 'rb'), loc_db)

◆ default

run_with_linuxenv.default

◆ elf_base_addr

int run_with_linuxenv.elf_base_addr = 0x40000000

◆ elf_phdr_header

run_with_linuxenv.elf_phdr_header
Initial value:
1 = next(
2  ph32.ph for ph32 in cont_target.executable.ph
3  if ph32.ph.type == elf_csts.PT_PHDR
4 )

◆ envp

dictionary run_with_linuxenv.envp = {b"PATH": b"/usr/local/bin", b"USER": linux_env.user_name}

◆ help

run_with_linuxenv.help

◆ jitter

run_with_linuxenv.jitter = machine.jitter(loc_db, args.jitter)

◆ ld_path

run_with_linuxenv.ld_path = bytes(cont_target_tmp.executable.getsectionbyname(".interp").content).strip(b"\x00")

◆ linux_env

run_with_linuxenv.linux_env = LinuxEnvironment()

◆ LinuxEnvironment

run_with_linuxenv.LinuxEnvironment = environment.LinuxEnvironment_arml

◆ loc_db

run_with_linuxenv.loc_db = LocationDB()

◆ machine

run_with_linuxenv.machine = Machine(cont_target_tmp.arch)

◆ nargs

run_with_linuxenv.nargs

◆ parser

run_with_linuxenv.parser = ArgumentParser("Run an ELF in a Linux-like environment")

◆ prepare_loader

run_with_linuxenv.prepare_loader = environment.prepare_loader_arml

◆ syscall_callbacks

run_with_linuxenv.syscall_callbacks = syscall.syscall_callbacks_arml