DWORD daPointer = *(DWORD*)( (DWORD)GetModuleHandleA( "Client.dll" ) + 0x005300D4 );
daPointer = *(DWORD*)( daPointer + 0x4c0 );
memset(daPointer + 0x7a, 0x90, 6); // 90h = byte value to set, 6 = number of bytes to write
but you must convert the DWORD variable to a pointer type for memset's first parameter. Idk c++ well enough : ( someone else?
memset((void*)daPointer+0x7a, 0x90, 6); ??
or maybe even
Code:
DWORD *daPointer = (DWORD*)( (DWORD)GetModuleHandleA( "Client.dll" ) + 0x005300D4 ); // now a dword pointer
daPointer = (DWORD*)( daPointer + 0x4c0 ); // got rid of the first dereference *, same as above.
memset(daPointer + 0x7a, 0x90, 6); // 90h = byte value to set, 6 = number of bytes to write
??
-------------------------------------
Originally Posted by umutyeniyurt
what is in dword
DWORD is a typedef by microsoft
Declare a variable of type DWORD.
1) When you hover your mouse over the word 'DWORD', it should show you the typedef
2) Or Right click on DWORD and choose "Go To Definition", where it will show you the typedef
And of course sizeof(unsigned long) = 4 bytes (On both 32 bit and 64)
So DWORD = 4 bytes , on both 32 bit and 64.
-------------------------------------
edit: From the original post:
//float
*(DWORD*)( daPointer + 0x7a ) =-4000;
Even though a float and dword are both 4 bytes..their internal format is different. The floating types reserve some number of the right-most bits for the "decimal section" and the left-most bits are used for the "whole number" section. Regular integer types don't do this. So a floating-point type will store "4000" with a few right-most bits set to 0, while the integer numeric types do not. Writing 4000 that way would not store it as a floating-point value. Technically you could still try to read it as a float value, but it will not be what you expect, because of how floating-point types actually store their value.
Should be
*(float*)( daPointer + 0x7a ) = -4000; // ??
Using *(DWORD*) is not correct. Use *(float*).
Last edited by abuckau907; 09-03-2013 at 04:37 AM.
Reason: editing my Reason for Editing : p
'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
--
My posts have some inaccuracies/are wrong/wrong keyword(s) used.
They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.
-if you give rep, please leave a comment, else it means less.