Help with Script Lock

Ask for Help on Using the Language With Memory Hacking Software

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Help with Script Lock

Postby Gaqed » Wed Jun 18, 2008 3:17 am

I'm trying to write a script to lock an address whenever another address (in the same game that I'm trying to hack) is a certain value.

EG.
I want to lock address 0x11111111 to a value "5" whenever address 0x22222222 has a value "10".

I know a bit about C but I'm not sure why the following code doesn't work.
Much appreciation for any help you guys can provide!

Code:
VOID Lock( MHS_ADDRESS aAddress, INT iItemSize ) {

DWORD ValueToWrite;
ValueToWrite = 5;
extern DWORD WriteToHere = { "", aAddress };
if ( 0x22222222 == 10 ) {
WriteToHere = ValueToWrite;
}
}
Gaqed
I Have A Few Questions
 
Posts: 2
Joined: Wed Jun 18, 2008 3:11 am

Postby mezzo » Wed Jun 18, 2008 3:33 am

if ( 0x22222222 == 10 ) {


this needs to be an extern too, because the 0x22222222 address needs to be read out of the game and not from MHS's memory.
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby Gaqed » Wed Jun 18, 2008 3:44 am

Could you please show me what the finished code would look like? Sorry, I'm unfamilliar with LSS. Thanks!
Gaqed
I Have A Few Questions
 
Posts: 2
Joined: Wed Jun 18, 2008 3:11 am

Postby mezzo » Wed Jun 18, 2008 3:54 am

Code: Select all
VOID Lock( MHS_ADDRESS aAddress, INT iItemSize ) {

   DWORD ValueToWrite = 5;

   extern DWORD WriteToHere = { "", aAddress };
   extern DWORD valuetocheck = { "", 0x22222222 };

   if ( valuetocheck == 10 ) {
      WriteToHere = ValueToWrite;
      }
}


At the top of my head, I would say something like this..
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron