It is used to read numeric values ??from the process memory.
syntax
codhexi (# char_hex [0], 4);
the first parameter is a pointer to the array char 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
the second is the number of bytes in the array that are converted to a number.
Warning - in the process memory, bytes are read from right to left. codhexi , as well as codhex and [ codhexd [/url] is specially sharpened for convenient use for working with processes, therefore in the char array after reading from the process it is not necessary to overturn bytes. Processing is already right from right to left.
However, if you need to use codhexi for the usual conversion of hexadecimal to decimal, you must reverse the hexadecimal bytes. not as we write in the calculator.
For example, if you type such a hex code 5E A8 1C in the calculator and convert it to a decimal number, you will get 6203420 .
In program memory, the same number will be written in reverse in the hex system [color=darkred] 1C A8 5E [/??color]. Bytes back to front. And when reading into an array of char, they will also be written
CODE:
char hex [3];
hex [0]=formatic (28); // 1C
hex [1]=formatic (168); // A8
hex [2]=formatic (94); // 5E
int uy=codhexi (#hex [0], 3);
messagebox (uy); // 6203420
hex [0]=formatic (28); // 1C
hex [1]=formatic (168); // A8
hex [2]=formatic (94); // 5E
int uy=codhexi (#hex [0], 3);
messagebox (uy); // 6203420