def setup(): machine = MockMachine(fill=23) mem = machine.get_mem() traps = machine.get_traps() cpu = machine.get_cpu() alloc = MemoryAlloc.for_machine(machine) ctx = LibCtx(machine) return mem, traps, alloc, ctx
def get_jump_table(with_fd=False, **kwargs): machine = MockMachine() mem = machine.get_mem() name = 'vamostest.library' fd = read_lib_fd(name) neg_size = fd.get_neg_size() lib_base = neg_size + 0x100 if not with_fd: fd = None jt = LibJumpTable(mem, lib_base, neg_size, fd=fd, **kwargs) return jt
def _create_ctx(): machine = MockMachine() return LibCtx(machine)
def _create_ctx(): machine = MockMachine() # prepare PrintString() machine.mem.w_cstr(0x10, "hello, world!") machine.cpu.w_reg(REG_A0, 0x10) return LibCtx(machine)