Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo
extern WORD bHitPoints = { "NetHackw.exe", 0x1696D4 }; //vanilla
void On_HK_1(DWORD dw1, DWORD dw2)
{
bHitPoints = 100000;
}
extern int * test = { "NetHackw.exe", 0x111111 };
void On_HK_2(DWORD dw1, DWORD dw2)
{
*test = 10000;
}
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.
[[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.
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.
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
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
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;
}
extern struct something {
BYTE bBuffer[0xD];
struct {
BYTE bBuffer[0xC];
struct {
BYTE bBuffer[0xB];
struct {
bBuffer[0xA];
FLOAT fValue;
} * poObj;
} * poObj;
} * poObj;
} * poBase = { "", 0x12345678 };
void On_HK_1( DWORD dw1, DWORD dw2 ) {
poBase->poObj->poObj->poObj->fValue = 24.12345;
}
void On_HK_1( DWORD dw1, DWORD dw2 ) {
EVAL_RET_TYPE ertRet;
if ( EvalExp( "[[[[0x12345678]+0xD]+0xC]+0xB]+0xA", &ertRet, FALSE ) {
FLOAT pfVal = { "", ertRet.ui64Int64 };
pfVal = 24.12345;
}
}
extern struct noreload {
BYTE bBuffer[0x4B8];
struct {
BYTE bBuffer[0x160];
struct {
BYTE bBuffer[0x208];
struct {
BYTE bBuffer[0xC];
struct {
bBuffer[0x2D4];
DWORD dwValue;
} * poObj;
} * poObj;
} * poObj;
} * poObj;
} * poBase = { "", 0x341F1DFC };
void On_HK_1( DWORD dw1, DWORD dw2 ) {
poBase->poObj->poObj->poObj->poObj->dwValue = 5;
}
[[[[0x149E928]+0x0]+0x8]+0x54]+0x24
extern struct playerYAddy {
BYTE bBuffer[0x0];
struct {
BYTE bBuffer[0x8];
struct {
BYTE bBuffer[0x54];
struct {
BYTE bBuffer[0x24];
FLOAT fValue;
} * poObj;
} * poObj;
} * poObj;
} * poBase = { "", 0x149E928 };
void On_HK_1( DWORD dw1, DWORD dw2 ) {
poBase->poObj->poObj->poObj->fValue = 24.12345;
}
ERROR: Line: 1702101107 Zero-sized arrays not allowed.
ERROR: Line: 2 Unable to declare variable.
ERROR: Line: 12 Failed creating struct or union “playerYAddy”.
void On_Open_CLIENT_EXE( DWORD dw1, DWORD dw2 ) {
EVAL_RET_TYPE ertRet;
FLOAT pfVal = 0;
if ( EvalExp( "[[[[0x149E928]+0x0]+0x8]+0x54]+0x24", &ertRet, FALSE )) {
pfVal = { "", ertRet.ui64Int64 };
pfVal = 24.12345;
}
}
ERROR: Line: 5 Syntax error. File: C:\Downloads\Test.lss
pfVal = { "", ertRet.ui64Int64 };
toffey wrote:I know this is quite an old topic, but I was trying to use this method for a complex address I had and I came to an error for it.
The complex address:
- Code: Select all
[[[[0x149E928]+0x0]+0x8]+0x54]+0x24
My code:
- Code: Select all
extern struct playerYAddy {
BYTE bBuffer[0x0];
struct {
BYTE bBuffer[0x8];
struct {
BYTE bBuffer[0x54];
struct {
BYTE bBuffer[0x24];
FLOAT fValue;
} * poObj;
} * poObj;
} * poObj;
} * poBase = { "", 0x149E928 };
void On_HK_1( DWORD dw1, DWORD dw2 ) {
poBase->poObj->poObj->poObj->fValue = 24.12345;
}
And here are the errors:
- Code: Select all
ERROR: Line: 1702101107 Zero-sized arrays not allowed.
ERROR: Line: 2 Unable to declare variable.
ERROR: Line: 12 Failed creating struct or union “playerYAddy”.
I believe the first error comes from Line 2 and is causing the problems since if I change the "0x0" to something such as "0x1" it compiles just fine, but doesn't give me what I'm looking for obviously. The first error changes its line number each time I compile.
My question is how can I get around this?
toffey wrote:I'm having the same problems with the other method that you (L. Spiro) described. I tried looking through the help file for some help, but couldn't figure anything out.
Code:
- Code: Select all
void On_Open_CLIENT_EXE( DWORD dw1, DWORD dw2 ) {
EVAL_RET_TYPE ertRet;
FLOAT pfVal = 0;
if ( EvalExp( "[[[[0x149E928]+0x0]+0x8]+0x54]+0x24", &ertRet, FALSE )) {
pfVal = { "", ertRet.ui64Int64 };
pfVal = 24.12345;
}
}
Error:
- Code: Select all
ERROR: Line: 5 Syntax error. File: C:\Downloads\Test.lss
Which refers to this line:
- Code: Select all
pfVal = { "", ertRet.ui64Int64 };
I initialized pfVal before the if statement to eliminate one error, but the syntax error remained. I was not able to figure out where the syntax error was even after trying many different things that I could think of. Note that the complex address I input also ends up as a float.
pfVal = ertRet.u.ui64Int64; //{ "", ertRet.ui64Int64 };
L. Spiro wrote:In my left hand is a red pill. If you take it I will show you the truth. I lost my right hand in the war, so I’m afraid you’re stuck with the red pill.
Users browsing this forum: No registered users and 0 guests