Skip to contentSkip to conversation

How to hook syscall in guest OS?

Qemu-devel Clemens Kolbitsch 1 participant 1 message Jan 28, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 10 lines

Hi all,

i want to know if is it possible to intercept syscall's entry point and exit point for both Linux and Windows guest operating system in Qemu from the host Operating System. If is it possible how can I do it?

Thanks in advance for help

Best Regards

Hi Antonio,

I'm not sure if there is an easier way, but back when Qemu still had TB code together with dyn_gen, it was very easy to insert a function call (i.e. a hook) into the code of the "int" and "sysenter" code blocks.

Using this hook, you can use the registers, etc. to see if it was a system call. I'm not sure how it works with the current intermediay code generation, but maybe this hint can guide you into a direction that might work ;-)

Cheers,
Clemens