CLEO Help DLL Call

CLEO related
Status
Not open for further replies.

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
maybe somebody know What i doing wrong?
Or maybe i have wrong offset?

PHP:
:Set_dialog_Text
{
    0.3.7 - R3
    0AB1: @Set_dialog_Text 1 text 0@
}
IF 0AA2: 10@ = "samp.dll"
THEN 
    0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 0
    0A8E: 11@ = 10@ + 0x6AE30 //SAMP_SET_DIALOG TEXT
    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 0@ 1@
END
0AB2: 0

@springfield or any ...
 

y0mike

Active member
Joined
May 10, 2014
Messages
97
Reaction score
41
Location
mizus girl's house
maybe somebody know What i doing wrong?
Or maybe i have wrong offset?
@springfield or any ...

You haven't said, is it crashing when you call it, or just not doing anything?

You should definitely start by verifiying its the correct offset.

If it is, I have noticed only one thing -

Code:
0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 0@ 1@

I know jack shit about CLEO but it seems you want to pass 2 parameters to the function (thats presumably a __thiscall) but specify "num_params 1 "? Shouldn't it be "num_params 2"?

Honestly it's much easier (imo) and wayy faster to just do this in c++.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Your offset, 0x6AE30 (0.3.7 R3) is inside a sa-mp font rendering function, nothing related to dialogs. Also is vague which part of the dialog text you want to edit, caption, content, input etc.

I know jack shit about CLEO but it seems you want to pass 2 parameters to the function (thats presumably a __thiscall) but specify "num_params 1 "? Shouldn't it be "num_params 2"?

The last variable is used to store the return value.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Your offset, 0x6AE30 (0.3.7 R3) is inside a sa-mp font rendering function, nothing related to dialogs. Also is vague which part of the dialog text you want to edit, caption, content, input etc.
The last variable is used to store the return value.
I trying learn how get this pointer
0B4B: samp set_current_dialog_editbox_text 1@
and make it work without sampfuncs.
I tried find it a lot times, but always not successfully.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
I trying learn how get this pointer
0B4B: samp set_current_dialog_editbox_text 1@
and make it work without sampfuncs.
I tried find it a lot times, but always not successfully.

Well, for some elements(controls etc.) you can find the static size buffer, and just copy to it, for others(input, lists etc.) that use dynamic buffers, you need to find each function.

C++:
while true
    wait 0    
    if 0ab0: 49 // press 1
    then 
        alloc 0@ = 64
        format 0@ "hello there!"
        call @SetCurrentDialogEditBoxText 2 => text 0@ selected 0
        free 0@
        wait 100
    end 
end

:SetCurrentDialogEditBoxText
if 0AA2: 2@ = "samp.dll"
then 
    0A8E: 3@ = 2@ + 0x26E898            // SAMP_DIALOG_INFO_OFFSET (R3)
    0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
    0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
    0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;
    
    // you should probably check if all these pointers are valid before using 'em
    0A8E: 5@ = 2@ + 0x84E70 // CDXUTEditBox::SetText (offset for 0.3.7 R3)
    
    // CDXUTEditBox::SetText takes 2 params
    // 1 - pointer to zero terminated string
    // 2 - bool, if text is to be selected or not
    
    0AA8: call_function_method 5@ struct 4@ num_params 2 pop 0 _bSelected 1@ _pszText 0@ _retVal 6@ 
end
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
@springfield
Thx, now i know how get Dialog Set edit box and make snippet for any samp version.
I just wanna ask .

pChat->pChatBox; offset is same like pDialog->pEditBox ?
 
Last edited:
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
So which way is best to find this offset?
Because i wanna learn find it my self.
I using Cheat engine.

Find the text buffer in memory, attach CE, break on write, trace it back.

I just wanna ask .
pChat->pChatBox; offset is same like pDialog->pEditBox ?

I don't know what pChat/pChatBox is supposed to be w/o context.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
I don't know what pChat/pChatBox is supposed to be w/o context.

@springfield
Last time when you found " set Dialog edit box text " ptr , i do dialog ptr + edit box offset = and now i know how to get " set Dialog edit box text " for any samp.
You give me good example for dialog, thx for that.

if you have time , please find this one.
This is much better use than send cmd which i know how get.
PHP:
0C8F: samp process_chat_input "/save"

Also...
How you know how many params need every time?
I haven't a lot experience with dll call
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
@springfield
This is how i found that ptr for 0.3.DL , after when you found it for 0.3.7 - R3


I asked last time .:
pChat->pChatBox; offset is same like pDialog->pEditBox ?
Because i wanna do that for chat editbox
 
Last edited:

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
52
Location
LongForgotten <-> 0x32789

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
https://github.com/BlastHackNet/mod_s0beit_sa-1/tree/master/src

0.3.7

https://github.com/BlastHackNet/mod_s0beit_sa-1/tree/samp-dl
0.3.DL

I suggest look at s0biet source like.. you will understand everything.
It's so easy to work with 0.3.DL cause s0biet has all the offsets and shit.
Other than it, it is also good to understand how it hooks into directx and raknet.
Look in mod_sa, i think you mean pInput->pEditBox, sa-mp chat and input are different(different pointers/offsets too).


Also how to know how many params need ????
PHP:
0C8F: samp process_chat_input "/save"

Maybe you or somebody else can explain it...

C++:
struct stInputBox
{
    void    *pUnknown;
    uint8_t    bIsChatboxOpen;
    uint8_t    bIsMouseInChatbox;
    uint8_t    bMouseClick_related;
    uint8_t    unk;
    DWORD    dwPosChatInput[2];
    uint8_t    unk2[263];
    int        iCursorPosition;
    uint8_t    unk3;
    int        iMarkedText_startPos; // Highlighted text between this and iCursorPosition
    uint8_t    unk4[20];
    int        iMouseLeftButton;
};
 
Status
Not open for further replies.
Top