Skip to content

Commit

Permalink
Report caller address for missing functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 27, 2016
1 parent 141ff8b commit 3df4fc0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lx_loader.c
Expand Up @@ -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);
Expand Down

0 comments on commit 3df4fc0

Please sign in to comment.