def libnative_libfuncs_sum_library_test(): machine = Machine() mem = machine.get_mem() alloc = MemoryAlloc.for_machine(machine) # new lib lib = Library.alloc(alloc, name="my.library", id_string="bla", neg_size=36) lib.new_lib() mem.w32(lib.get_addr() - 36, 0xDEADBEEF) # sum lib lf = LibFuncs(machine, alloc) lf.sum_library(lib.get_addr()) assert lib.sum.val == 0xDEADBEEF # cleanup lib.free() assert alloc.is_all_free()
def libnative_libfuncs_sum_library_test(): machine = Machine() mem = machine.get_mem() alloc = MemoryAlloc.for_machine(machine) # new lib lib = Library.alloc(alloc, "my.library", "bla", 36) lib.setup() mem.w32(lib.get_addr() - 36, 0xdeadbeef) # sum lib lf = LibFuncs(machine, alloc) lf.sum_library(lib.get_addr()) assert lib.sum == 0xdeadbeef # cleanup lib.free() assert alloc.is_all_free()
def libnative_libfuncs_sum_library_test(): machine = Machine() mem = machine.get_mem() alloc = MemoryAlloc.for_machine(machine) # new lib lib = Library.alloc(alloc, "my.library", "bla", 36) lib.setup() mem.w32(lib.get_addr() - 36, 0xDEADBEEF) # sum lib lf = LibFuncs(machine, alloc) lf.sum_library(lib.get_addr()) assert lib.sum == 0xDEADBEEF # cleanup lib.free() assert alloc.is_all_free()
def SumLibrary(self, ctx): lib_addr = ctx.cpu.r_reg(REG_A1) lf = LibFuncs(ctx.machine, ctx.alloc) lib_sum = lf.sum_library(lib_addr) log_exec.info("SumLibrary: lib=%06x -> sum=%08x", lib_addr, lib_sum)
def SumLibrary(self, ctx): lib_addr = ctx.cpu.r_reg(REG_A1) lf = LibFuncs(ctx.machine, ctx.alloc) lib_sum = lf.sum_library(lib_addr) log_exec.info("SumLibrary: lib=%06x -> sum=%08x", lib_addr, lib_sum)