CLEO Help Solved

CLEO related
Status
Not open for further replies.

DxPain

Member
Joined
Apr 23, 2020
Messages
16
Reaction score
0
Location
Târgu Mureș
1. Chat Detector.cs
2. You have one minute left before your paycheck code expires. Please type /signcheck to get your paycheck.
3. send command /signcheck
4. Server 0.3.dl
5.Sumpfuncs : None

I want an ChatDetector.cs the hack is want to detect this chat everytime this chat is appear in chat
you have one minute left before your paycheck code expires. Please type /signcheck to get your paycheck.
then send command
/signcheck


see the picture bellow


Code:
{$CLEO .cs}

0000:

repeat
wait 0
until 0afa:

while true
wait 0

FOR 6@ = 98 TO 99
0AC8: 0@ = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
0AB1: @GETCHATENTRYTEXT 1 id 6@ to 0@ // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO 0@
   
if
0AD4: $NOT_USED = scan_string 0@ format "you have one minute left before your paycheck code expires. Please type /signcheck to get your paycheck." $NOT_USED 5@
then
    say "/signcheck" 5@
    wait 3000
end 

END // END FOR 0@ = 98 TO 99

end // end while true


:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x21A0E4
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: 1 1@
C@Lukasparazitas
 

Attachments

  • b.png
    b.png
    6.7 KB · Views: 38
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

0AC8: 0@ = allocate_memory_size 145
0AC8: 3@ = allocate_memory_size 145
0AC8: 4@ = allocate_memory_size 145
0AC8: 5@ = allocate_memory_size 145
0AD3: 4@ = "/signcheck"   // Check / find text
0AB1: @GetChatEntryText 1 id 99 to 0@
if                 
0AB1: @IfTextContains 2 mainTextPointer 0@ pieceToFindPointer 4@ _returnedPointer 5@ //5@ is useless xDD
then
    0AD3: string_format 3@ format "/signcheck"
    0AB1: @SEND_CMD 1 3@
    wait 1000 // anti spam
end
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 3@                                     
0AC9: free_allocated_memory 4@
0AC9: free_allocated_memory 5@

end

:SEND_CMD
{
    0AB1: @SEND_CMD 1 text 3@
    0.3.DL
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x69340 //FUNC_SEND_CMD 
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


:getChatEntryText
{
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@ 
    0.3.DL
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA10
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
} 
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@ 

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1 
26@ = 0 // counter of the same chars in a row 
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)    
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0
    
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)   
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0 
    end           
end 
 
059A:  return_false
0AB2: ret 1 0

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
for 1@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    if not 2@ == 0
    jf break
    0@ += 1
end
0AB2: ret 1 1@
 

DxPain

Member
Joined
Apr 23, 2020
Messages
16
Reaction score
0
Location
Târgu Mureș
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

0AC8: 0@ = allocate_memory_size 145
0AC8: 3@ = allocate_memory_size 145
0AC8: 4@ = allocate_memory_size 145
0AC8: 5@ = allocate_memory_size 145
0AD3: 4@ = "/signcheck"   // Check / find text
0AB1: @GetChatEntryText 1 id 99 to 0@
if                 
0AB1: @IfTextContains 2 mainTextPointer 0@ pieceToFindPointer 4@ _returnedPointer 5@ //5@ is useless xDD
then
    0AD3: string_format 3@ format "/signcheck"
    0AB1: @SEND_CMD 1 3@
    wait 1000 // anti spam
end
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 3@                                     
0AC9: free_allocated_memory 4@
0AC9: free_allocated_memory 5@

end

:SEND_CMD
{
    0AB1: @SEND_CMD 1 text 3@
    0.3.DL
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x69340 //FUNC_SEND_CMD 
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0


:getChatEntryText
{
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@ 
    0.3.DL
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA10
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
} 
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@ 

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1 
26@ = 0 // counter of the same chars in a row 
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)    
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0
    
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int)   
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0 
    end           
end 
 
059A:  return_false
0AB2: ret 1 0

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
for 1@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    if not 2@ == 0
    jf break
    0@ += 1
end
0AB2: ret 1 1@
Correct me if im wrong you are detecting the /signcheck word in chat instead of detecting this chat "you have one minute left before your paycheck code expires. Please type /signcheck to get your paycheck." ???
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
0.3.DL SignCheck
Chat and Dialog.
Tested.

Chat
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = "Type /signcheck"   // Check / find text

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    for 30@ = 95 to 99
        0AC8: 0@ = allocate_memory_size 260
        0AB1: @GetChatEntryText 1 id 30@ to 0@
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @changeString 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 1@
        if               
        0AB1: @IfTextContains 2 mainTextPointer 1@ pieceToFindPointer 2@ _returnedPointer 3@
        then
            //0AB1: @Chatmsg 2 color 0xFFFFFF00 text 3@
            0AC8: 4@ = allocate_memory_size 260
            0AD3: string_format 4@ format "/signcheck"
            0AB1: @SEND_CMD 1 4@
            wait 10000 // anti spam */
        end
    end
end

end

:SEND_CMD
{
    0AB1: @SEND_CMD 1 text 3@
    0.3.DL
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x69340 //FUNC_SEND_CMD
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0

:GetChatEntryText
{
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 id 99 to 0@
    0.3.DL
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA10
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)  
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0
  
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int) 
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end         
end

059A:  return_false
0AB2: ret 1 0

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ _return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
for 1@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    if not 2@ == 0
    jf break
    0@ += 1
end
0AB2: ret 1 1@

:changeString
{
    0AB1: call_scm_func @changeString param_count 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text

}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

        if
        5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 3@ size 1 value 28@ virtual_protect 1
            3@ += 1 // move to next address
        END

        if
        003B:   28@ == 2@  // (int)
        then
            5@ = FALSE // inbracket
        end
    end
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:Chatmsg
//0AB1: @Chatmsg 2 color 0xFF00FF00 text 0@
IF 0AA2: 2@ = "samp.dll"
THEN
    0085: 3@ = 2@
    3@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET_03DL
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += 0x67650 // FUNC_ADDTOCHATWND_03DL
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0

Dialog
PHP:
{$CLEO .cs}
                               
0000: NOP

wait 8500

0AC8: 2@ = allocate_memory_size 260 // allocate to format text
0AD3: 2@ = format "Sign check" // format text

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    if 0AB1:  @isDialogOpen 0 // check if is dialog active then....
    then
        if 0AB1:  @GetDialogCaption 0 0@ /// get dialog caption
        then
            if 0AB1: @IfTextContains 2 mainTextPointer 0@ pieceToFindPointer 2@ _returnedPointer 3@ // 4@ - not_used, find peace of text
            then
                if
                0AB1: @getDialogText 0 4@
                then
                    0AC8: 5@ = allocate_memory_size 260
                    0AB1: @get_digits_to_print param_count 2 text 4@ memory_to_store_digits_as_text 5@
                    0209: 6@ = random_int_in_ranges 1000 2000
                    wait 6@
                    0AB1: @SetDialogInputEditBoxText 1 => text 5@
                    0AB1: @CloseCurrentDialogWithButton 1 Button 1 // 1 = Left , 0 = Right
                    //0AB1: @Chatmsg 2 color 0xFFFFFF00 text 5@
                end
            end
        end
    end
end

end

:isDialogOpen
0AA2: 1@ = "samp.dll"
1@ += 0x2AC9E0
0A8D: 1@ = readMem 1@ sz 4 vp 0
0A8E: 2@ = 1@ + 0x28
0A8D: 2@ = readMem 2@ sz 4 vp 0
if 2@ == 1
then
    0485: dialog_open
else
    059A: dialog_closed
end
0AB2: ret 0

:GetDialogCaption
{
    0.3.DL
}
0AA2: 1@ = "samp.dll"
1@ += 0x2AC9E0
0A8D: 1@ = readMem 1@ sz 4 vp 0
0A8E: 2@ = 1@ + 0x28 //DialogOpenOffset
0A8D: 2@ = readMem 2@ sz 4 vp 0
if 2@ == 1 // Dialog open
then
    0A8E: 3@ = 1@ + 0x40 //DialogCaptionOffset
    0485: dialog_open
    0AB2: ret 1 3@
else
    059A:  dialog closed
end
0AB2: ret 0

:IfTextContains
{
    0@ - the main text
    1@ - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr 0@ _length 31@
0AB1: @strlen 1 strPtr 1@ _length 30@

//initial length check (the phrase can't be longer than the main text)
if 001D:   30@ > 31@  // (int)
then
059A:  return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text  (29@ = index)  
    0085: 24@ = 0@ // (int)
    005A: 24@ += 29@  // (int)
    0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0
  
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

    if 003B:   28@ == 27@  // (int) 
    then
    26@++
        if 002D:   26@ >= 30@  // (int)
        then
        0485:  return_true
        0062: 24@ -= 30@  // (int)
        24@ += 1
        0AB2: ret 1 24@
        end
    else
        if 26@ > 0
        then
        29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
        end
    26@ = 0
    end         
end

059A:  return_false
0AB2: ret 1 0

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
for 1@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    if not 2@ == 0
    jf break
    0@ += 1
end
0AB2: ret 1 1@

:GetDialogText
{
    0.3.DL
}
0AA2: 1@ = "samp.dll"
1@ += 0x2AC9E0
0A8D: 1@ = readMem 1@ sz 4 vp 0
0A8E: 2@ = 1@ + 0x28 //DialogOpenOffset
0A8D: 2@ = readMem 2@ sz 4 vp 0
if 2@ == 1 // Dialog active
then
    0A8E: 3@ = 1@ + 0x2C //DialogTypeOffset
    0A8D: 3@ = readMem 3@ sz 4 vp 0
    if or
    3@ == 0 // DIALOG_STYLE_MSGBOX
    3@ == 1 // DIALOG_STYLE_INPUT
    3@ == 3 // DIALOG_STYLE_PASSWORD
    then
        0A8E: 4@ = 1@ + 0x34 // DialogTextOffset
        0A8D: 4@ = readMem 4@ sz 4 vp 0
        0485: dialog_open
        0AB2: ret 1 4@
    else 059A:  dialog closed
    end
end
0AB2: ret 0

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if and
        28@ >= 0x30 // '0'
        28@ <= 0x39 // '9'
        then
        0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
        1@ += 1 // move to next address
        end
    end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:Chatmsg
//0AB1: @Chatmsg 2 color 0xFF00FF00 text 0@
IF 0AA2: 2@ = "samp.dll"
THEN
    0085: 3@ = 2@
    3@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET_03DL
    0A8D: 3@ = readMem 3@ sz 4 vp 1
    0085: 4@ = 2@
    4@ += 0x67650 // FUNC_ADDTOCHATWND_03DL
    0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8
END
0AB2: 0

:SetDialogInputEditBoxText
{
    0.3.DL
    0AB1: @SetDialogInputEditBoxText 1 => text 0@
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x2AC9E0            // SAMP_DIALOG_INFO_OFFSET (R1)
    0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
    0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
    0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;
 
    0A8E: 5@ = 2@ + 0x85000 // CDXUTEditBox::GetText (offset for 0.3.7 R1)
 
    // 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 0 _pszText 0@ _retVal 6@
end
0AB2: 0

:CloseCurrentDialogWithButton
{
    0.3.DL
    0AB1: @CloseCurrentDialogWithButton 1 Button 0 // 1 = Left , 0 = Right
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 0
    0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 0@ $NOT_USED
END
0AB2: 0

@_Safa Lock.
 
Last edited:
Status
Not open for further replies.
Top