From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37368 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoSwb-000867-52 for qemu-devel@nongnu.org; Sat, 12 Feb 2011 22:48:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoSwZ-00035O-U3 for qemu-devel@nongnu.org; Sat, 12 Feb 2011 22:48:16 -0500 Received: from mta-1.ms.rz.rwth-aachen.de ([134.130.7.72]:52504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoSwZ-000354-MQ for qemu-devel@nongnu.org; Sat, 12 Feb 2011 22:48:15 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1 Received: from ironport-out-1.rz.rwth-aachen.de ([134.130.5.40]) by mta-1.ms.rz.RWTH-Aachen.de (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008)) with ESMTP id <0LGJ00G4TEKC3Y60@mta-1.ms.rz.RWTH-Aachen.de> for qemu-devel@nongnu.org; Sun, 13 Feb 2011 04:48:12 +0100 (CET) Received: from [10.9.0.6] ([unknown] [178.63.246.163]) by relay-auth-1.ms.rz.rwth-aachen.de (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 9 2008)) with ESMTPA id <0LGJ00E9TEKCZT80@relay-auth-1.ms.rz.rwth-aachen.de> for qemu-devel@nongnu.org; Sun, 13 Feb 2011 04:48:12 +0100 (CET) Message-id: <4D57547C.6070508@rwth-aachen.de> Date: Sun, 13 Feb 2011 04:48:12 +0100 From: "felix.matenaar@rwth-aachen" Subject: [Qemu-devel] Binary Translation hooking - reading registers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello everyone, i am working on a project adding instrumentation into qemu. My approach is to use gen_helper stuff do hook specific opcodes like call or ret to gain information about running processes in the virtual machine. Today I noticed that the CPUState* env is not in all cases up-to-date when my hooks are called on block execution. That makes totally sense since blocks are natively executed in one step as far as I understood so there is no code which would keep the cpu environment up-to-date. To achieve my goal, it is necessary being able reading actual register configuration like eax when a ret hook is called to get a function return value. So my question is how I can do this. Are there already some functions which generate code to update the cpu environment? If not, is there anything you can point me towards for adding support? Target is windows XP on i386. Regards, Felix