summaryrefslogtreecommitdiffhomepage
path: root/src/system
diff options
context:
space:
mode:
Diffstat (limited to 'src/system')
-rw-r--r--src/system/ntapi_tt_get_csr_port_handle_addr_by_logic.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/system/ntapi_tt_get_csr_port_handle_addr_by_logic.c b/src/system/ntapi_tt_get_csr_port_handle_addr_by_logic.c
index b552004..c1b07ef 100644
--- a/src/system/ntapi_tt_get_csr_port_handle_addr_by_logic.c
+++ b/src/system/ntapi_tt_get_csr_port_handle_addr_by_logic.c
@@ -150,13 +150,14 @@ void ** __ntapi_tt_get_csr_port_handle_addr_by_logic_x86_64(void)
_x86_move_rcx_rel_signature * ptr_move_rcx_rel;
int32_t offset;
int32_t relative;
- int32_t * prelative; /* for type-punned tyrants */
+ int32_t * prelative;
+ int bias;
/* calling a function within the same library: assume E8 call and 32-bit relative addressing */
- for (offset = 0; offset < MAX_FN_BYTES_TO_TEST; offset++) {
- ptr_test = (unsigned char *)__ntapi->csr_client_call_server
- + offset;
+ for (bias = 0; bias < MAX_FN_BYTES_TO_TEST; bias++) {
+ ptr_test = (unsigned char *)__ntapi->csr_client_call_server;
+ ptr_test += bias;
if (*ptr_test == 0xE8) {
ptr_e8_call = (_x86_e8_call_signature *)ptr_test;
@@ -192,6 +193,6 @@ void ** __ntapi_tt_get_csr_port_handle_addr_by_logic_x86_64(void)
}
/* CsrPortHandle not found */
- return (void **)0;
+ return 0;
}
#endif