summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-14 06:50:19 +0000
committermidipix <writeonce@midipix.org>2016-12-15 01:48:00 -0500
commit439a91a7b6a3d7384bc5665f86c97d8a06cf43c2 (patch)
tree15e68ef5c5a6cda10468c5f7e8b9501b4bdf534a /src
parentdb8062c0b1147f88362d8d84bcf9e7458d8d89de (diff)
downloadntapi-439a91a7b6a3d7384bc5665f86c97d8a06cf43c2.tar.bz2
ntapi-439a91a7b6a3d7384bc5665f86c97d8a06cf43c2.tar.xz
__ntapi_tt_get_csr_port_handle_addr_by_logic_x86_64(): code clean-up.
Diffstat (limited to 'src')
-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