Skip to content

Commit

Permalink
Fix GDC's Linux sigscanning (#576)
Browse files Browse the repository at this point in the history
The pointer returned by dlopen is not inside the loaded librarys memory region.
  • Loading branch information
GoD-Tony authored and psychonic committed Jan 20, 2017
1 parent a0f060f commit 3fd7b29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/gdc-psyfork/gdc.cpp
Expand Up @@ -4,6 +4,7 @@
#include <fcntl.h>
#include <math.h>
#include <iostream>
#include <link.h>
#include "gdc.h"
#include "GameConfigs.h"
#include "MemoryUtils.h"
Expand Down Expand Up @@ -619,7 +620,10 @@ int checkSigStringL(void *handle, const char* symbol)

if (real_bytes >= 1)
{
mu.FindPattern(handle, (char*)real_sig, real_bytes, matches, dummy);
// The pointer returned by dlopen is not inside the loaded librarys memory region.
struct link_map *dlmap = (struct link_map *)handle;

mu.FindPattern((void *)dlmap->l_addr, (char*)real_sig, real_bytes, matches, dummy);
}
}

Expand Down

0 comments on commit 3fd7b29

Please sign in to comment.