aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dlfcn.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dlfcn.c b/src/dlfcn.c
index 749c35f..522eed0 100644
--- a/src/dlfcn.c
+++ b/src/dlfcn.c
@@ -754,8 +754,10 @@ static BOOL is_import_thunk( const void *addr )
754 && ( opCode2 & 0xffe003ff ) == 0xf9400210 /* ldr x16, [x16, offset] */ 754 && ( opCode2 & 0xffe003ff ) == 0xf9400210 /* ldr x16, [x16, offset] */
755 && opCode3 == 0xd61f0200 /* br x16 */ 755 && opCode3 == 0xd61f0200 /* br x16 */
756 ? TRUE : FALSE; 756 ? TRUE : FALSE;
757#else 757#elif defined(_M_AMD64) || defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)
758 return *(USHORT *) addr == 0x25ff ? TRUE : FALSE; 758 return *(USHORT *) addr == 0x25ff ? TRUE : FALSE;
759#else
760 return FALSE;
759#endif 761#endif
760} 762}
761 763
@@ -785,7 +787,7 @@ static void *get_address_from_import_address_table( void *iat, DWORD iat_size, c
785 787
786 /* Calculate the final address */ 788 /* Calculate the final address */
787 BYTE *ptr = (BYTE *) ( (ULONG64) thkp & ~0xfffull ) + page + offset; 789 BYTE *ptr = (BYTE *) ( (ULONG64) thkp & ~0xfffull ) + page + offset;
788#else 790#elif defined(_M_AMD64) || defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)
789 /* Get offset from thunk table (after instruction 0xff 0x25) 791 /* Get offset from thunk table (after instruction 0xff 0x25)
790 * 4018c8 <_VirtualQuery>: ff 25 4a 8a 00 00 792 * 4018c8 <_VirtualQuery>: ff 25 4a 8a 00 00
791 */ 793 */
@@ -804,6 +806,8 @@ static void *get_address_from_import_address_table( void *iat, DWORD iat_size, c
804 */ 806 */
805 BYTE *ptr = (BYTE *) offset; 807 BYTE *ptr = (BYTE *) offset;
806#endif 808#endif
809#else
810 return NULL;
807#endif 811#endif
808 812
809 if( !is_valid_address( ptr ) || ptr < (BYTE *) iat || ptr > (BYTE *) iat + iat_size ) 813 if( !is_valid_address( ptr ) || ptr < (BYTE *) iat || ptr > (BYTE *) iat + iat_size )