From 3df4fc05449563f9f8d6335ce724fd55cc7aeaca Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 27 Sep 2016 10:05:08 -0400 Subject: [PATCH] Report caller address for missing functions. --- lx_loader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lx_loader.c b/lx_loader.c index f4c8c5a..a03b720 100644 --- a/lx_loader.c +++ b/lx_loader.c @@ -179,9 +179,13 @@ static int decompressExePack2(uint8 *dst, const uint32 dstlen, const uint8 *src, static void missingEntryPointCalled(const char *module, const char *entry) { + void ***ebp = NULL; + __asm__ __volatile__ ( "movl %%ebp, %%eax \n\t" : "=a" (ebp) ); + void *caller = ebp[0][1]; + fflush(stdout); fflush(stderr); - fprintf(stderr, "\n\nMissing entry point '%s' in module '%s' called!\n", entry, module); + fprintf(stderr, "\n\nMissing entry point '%s' in module '%s' called at %p!\n", entry, module, caller); fprintf(stderr, "Aborting.\n\n\n"); //STUBBED("output backtrace"); fflush(stderr);