diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-04 21:18:44 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-04 21:18:44 +0100 |
| commit | f21224bffb0bbfed644145e8ab7983471ccdc9e9 (patch) | |
| tree | cc2cb9e8c1a634c411ec964ea67c4d7ce9f035ad /src | |
| parent | 67e64bfcf8fe156b0bc85fec5eeb1f90ef783410 (diff) | |
| download | box64-f21224bffb0bbfed644145e8ab7983471ccdc9e9.tar.gz box64-f21224bffb0bbfed644145e8ab7983471ccdc9e9.zip | |
Fix injection of PLT Resolver
Diffstat (limited to 'src')
| -rwxr-xr-x | src/elfs/elfloader.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c index 6531a222..8ebc51f1 100755 --- a/src/elfs/elfloader.c +++ b/src/elfs/elfloader.c @@ -645,13 +645,13 @@ int RelocateElfPlt(lib_t *maplib, lib_t *local_maplib, elfheader_t* head) pltResolver = AddBridge(my_context->system, vFE, PltResolver, 0); } if(head->pltgot) { - *(uintptr_t*)(head->pltgot+head->delta+8) = pltResolver; - *(uintptr_t*)(head->pltgot+head->delta+4) = (uintptr_t)head; - printf_log(LOG_DEBUG, "PLT Resolver injected in plt.got at %p\n", (void*)(head->pltgot+head->delta+8)); + *(uintptr_t*)(head->pltgot+head->delta+16) = pltResolver; + *(uintptr_t*)(head->pltgot+head->delta+8) = (uintptr_t)head; + printf_log(LOG_DEBUG, "PLT Resolver injected in plt.got at %p\n", (void*)(head->pltgot+head->delta+16)); } else if(head->got) { - *(uintptr_t*)(head->got+head->delta+8) = pltResolver; - *(uintptr_t*)(head->got+head->delta+4) = (uintptr_t)head; - printf_log(LOG_DEBUG, "PLT Resolver injected in got at %p\n", (void*)(head->got+head->delta+8)); + *(uintptr_t*)(head->got+head->delta+16) = pltResolver; + *(uintptr_t*)(head->got+head->delta+8) = (uintptr_t)head; + printf_log(LOG_DEBUG, "PLT Resolver injected in got at %p\n", (void*)(head->got+head->delta+16)); } } |