Question with calculating an address in a private base in SC

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

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Question with calculating an address in a private base in SC

Postby PercyPierce » Thu Feb 02, 2017 3:16 pm

Hi guys! Sorry if this question has been asked before but I just figured out how to get the script editor to work, and I came up with this code.

Code: Select all
VOID Lock ( MHS_ADDRESS aAddress, INT iItemSize )
{
extern INT p2buttons = { "", aAddress };  // This is the address of the joystick that's plugged into the computer that the emulator picks up. A PRIVATE address that moves when I reboot the emulator.
extern BYTE P2facing = { "", ssf.exe + 6473071 }; // This is a variable that tells me if the player is facing right or left (0 or 1).


// I put no code here yet

}

I get a compile error when I press ok. My question is how do I get the script to calculate addresses across modules? It doesn't seem as simple as it is when using the expression evaluator.
PercyPierce
I Have A Few Questions
 
Posts: 3
Joined: Sun Jan 29, 2017 11:26 am

Re: Question with calculating an address in a private base in SC

Postby L. Spiro » Thu Feb 02, 2017 4:15 pm

Code: Select all
extern BYTE P2facing = { "", ssf.exe + 6473071 };

should be:
Code: Select all
extern BYTE P2facing = { "ssf.exe", + 6473071 };



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

Re: Question with calculating an address in a private base in SC

Postby PercyPierce » Fri Jul 28, 2017 2:28 am

Hey there guys I have another question. I am making an AI for a fighting game. Because I am just disappointed by the AI that the game itself has. Now there are about 32 characters in the game, and I would like to make a separate file for each one. Then I would like memhack to stream the code for each character off of the disk.



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

extern BYTE yourcharacter = {"ssf.exe", 0x6472EA8};


   
   


switch (yourcharacter)

{
   case 0: {   /*open notepad txt file containing code for this character and load it into here.   */   break;}      
   case 1: {   /*open notepad txt file containing code for this character and load it into here.      */   break;}      
        case 2: {   /*open notepad txt file containing code for this character and load it into here.      */   break;}      
        case 3: {   /*open notepad txt file containing code for this character and load it into here.      */   break;}      
                           
}
}
}







is memhack capable of doing this?
PercyPierce
I Have A Few Questions
 
Posts: 3
Joined: Sun Jan 29, 2017 11:26 am

Re: Question with calculating an address in a private base in SC

Postby L. Spiro » Fri Aug 04, 2017 2:42 pm

I see no problem with it. It’s up to you to find the files and parse them, etc., but otherwise this should be a very simple task.
Just use the FILE functions to access the files and breakpoints to trigger scripts.


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

Re: Question with calculating an address in a private base in SC

Postby PercyPierce » Sun Dec 10, 2017 9:03 am

ok here's an example:
Code: Select all
Select all
    VOID Lock ( MHS_ADDRESS aAddress, INT iItemSize )
    {

    extern BYTE yourcharacter = {"ssf.exe", 0x6472EA8};


       
       


    switch (yourcharacter)

    {
   
            case 4: {   FOpen( "C:UsersBuyerGoogle DriveStreet Fighter Zero 3 Saturn AIchunli.lss","r");   break;}     
                               
    }
    }
    }






Does nothing. Do I really have to use breakpoints to trigger scripts, or is there a way to just like open the file and replace the FOPEN function with the contents of the file?

Sorry I haven't replied to your post in a while.
PercyPierce
I Have A Few Questions
 
Posts: 3
Joined: Sun Jan 29, 2017 11:26 am

Re: Question with calculating an address in a private base in SC

Postby L. Spiro » Mon Dec 18, 2017 5:23 am

Scripts can be triggered by opening a process, starting up MHS, via hotkeys, etc. All of these methods are in the help file.

You opened the file but you did not store the FILE * that FOpen() returns. You can’t use FRead() or FWrite() without that pointer.
There are many tutorials online on how to work with files in C.
http://www.thegeekstuff.com/2012/07/c-file-handling/


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