Variables return wrong values?

Ask for Help on Using the Language With Memory Hacking Software

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Variables return wrong values?

Postby CoMPMStR » Fri Apr 25, 2008 4:21 am

Ok, I'm back for more help. I'm trying to write a script to do an initial search and then retrieve the results and store them in an array for further use. This is what I'm having problems with:

Code: Select all
LPVOID initAddy[1];
DWORD initVal[1];

void On_HK_1(DWORD dw1, DWORD dw2)
{
   int searchTotal = GetScanTotal();
   
   LPVOID addy;
   DWORD Value;
   
   for( int i = 0; i < searchTotal ; i++)
   {
      if(GetScanValue(i, &addy, &Value))
      {
         initAddy[i] = addy;
         initVal[i] = Value;
         //PrintF("Address:%d / Value:%d", initAddy[i], initVal[i]);
      }
   }
   
   Display(searchTotal);
}

VOID Display(DWORD dwParam)
{
   for (int i = 0; i < dwParam; i++)
   {
      PrintF("Address:%d / Value:%d", initAddy[i], initVal[i]);
   }
}


The variables initAddy and initVal are global and store the initial search's values and addresses after I perform the scripted search. In the for loop under void On_HK_1 (where the function GetScanValue is) the PrintF function returns the correct values for both initAddy and initVal arrays. Now when it gets to the Display void, the values are not correct for initVal, initAddy still displays the correct values (or addresses). The reason I need it in a seperate void is because it will be a new thread to monitor which of those values changes after the search and then record the addresses of the changed values. I don't understand why the initVal values change from one void to the next. Thanks in advance. :D
Image

______________________________________________________
My Utilities:
CT <-> LSSAVE Converter
LSS Visual Dialog Designer
.NET Trainer Helper Library

~Whether you think you can or you think you can't, you're right.

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.
User avatar
CoMPMStR
(P)ot (I)n (M)y (P)ipe
 
Posts: 451
Joined: Thu Mar 06, 2008 7:50 am
Location: Best Place

Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron