Kibor Bot Autoclicker » Kibor - Integrated development environment for bots » About Kibor » Version 4.11 Function of translating hexadecimal hex code into a fractional number double

Страниц (1): [1]
 

1. Kibor - 24 Июля, 2018 - 04:31:22 - перейти к сообщению
codhexd allows you to convert hexadecimal hex code to a fractional number double (float).

It is used to read numeric values ??from the process memory.

syntax
codhexd (#char_hex [0]);
parameter is a pointer to the char array in which the read code from the memory is located using readmemory - Working with process memory. Search, read, write to the memory of the game process

In the char_hex array, 4 hex bytes must be specified, since this function only translates 4 bytes (float).

Attention - in the process memory, bytes are read from right to left. codhexd, as well as codhexi and codhex, are specially sharpened for convenient use for working with processes, so in the char array after reading from the process, you do not need to flip the bytes. Processing is already right from right to left.
However, if you need to use codhexd for the usual conversion of hexadecimal to decimal, you must reverse the hexadecimal bytes. not as we write in the calculator.

Example if you count such a hex code 75 E9 B3 3F, then we get a fractional number of 1.405562.
In program memory, the same number will be written in reverse in the hexadecimal system 3F B3 E9 75. Bytes backwards. Therefore, the function codhexd works with bytes from right to left.


 Цитата:
char p [4];

p [0]=formatic (63); // 3F
p [1]=formatic (179); // B3
p [2]=formatic (233); // E9
p [3]=formatic (117); // 75

double a=codhexd (#p [0]); // Convert HEX (75 E9 B3 3F) to decimal fractional 1.405562

messagebox (a);

Powered by ExBB FM 1.0 Final