function pointer in lss

Ask for Help on Using the Language With Memory Hacking Software

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

function pointer in lss

Postby throw » Mon Apr 05, 2010 3:14 am

Hello,

Is it possible to have function pointers in an LSS script ?
I am trying to compile this, but am getting a syntax error:

Code: Select all
int    (*Dll_GetTimestamp)(void);



I am trying to load a dll and call some functions in the dll that will return values to LSS script.

Many thanks.
throw
I Have A Few Questions
 
Posts: 5
Joined: Wed Mar 31, 2010 11:24 pm

Re: function pointer in lss

Postby L. Spiro » Mon Apr 05, 2010 12:51 pm

Refer to the CallLocalFunction() function in the help file.


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: function pointer in lss

Postby throw » Tue Apr 06, 2010 6:52 pm

Hello L. Spiro thanks for that.

It is working with a dll function that returns an int.

Is there a description of the LOCAL_CALL_RETURN structure anywhere? I wonder if I can allocate memory in LSS and pass a pointer to the memory, to a dll function for it to write to...
throw
I Have A Few Questions
 
Posts: 5
Joined: Wed Mar 31, 2010 11:24 pm

Re: function pointer in lss

Postby L. Spiro » Wed Apr 07, 2010 8:16 am

It is not in the help file because it is a typedef of REMOTE_CALL_RETURN.


Code: Select all
union REMOTE_CALL_RETURN {
    unsigned char bByte;                                        // Offset: 0, Size: 1.
    char cChar;                                                 // Offset: 0, Size: 1.
    unsigned short wWord;                                       // Offset: 0, Size: 2.
    short sShort;                                               // Offset: 0, Size: 2.
    unsigned int dwDWord;                                       // Offset: 0, Size: 4.
    int lLong;                                                  // Offset: 0, Size: 4.
    unsigned __int64 ui64Int64;                                 // Offset: 0, Size: 8.
    __int64 i64Int64;                                           // Offset: 0, Size: 8.
    float fFloat;                                               // Offset: 0, Size: 4.
    double dDouble;                                             // Offset: 0, Size: 8.
    unsigned int uiPtr;                                         // Offset: 0, Size: 4.
}; // Size: 8.




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: function pointer in lss

Postby throw » Wed Apr 07, 2010 10:26 pm

Thanks L.Spiro good work :)

In CallLocalFunction() I had to pass the dll functions parameters in reverse order.
throw
I Have A Few Questions
 
Posts: 5
Joined: Wed Mar 31, 2010 11:24 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests