# Print eip on raised page fault # def pf_hook(vm): print "Page Fault @ %#x" % (vm.cpu.gpr.pc) return True # # Main # vm = VM(CPUFamily.AMD, "192.168.254.254:1234") vm.attach() vm.stop() vm.cpu.filter_write_cr(3, hook) while not vm.resume(): continue vm.cpu.release_write_cr(3) vm.cpu.set_active_cr3(os.get_process_cr3(), True, OSAffinity.Linux26) vm.cpu.filter_exception(CPUException.page_fault, pf_hook) vm.cpu.lbr.enable() vm.resume() print vm.cpu.gpr print vm.cpu.lbr vm.detach()