Solved

Status
Not open for further replies.
Joined
Apr 23, 2020
Messages
16
Likes
0
Points
1
Location
Târgu Mureș
1
#1
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 [email protected] = 98 TO 99
0AC8: [email protected] = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
0AB1: @GETCHATENTRYTEXT 1 id [email protected] to [email protected] // THIS IS A FUNCTION THAT STORES THE LAST CHAT STRING INTO [email protected]
   
if
0AD4: $NOT_USED = scan_string [email protected] format "you have one minute left before your paycheck code expires. Please type /signcheck to get your paycheck." $NOT_USED [email protected]
then
    say "/signcheck" [email protected]
    wait 3000
end 

END // END FOR [email protected] = 98 TO 99

end // end while true


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

Attachments

Last edited:

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
2,282
Likes
472
Points
113
Location
Lithuania
Website
ugbase.eu
20
#3
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

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

end

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


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

:IfTextContains
{
    [email protected] - the main text
    [email protected] - piece of text to be found within the main text
} 
0AB1: @strlen 1 strPtr [email protected] _length [email protected]
0AB1: @strlen 1 strPtr [email protected] _length [email protected] 

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

[email protected] -= 1 
[email protected] = 0 // counter of the same chars in a row 
for [email protected] = 0 to [email protected] // for each char of the main text  ([email protected] = index)    
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0

    if 003B:   [email protected] == [email protected]  // (int)   
    then
    [email protected]++
        if 002D:   [email protected] >= [email protected]  // (int)
        then
        0485:  return_true
        0062: [email protected] -= [email protected]  // (int)
        [email protected] += 1
        0AB2: ret 1 [email protected]
        end
    else
        if [email protected] > 0
        then
        [email protected] //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
    [email protected] = 0 
    end           
end 
 
059A:  return_false
0AB2: ret 1 0

:strlen
{
    Example: 0AB1: @strlen 1 string [email protected] return: [email protected]
    In: [email protected] - text;
    Out: [email protected] - size;
}
for [email protected] = 0 to 1024
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    if not [email protected] == 0
    jf break
    [email protected] += 1
end
0AB2: ret 1 [email protected]
 
OP
OP
DxPain
Joined
Apr 23, 2020
Messages
16
Likes
0
Points
1
Location
Târgu Mureș
1
#4
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

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

end

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


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

:IfTextContains
{
    [email protected] - the main text
    [email protected] - piece of text to be found within the main text
} 
0AB1: @strlen 1 strPtr [email protected] _length [email protected]
0AB1: @strlen 1 strPtr [email protected] _length [email protected] 

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

[email protected] -= 1 
[email protected] = 0 // counter of the same chars in a row 
for [email protected] = 0 to [email protected] // for each char of the main text  ([email protected] = index)    
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0

    if 003B:   [email protected] == [email protected]  // (int)   
    then
    [email protected]++
        if 002D:   [email protected] >= [email protected]  // (int)
        then
        0485:  return_true
        0062: [email protected] -= [email protected]  // (int)
        [email protected] += 1
        0AB2: ret 1 [email protected]
        end
    else
        if [email protected] > 0
        then
        [email protected] //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
    [email protected] = 0 
    end           
end 
 
059A:  return_false
0AB2: ret 1 0

:strlen
{
    Example: 0AB1: @strlen 1 string [email protected] return: [email protected]
    In: [email protected] - text;
    Out: [email protected] - size;
}
for [email protected] = 0 to 1024
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    if not [email protected] == 0
    jf break
    [email protected] += 1
end
0AB2: ret 1 [email protected]
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

Well-Known Member
Joined
Jan 2, 2017
Messages
2,282
Likes
472
Points
113
Location
Lithuania
Website
ugbase.eu
20
#9
0.3.DL SignCheck
Chat and Dialog.
Tested.

Chat
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AC8: [email protected] = allocate_memory_size 260
0AD3: [email protected] = "Type /signcheck"   // Check / find text

while true
wait 0

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

end

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

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

:IfTextContains
{
    [email protected] - the main text
    [email protected] - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr [email protected] _length [email protected]
0AB1: @strlen 1 strPtr [email protected] _length [email protected]

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

[email protected] -= 1
[email protected] = 0 // counter of the same chars in a row
for [email protected] = 0 to [email protected] // for each char of the main text  ([email protected] = index)  
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
  
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0

    if 003B:   [email protected] == [email protected]  // (int) 
    then
    [email protected]++
        if 002D:   [email protected] >= [email protected]  // (int)
        then
        0485:  return_true
        0062: [email protected] -= [email protected]  // (int)
        [email protected] += 1
        0AB2: ret 1 [email protected]
        end
    else
        if [email protected] > 0
        then
        [email protected] //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
    [email protected] = 0
    end         
end

059A:  return_false
0AB2: ret 1 0

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

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

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

        if
        [email protected] == FALSE // inbracket
        THEN
            0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect 1
            [email protected] += 1 // move to next address
        END

        if
        003B:   [email protected] == [email protected]  // (int)
        then
            [email protected] = FALSE // inbracket
        end
    end
0A8C: write_memory [email protected] size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:Chatmsg
//0AB1: @Chatmsg 2 color 0xFF00FF00 text [email protected]
IF 0AA2: [email protected] = "samp.dll"
THEN
    0085: [email protected] = [email protected]
    [email protected] += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET_03DL
    0A8D: [email protected] = readMem [email protected] sz 4 vp 1
    0085: [email protected] = [email protected]
    [email protected] += 0x67650 // FUNC_ADDTOCHATWND_03DL
    0AA6: call [email protected] struct [email protected] num_params 5 pop 0 params 0 [email protected] 0 [email protected] 8
END
0AB2: 0
Dialog
PHP:
{$CLEO .cs}
                               
0000: NOP

wait 8500

0AC8: [email protected] = allocate_memory_size 260 // allocate to format text
0AD3: [email protected] = 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 [email protected] /// get dialog caption
        then
            if 0AB1: @IfTextContains 2 mainTextPointer [email protected] pieceToFindPointer [email protected] _returnedPointer [email protected] // [email protected] - not_used, find peace of text
            then
                if
                0AB1: @getDialogText 0 [email protected]
                then
                    0AC8: [email protected] = allocate_memory_size 260
                    0AB1: @get_digits_to_print param_count 2 text [email protected] memory_to_store_digits_as_text [email protected]
                    0209: [email protected] = random_int_in_ranges 1000 2000
                    wait [email protected]
                    0AB1: @SetDialogInputEditBoxText 1 => text [email protected]
                    0AB1: @CloseCurrentDialogWithButton 1 Button 1 // 1 = Left , 0 = Right
                    //0AB1: @Chatmsg 2 color 0xFFFFFF00 text [email protected]
                end
            end
        end
    end
end

end

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

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

:IfTextContains
{
    [email protected] - the main text
    [email protected] - piece of text to be found within the main text
}
0AB1: @strlen 1 strPtr [email protected] _length [email protected]
0AB1: @strlen 1 strPtr [email protected] _length [email protected]

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

[email protected] -= 1
[email protected] = 0 // counter of the same chars in a row
for [email protected] = 0 to [email protected] // for each char of the main text  ([email protected] = index)  
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
  
    0085: [email protected] = [email protected] // (int)
    005A: [email protected] += [email protected]  // (int)
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0

    if 003B:   [email protected] == [email protected]  // (int) 
    then
    [email protected]++
        if 002D:   [email protected] >= [email protected]  // (int)
        then
        0485:  return_true
        0062: [email protected] -= [email protected]  // (int)
        [email protected] += 1
        0AB2: ret 1 [email protected]
        end
    else
        if [email protected] > 0
        then
        [email protected] //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
    [email protected] = 0
    end         
end

059A:  return_false
0AB2: ret 1 0

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

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

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

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

:SetDialogInputEditBoxText
{
    0.3.DL
    0AB1: @SetDialogInputEditBoxText 1 => text [email protected]
}
if 0AA2: [email protected] = "samp.dll"
then
    0A8E: [email protected] = [email protected] + 0x2AC9E0            // SAMP_DIALOG_INFO_OFFSET (R1)
    0A8D: [email protected] = readMem [email protected] sz 4 vp 0     // pDialog;
    0A8E: [email protected] = [email protected] + 0x24                // pDialog->pEditBox;
    0A8D: [email protected] = readMem [email protected] sz 4 vp 0     // pEditBox;
 
    0A8E: [email protected] = [email protected] + 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 [email protected] struct [email protected] num_params 2 pop 0 _bSelected 0 _pszText [email protected] _retVal [email protected]
end
0AB2: 0

:CloseCurrentDialogWithButton
{
    0.3.DL
    0AB1: @CloseCurrentDialogWithButton 1 Button 0 // 1 = Left , 0 = Right
}
IF 0AA2: [email protected] = "samp.dll"
THEN
    0A8E: [email protected] = [email protected] + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: [email protected] = readMem [email protected] sz 4 vp 0
    0A8E: [email protected] = [email protected] + 0x700D0 //SAMP_DIALOG_CLOSE
    0AA8: call_function_method [email protected] struct [email protected] num_params 1 pop 0 [email protected] $NOT_USED
END
0AB2: 0
@_Safa Lock.
 
Last edited:
Status
Not open for further replies.
Top