qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

User mode emulation: hooking shared libraries to host implementations


From: ardi
Subject: User mode emulation: hooking shared libraries to host implementations
Date: Thu, 25 Jun 2020 23:05:05 +0200

Hi,

I'd like to know if there's any functionality in the QEMU user mode
emulation that lets you replace, in the emulated program, function
calls to shared libraries into host implementations (note: when I say
"host implementations", I don't mean that it must really be a true
shared lib in the host... instead, simply static linking the host
implementation into the qemu emulator would be fine, and less
complex).

For example, imagine a very simple shared library with just one
function for playing audio stored in memory. I want that when I run a
program that uses this library under the QEMU user mode emulation, it
is detected that the program is linked with a library that we wish to
replace, and thus hook it with the host implementation.

I'm aware that this implies lots of complexity and that it's prone to
nightmares you would never wish to have (ie: translating function
calling convention across different ABIs -if the qemu emulator binary
and the emulated program binary have different calling conventions-,
translating endianness in arguments, or being completely impossible in
cases such as libraries whose headers modify function prototypes
conditionally for different OSs), therefore this is why I ask if this
functionality is available, as it would help me a lot to have all
these difficulties already addressed.

If QEMU doesn't support this but you happen to know of any other
project doing this, please tell!!

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]