Skip to content

Commit

Permalink
[TRACE] Added from with function name in dlopen trace
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Aug 26, 2023
1 parent 299ddb2 commit 7ae3200
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wrapped/wrappedlibdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7ae3200

Please sign in to comment.