Question about globals and several lock scripts

Need Help With an Existing Feature in Memory Hacking Software? Ask Here

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Question about globals and several lock scripts

Postby cobr_h » Tue Jan 04, 2011 11:53 pm

Suppose I have replicated a Lock() code on several MHS entries like this:
Entry #1:
Code: Select all
int timehit=0;
VOID Lock(...) {
...use/change 'timehit' here...
}


Entry #2:
Code: Select all
int timehit=0;
VOID Lock(...) {
...use/change 'timehit' here...
}


Entry #n:
Code: Select all
int timehit=0;
VOID Lock(...) {
...use/change 'timehit' here...
}


For every script, will the 'timehit' address be allocated into different memory regions? In other words, are them 'globals' only in the scope of the script, or script for entry 2 will change value of 'timehit' on all other scripts?

What I need is timehit being exclusive for every entry, so entry #2 does not change entry#1's. It seems (as I am 'redeclaring' the variable, that it is global only in the scope of the script so, what if I wanted to declare a global I wish to share with all other script lock entries?

Thank you!
cobr_h
Acker
 
Posts: 72
Joined: Wed Dec 02, 2009 6:15 am

Re: Question about globals and several lock scripts

Postby L. Spiro » Wed Jan 05, 2011 8:07 pm

Each script is contained within itself and there is no way to access memory from another script.
The only way to share globals across scripts is to predefine an address inside the target process and each script can access it via extern.
Of course, the address must be hardcoded.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron