seems to me that you don't know what a pointer is...
Okay, I'm going to answer you in snippets form the helpfile:
(1)
Square brackets ([ ]) indicate that a value should be obtained from the target process. The expression inside the brackets indicates the address from where to get the value. Any numeric value inside the brackets is converted to an unsigned integral value and treated as the address in the target process from where the value is obtained.
Simple no ? so [0x12345678] means the value located at that memory address... could be 4 or 10000 or a float, BUT unless specified as in point nr (3), it will ALWAYS be treated as a DWORD.
(2)
[[0x01005334]+0x44] gets the value from 0x01005334 in the target process, adds 0x44 to it, and then gets that value from that address in the target process.
Also pretty simple.. Get the *value* at the specified address 0x01005334, add a number to it 0x44 and use that result as a new memory location, as is described in (1)
(3)
By default the value obtained from the target process is in DWORD format, however prefixes on the brackets can be used to change this.
b[ ] gets a byte value.
w[ ] gets a word value.
[ ] (no prefix) gets a dword value.
q[ ] gets qword value.
f[ ] gets a float value.
d[ ] gets a double value.
As you can see form the helpfile, the DEFAULT is to treat whatever is between brackets as a DWORD. This was probably done to make it easier
to work with pointers, as a pointer is ALWAYS a DWORD.
(4)
Module names are resolved into the actual address of the module (unless used inside a special operator) as a 64-bit unsigned integer type. This means an expression such as gamex86.dll+0x154C is valid. gamex86.dll becomes a numeric value and is added to 0x154C for the final result
Okay, back to my example from the previous post so it's easier to explain:
extern WORD bHitPoints = { "NetHackw.exe", 0x1696D4 };
I play a game called nethack and what I'm telling LSS with that line is that the location of the hitpoints (which is of size WORD) for my character is located at base_address_of_nethack.exe+0x1686D4.
So if you add all that I stated above:
extern WORD bHitPoints = { "NetHackw.exe", 0x1696D4 };
is exactly the same as w[nethackw.exe+0x1696D4]
If you are still with me, let's have a look at your question:
liqmysaq wrote:could u make an example using this address: [[[[0x12345678]+0xD]+0xC]+0xB]+0xA as float and the hotkey is control+P and the value set when hotkey pressed is 24.12345
This tells me that you are not completely familiar with complex notation yet..
* As point (1) and (2) told us, if you want to tell MHS that something is an address you need to enclose it in []
So you should put [[[[[0x12345678]+0xD]+0xC]+0xB]+0xA]
Unless you mean take the value at address [[[[0x12345678]+0xD]+0xC]+0xB] and add 0xA to that value.
* As per point (3), if you want to tell MHS that the value at [address] is a
float, you need to put an 'f' in front of it:
f[[[[[0x12345678]+0xD]+0xC]+0xB]+0xA]
Okay, now for your answer (also check
this thread):
- Code: Select all
struct something {
BYTE bBuffer[0xD];
struct {
BYTE bBuffer[0xC];
struct {
BYTE bBuffer[0xB];
struct {
bBuffer[0xA];
FLOAT fValue;
} * poObj;
} * poObj;
} * poObj;
} * poBase = (something *)0x12345678;
void On_HK_1(DWORD dw1, DWORD dw2)
{
poBase->poObj->poObj->poObj->fValue = 24.12345;
}
There.... if anybody sees any holes in my 'lengthy' explanation, feel free to shout..
(I've been up for 16 hours, so mistakes are not out of the question).
Anyway, most of the snippets on this page were taken from the "expression evaluator" page from the helpfile except for the thread mentioned above.