From 7ae3200c6f9674e6f1bdbbb3cb51b6a328cee1a6 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 26 Aug 2023 15:13:15 +0200 Subject: [PATCH] [TRACE] Added from with function name in dlopen trace --- src/wrapped/wrappedlibdl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wrapped/wrappedlibdl.c b/src/wrapped/wrappedlibdl.c index 5d2f3b255..7bd43aa79 100755 --- a/src/wrapped/wrappedlibdl.c +++ b/src/wrapped/wrappedlibdl.c @@ -18,6 +18,7 @@ #include "box86context.h" #include "elfloader.h" #include "elfs/elfloader_private.h" +#include "x86emu.h" typedef struct dllib_s { library_t* lib; @@ -100,7 +101,7 @@ void* my_dlopen(x86emu_t* emu, void *filename, int flag) if(sys) return sys; } - printf_dlsym(LOG_DEBUG, "Call to dlopen(\"%s\"/%p, %X)\n", rfilename, filename, flag); + printf_dlsym(LOG_DEBUG, "Call to dlopen(\"%s\"/%p, %X) from %p(%s)\n", rfilename, filename, flag, *(void**)(R_ESP), getAddrFunctionName(*(uintptr_t*)(R_ESP))); // Transform any ${...} that maight be present while(strstr(rfilename, "${ORIGIN}")) { char* origin = box_strdup(my_context->fullpath);