I want to learn how to preload and hook functions in wine running windows apps.
I'm trying to preload a library with ld_preload
to wine(windows game(32-bit)) on Arch Linux (64-bit but I think I installed 32-bit support). I get the error wrong ELF class: ELFCLASS32
and the same for ELFCLASS64
.
Full error text:
"ERROR: ld.so: object './eve.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored."
the same for 64bit and another one
ERROR: ld.so: object './eve.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
How am I getting "wrong class" when I have both 32 and 64-bit installed? What architecture do I need to make it work right?
Wow.exe:
Wow.exe: PE32 executable (GUI) Intel 80386, for MS Windows
I tried to build with and without the -m32
flag ( I changed all uint32
to uint64
):
gcc -std=c99 -Wall -Werror -m32 -O0 -fpic -shared -ldl -lGL -o eve.so eve.c
I saw this answer:
ltrace /lib/ld-linux.so.2 --preload /path/to/lib/strcmp.so ./exec
But don't know how to run it with wine running the app.
I want to learn how to preload and hook functions in wine running windows apps. I saw this guide: https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/276206-linux-simple-injection-ld_preload.html