Types of Sign Check and Sources , etc...

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Hey there!
can you please code something that passes this catchpa ?
I would really appreciate this.


I'm facing this kind of error and then the game crashes out.
What is the problem?

0.3.DL
PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8AA2: $NOT_USED = "samp.dll"
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0AA2: $NOT_USED = "samp.dll"

while true
wait 0

if 0256: player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@

    0AC8: 4@ = allocate_memory_size 1024
    0AB1: @changeString param_count 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 4@
  
    0AC8: 5@ = allocate_memory_size 1024
    0AD3: 5@ = format "/hello"
    if 0AB1: @IfTextContains 2 String1 4@ String2 5@ _Returned: Text 6@
    then
        0AC8: 7@ = allocate_memory_size 1024
        0AB1: @get_digits_to_print 2 text 4@ memory_to_store_digits_as_text 7@
        0AB1: @ProcessChatInput 1 InputText 7@
        wait 1500
    end
end

end

:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.DL
}

IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x132
    0@ *= 0xFC
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
    0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
    0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
    0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
    0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
    0A8D: 25@ readMem 26@ sz 1 vp 0
    IF NOT 25@ > 0
    THEN 24@ = 0
    ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

: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@ _returned: length 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

:IfTextContains
/*
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "my string to compare"
    IF 0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
*/

0AB1: @strlen 1 string 0@ _returned: length 31@
0AB1: @strlen 1 string 1@ _returned: 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@ = readMem 24@ sz 1 vp 0
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@ // (int)
    0A8D: 27@ = readMem 23@ sz 1 vp 0

    IF AND
    28@ >= 65 // From A
    28@ >= 90 // Till Z
    THEN 28@ += 32 // convert to lowercase
    END

    IF AND
    27@ >= 65 // From A
    27@ >= 90 // Till Z
    THEN 27@ += 32 // convert to lowercase
    END

    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
// 0AB1: @strlen 1 string 1@ _returned: length 3@
FOR 1@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    IF NOT 2@ == 0
    JF break
    0@ += 1
END
0AB2: ret 1 1@

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}

0AB1: @strlen 1 string 0@ _returned: length 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



:ProcessChatInput
{
    0AB1: @ProcessChatInput 1 InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN
    0A8E: 21@ = 20@ + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
    0A8D: 22@ = readMem 21@ sz 4 vp 0 // pChatInput;
    0A8E: 26@ = 22@ + 0x8 // pChatInput->pEditBox;
    0A8D: 27@ = readMem 26@ sz 4 vp 0 // pEditBox;

    0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
    0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT

    0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@

    0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Hello,
I try sign check for chat capha version. The code works but keeps trying as if it didn't happen.
And it crashes after a couple of times. Could you edit the code according to this system?

(if u dont understand;
[VC] Maaş süreniz doldu. Maaşınızı almak için /payday catcha code komutunu kullanın. //This is payday information message.
-
Saatlik bonus *** ve * vCoin kazandınız.
Mevduat hesabınız *** faizlendi. // if u check payday successful

Paydan süreniz henüz dolmamış. // trying to get the payday again for repeating the message

PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8AA2: $NOT_USED = "samp.dll"
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0AA2: $NOT_USED = "samp.dll"

while true
wait 0

if 0256: player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@

    0AC8: 4@ = allocate_memory_size 1024
    0AB1: @changeString param_count 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 4@
    
    0AC8: 5@ = allocate_memory_size 1024
    0AD3: 5@ = format "/payday"
    if 0AB1: @IfTextContains 2 String1 4@ String2 5@ _Returned: Text 6@
    then
        0AC8: 7@ = allocate_memory_size 1024
        0AB1: @get_digits_to_print 2 text 4@ memory_to_store_digits_as_text 7@
        0AB1: @ProcessChatInput 1 InputText 7@
        wait 1500
    end
end

end

:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.DL
}

IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x132
    0@ *= 0xFC
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
    0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
    0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
    0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
    0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
    0A8D: 25@ readMem 26@ sz 1 vp 0
    IF NOT 25@ > 0
    THEN 24@ = 0
    ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

: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@ _returned: length 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

:IfTextContains
/*
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "my string to compare"
    IF 0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
*/

0AB1: @strlen 1 string 0@ _returned: length 31@
0AB1: @strlen 1 string 1@ _returned: 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@ = readMem 24@ sz 1 vp 0
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@ // (int)
    0A8D: 27@ = readMem 23@ sz 1 vp 0

    IF AND
    28@ >= 65 // From A
    28@ >= 90 // Till Z
    THEN 28@ += 32 // convert to lowercase
    END

    IF AND
    27@ >= 65 // From A
    27@ >= 90 // Till Z
    THEN 27@ += 32 // convert to lowercase
    END

    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
// 0AB1: @strlen 1 string 1@ _returned: length 3@
FOR 1@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    IF NOT 2@ == 0
    JF break
    0@ += 1
END
0AB2: ret 1 1@

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}

0AB1: @strlen 1 string 0@ _returned: length 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



:ProcessChatInput
{
    0AB1: @ProcessChatInput 1 InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN
    0A8E: 21@ = 20@ + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
    0A8D: 22@ = readMem 21@ sz 4 vp 0 // pChatInput;
    0A8E: 26@ = 22@ + 0x8 // pChatInput->pEditBox;
    0A8D: 27@ = readMem 26@ sz 4 vp 0 // pEditBox;

    0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
    0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT

    0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@

    0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
END
0AB2: 0
 

Cole_Sp

Member
Joined
Feb 13, 2022
Messages
20
Reaction score
2
Location
Maz
0.3.DL
PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8AA2: $NOT_USED = "samp.dll"
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0AA2: $NOT_USED = "samp.dll"

while true
wait 0

if 0256: player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@

    0AC8: 4@ = allocate_memory_size 1024
    0AB1: @changeString param_count 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 4@

    0AC8: 5@ = allocate_memory_size 1024
    0AD3: 5@ = format "/hello"
    if 0AB1: @IfTextContains 2 String1 4@ String2 5@ _Returned: Text 6@
    then
        0AC8: 7@ = allocate_memory_size 1024
        0AB1: @get_digits_to_print 2 text 4@ memory_to_store_digits_as_text 7@
        0AB1: @ProcessChatInput 1 InputText 7@
        wait 1500
    end
end

end

:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.DL
}

IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x132
    0@ *= 0xFC
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
    0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
    0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
    0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
    0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
    0A8D: 25@ readMem 26@ sz 1 vp 0
    IF NOT 25@ > 0
    THEN 24@ = 0
    ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

: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@ _returned: length 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

:IfTextContains
/*
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "my string to compare"
    IF 0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
*/

0AB1: @strlen 1 string 0@ _returned: length 31@
0AB1: @strlen 1 string 1@ _returned: 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@ = readMem 24@ sz 1 vp 0
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@ // (int)
    0A8D: 27@ = readMem 23@ sz 1 vp 0

    IF AND
    28@ >= 65 // From A
    28@ >= 90 // Till Z
    THEN 28@ += 32 // convert to lowercase
    END

    IF AND
    27@ >= 65 // From A
    27@ >= 90 // Till Z
    THEN 27@ += 32 // convert to lowercase
    END

    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
// 0AB1: @strlen 1 string 1@ _returned: length 3@
FOR 1@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    IF NOT 2@ == 0
    JF break
    0@ += 1
END
0AB2: ret 1 1@

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}

0AB1: @strlen 1 string 0@ _returned: length 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



:ProcessChatInput
{
    0AB1: @ProcessChatInput 1 InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN
    0A8E: 21@ = 20@ + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
    0A8D: 22@ = readMem 21@ sz 4 vp 0 // pChatInput;
    0A8E: 26@ = 22@ + 0x8 // pChatInput->pEditBox;
    0A8D: 27@ = readMem 26@ sz 4 vp 0 // pEditBox;

    0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
    0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT

    0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@

    0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
END
0AB2: 0

Any way to work with 0.3.7 version servers?
Thank you anyway.
 

everbodywants

New member
Joined
Feb 6, 2022
Messages
4
Reaction score
0
Location
New York
PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8AA2: $NOT_USED = "samp.dll"
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0AA2: $NOT_USED = "samp.dll"

while true
wait 0

if 0256: player $PLAYER_CHAR defined
then
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@

    0AC8: 4@ = allocate_memory_size 1024
    0AB1: @changeString param_count 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 4@
   
    0AC8: 5@ = allocate_memory_size 1024
    0AD3: 5@ = format "/payday"
    if 0AB1: @IfTextContains 2 String1 4@ String2 5@ _Returned: Text 6@
    then
        0AC8: 7@ = allocate_memory_size 1024
        0AB1: @get_digits_to_print 2 text 4@ memory_to_store_digits_as_text 7@
        0AB1: @ProcessChatInput 1 InputText 7@
        wait 1500
    end
end

end

:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.DL
}

IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x132
    0@ *= 0xFC
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
    0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
    0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
    0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
    0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
    0A8D: 25@ readMem 26@ sz 1 vp 0
    IF NOT 25@ > 0
    THEN 24@ = 0
    ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

: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@ _returned: length 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

:IfTextContains
/*
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "my string to compare"
    IF 0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
*/

0AB1: @strlen 1 string 0@ _returned: length 31@
0AB1: @strlen 1 string 1@ _returned: 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@ = readMem 24@ sz 1 vp 0
    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@ // (int)
    0A8D: 27@ = readMem 23@ sz 1 vp 0

    IF AND
    28@ >= 65 // From A
    28@ >= 90 // Till Z
    THEN 28@ += 32 // convert to lowercase
    END

    IF AND
    27@ >= 65 // From A
    27@ >= 90 // Till Z
    THEN 27@ += 32 // convert to lowercase
    END

    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
// 0AB1: @strlen 1 string 1@ _returned: length 3@
FOR 1@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    IF NOT 2@ == 0
    JF break
    0@ += 1
END
0AB2: ret 1 1@

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}

0AB1: @strlen 1 string 0@ _returned: length 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



:ProcessChatInput
{
    0AB1: @ProcessChatInput 1 InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN
    0A8E: 21@ = 20@ + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
    0A8D: 22@ = readMem 21@ sz 4 vp 0 // pChatInput;
    0A8E: 26@ = 22@ + 0x8 // pChatInput->pEditBox;
    0A8D: 27@ = readMem 26@ sz 4 vp 0 // pEditBox;

    0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
    0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT

    0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@

    0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
END
0AB2: 0

just writing the code. Payday is not writing the command.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.DL
Captcha Dialog

PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8AA2: $NOT_USED = "samp.dll"
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0AA2: $NOT_USED = "samp.dll"

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 0AB1: @isDialogOpen 0
    THEN
        IF 0AB1: @GetDialogCaption 0 _Return: caption 0@
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AB1: @DeleteColorCodesFromText 2 text 0@ memory_to_store_characters_as_text 1@
            0AC8: 2@ = allocate_memory_size 1024
            0AD3: 2@ = format "Sign check" /// change to your dialog title
            IF 0AB1: @IfTextContains 2 String1 1@ String2 2@ _returned: Text 3@
            THEN
                IF 0AB1: @GetDialogText 0 _Returned: text 4@
                THEN
                    0AC8: 5@ = allocate_memory_size 1024
                    0AB1: @DeleteColorCodesFromText 2 text 4@ memory_to_store_characters_as_text 5@
                    0AC8: 6@ = allocate_memory_size 1024
                    0AB1: @get_digits_to_print 2 text 5@ memory_to_store_digits_as_text 6@
                    0AB1: @SetDialogInputEditBoxText 1 text 6@
                    0209: 7@ = random_int_in_ranges 1000 2000 // generate random time - protect from admin detection
                    wait 7@ // normal people can't react instant , so that why we need add timer
                    0AB1: @CloseCurrentDialogWithButton 1 Button 1 // 1 = Left , 0 = Right
                END
            END
        END
    END
END

END

:isDialogOpen
{
    0.3.DL
    0AB1: @isDialogOpen 0
}
IF 0AA2: 1@ = "samp.dll"   
THEN
    0A8E: 2@ = 1@ + 0x2AC9E0
    0A8D: 2@ = readMem 2@ sz 4 vp 0
    0A8E: 2@ = 2@ + 0x28
    0A8D: 2@ = readMem 2@ sz 4 vp 0
    IF 2@ == 1
    THEN
        0485: dialog_open
    ELSE
        059A: dialog_closed
    END
END
0AB2: ret 0

:GetDialogCaption
{
    0.3.DL
    0AB1: @GetDialogCaption 0 _Returned: caption 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN  
    0A8E: 2@ = 1@ + 0x2AC9E0
    0A8D: 4@ = readMem 2@ sz 4 vp 0
    0A8E: 5@ = 4@ + 0x28 //DialogOpenOffset
    0A8D: 5@ = readMem 5@ sz 4 vp 0
    IF 5@ == 1 // Dialog open
    THEN
        0A8E: 3@ = 4@ + 0x40 //DialogCaptionOffset
        0485: dialog_open
        0AB2: ret 1 3@
    ELSE
        059A:  dialog closed
    END
END
0AB2: ret 0

:GetDialogText
{
    0.3.DL
    0AB1: @GetDialogText 0 _Returned: text 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN 
    0A8E: 2@ = 1@ + 0x2AC9E0
    0A8D: 4@ = readMem 2@ sz 4 vp 0
    0A8E: 5@ = 4@ + 0x28 //DialogOpenOffset
    0A8D: 5@ = readMem 5@ sz 4 vp 0
    IF 5@ == 1 // Dialog active
    THEN
        0A8E: 6@ = 4@ + 0x2C //DialogTypeOffset
        0A8D: 6@ = readMem 6@ sz 4 vp 0
        IF OR
        6@ == 0 // DIALOG_STYLE_MSGBOX
        6@ == 1 // DIALOG_STYLE_INPUT
        6@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 7@ = 4@ + 0x34 // DialogTextOffset
            0A8D: 7@ = readMem 7@ sz 4 vp 0
            0485: dialog_open
            0AB2: ret 1 7@
        ELSE 059A:  dialog closed
        END
    END
END
0AB2: ret 0

:SetDialogInputEditBoxText
{
    0.3.DL
    0AB1: @SetDialogInputEditBoxText 1 text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN  
    0A8E: 3@ = 2@ + 0x2AC9E0            // SAMP_DIALOG_INFO_OFFSET
    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::SetText
       
    // 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 1@ _retVal 6@
END
0AB2: 0

:CloseCurrentDialogWithButton
{
    0.3.DL
    0AB1: @CloseCurrentDialogWithButton 1 Button 1 // 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 Button 0@ _retVal 6@
END
0AB2: 0

:get_digits_to_print
{
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
0AA7: call_function 0x718690 num_params 1 pop 1 string 0@ _Returned: length 31@ // Gta Strlen
    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


:DeleteColorCodesFromText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @DeleteColorCodesFromText 2 text 0@ memory_to_store_characters_as_text 1@
}
5@ = FALSE // inbracket
0AA7: call_function 0x718690 num_params 1 pop 1 string 0@ _Returned: length 31@ // Gta Strlen
    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 28@ == 123
        THEN 5@ = TRUE // inbracket
        END
       
        IF 5@ == FALSE
        THEN
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        END
       
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket
        END
    END
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0



:IfTextContains
/*
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "my string to compare"
    IF 0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
*/
0AA7: call_function 0x718690 num_params 1 pop 1 string 0@ _Returned: length 31@ // Gta Strlen
0AA7: call_function 0x718690 num_params 1 pop 1 string 1@ _Returned: length 30@ // Gta Strlen

//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@ = readMem 24@ sz 1 vp 0

    0085: 23@ = 1@ // (int)
    005A: 23@ += 26@  // (int)
    0A8D: 27@ = readMem 23@ sz 1 vp 0
    IF AND
    28@ >= 65 // From A
    28@ >= 90 // Till Z
    THEN 28@ += 32 // convert to lowercase
    END
    IF AND
    27@ >= 65 // From A
    27@ >= 90 // Till Z
    THEN 27@ += 32 // convert to lowercase
    END
    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
 

Attachments

  • Captcha.png
    Captcha.png
    20.4 KB · Views: 47

Cole_Sp

Member
Joined
Feb 13, 2022
Messages
20
Reaction score
2
Location
Maz
works completely ok but crashes my game after minutes.
can you fix it, please?
I'm using the 0.3.7 version.
@Parazitas


Code:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 30@ = 95 to 99
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 30@  _Returned: text 1@
        0AC8: 2@ = allocate_memory_size 260
        0AB1: @DeleteColorCodeFromText 4 text 1@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 2@
        0AC8: 3@ = allocate_memory_size 260
        0AD3: 3@ = "/signcheck"   // Check / find text
        if 
        0AB1: @IfTextContains 2 String1 2@ String2 3@ _returned: text 4@
        then
            0AC8: 6@ = allocate_memory_size 260
            0AB1: @get_digits_to_print param_count 2 text 2@ memory_to_store_digits_as_text 6@
            0AC8: 5@ = allocate_memory_size 260
            0AD3: 5@ "/signcheck %s" 6@   // CMD
            0AB1: @SEND_CMD 2 SampVersionID 0@ text 5@
            wait 10000 // anti spam
        end
    end
end

end

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:GetChatEntryText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 99  _Returned: text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN     
        0A8E: 3@ = 2@ + 0x21A0E4
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN     
        0A8E: 3@ = 2@ + 0x21A0EC
    END

    IF 0@ == 3 // 0.3.DL
    THEN     
        0A8E: 3@ = 2@ + 0x2ACA10
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN     
        0A8E: 3@ = 2@ + 0x26E8C8
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN     
        0A8E: 3@ = 2@ + 0x26E9F8
    END
    0A8D: 2@ readMem 3@ sz 4 vp 0
    2@ += 0x132
    1@ *= 0xFC
    005A: 2@ += 1@
    2@ += 0x20
    0AA3: 2@
END
0AB2: ret 1 2@

: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

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 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

: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

: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@

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN     
        0A8E: 3@ = 2@ + 0x65C60
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN     
        0A8E: 3@ = 2@ + 0x65D30
    END

    IF 0@ == 3 // 0.3.DL
    THEN     
        0A8E: 3@ = 2@ + 0x69340
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN     
        0A8E: 3@ = 2@ + 0x69190
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN     
        0A8E: 3@ = 2@ + 0x698C0
    END
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
works completely ok but crashes my game after minutes.
can you fix it, please?
I'm using the 0.3.7 version.
@Parazitas


Code:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 30@ = 95 to 99
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 30@  _Returned: text 1@
        0AC8: 2@ = allocate_memory_size 260
        0AB1: @DeleteColorCodeFromText 4 text 1@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 2@
        0AC8: 3@ = allocate_memory_size 260
        0AD3: 3@ = "/signcheck"   // Check / find text
        if
        0AB1: @IfTextContains 2 String1 2@ String2 3@ _returned: text 4@
        then
            0AC8: 6@ = allocate_memory_size 260
            0AB1: @get_digits_to_print param_count 2 text 2@ memory_to_store_digits_as_text 6@
            0AC8: 5@ = allocate_memory_size 260
            0AD3: 5@ "/signcheck %s" 6@   // CMD
            0AB1: @SEND_CMD 2 SampVersionID 0@ text 5@
            wait 10000 // anti spam
        end
    end
end

end

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:GetChatEntryText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 99  _Returned: text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN    
        0A8E: 3@ = 2@ + 0x21A0E4
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN    
        0A8E: 3@ = 2@ + 0x21A0EC
    END

    IF 0@ == 3 // 0.3.DL
    THEN    
        0A8E: 3@ = 2@ + 0x2ACA10
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN    
        0A8E: 3@ = 2@ + 0x26E8C8
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN    
        0A8E: 3@ = 2@ + 0x26E9F8
    END
    0A8D: 2@ readMem 3@ sz 4 vp 0
    2@ += 0x132
    1@ *= 0xFC
    005A: 2@ += 1@
    2@ += 0x20
    0AA3: 2@
END
0AB2: ret 1 2@

: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

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 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

: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

: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@

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN    
        0A8E: 3@ = 2@ + 0x65C60
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN    
        0A8E: 3@ = 2@ + 0x65D30
    END

    IF 0@ == 3 // 0.3.DL
    THEN    
        0A8E: 3@ = 2@ + 0x69340
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN    
        0A8E: 3@ = 2@ + 0x69190
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN    
        0A8E: 3@ = 2@ + 0x698C0
    END
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0
Sure when i get free time
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
works completely ok but crashes my game after minutes.
can you fix it, please?
I'm using the 0.3.7 version.
@Parazitas


Code:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @get_samp_version_id 0 _Returned: ID 0@
    for 30@ = 95 to 99
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 30@  _Returned: text 1@
        0AC8: 2@ = allocate_memory_size 260
        0AB1: @DeleteColorCodeFromText 4 text 1@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 2@
        0AC8: 3@ = allocate_memory_size 260
        0AD3: 3@ = "/signcheck"   // Check / find text
        if
        0AB1: @IfTextContains 2 String1 2@ String2 3@ _returned: text 4@
        then
            0AC8: 6@ = allocate_memory_size 260
            0AB1: @get_digits_to_print param_count 2 text 2@ memory_to_store_digits_as_text 6@
            0AC8: 5@ = allocate_memory_size 260
            0AD3: 5@ "/signcheck %s" 6@   // CMD
            0AB1: @SEND_CMD 2 SampVersionID 0@ text 5@
            wait 10000 // anti spam
        end
    end
end

end

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:GetChatEntryText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatEntryText 2 SampVersionID 0@ ChatLineID 99  _Returned: text 1@
}
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN    
        0A8E: 3@ = 2@ + 0x21A0E4
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN    
        0A8E: 3@ = 2@ + 0x21A0EC
    END

    IF 0@ == 3 // 0.3.DL
    THEN    
        0A8E: 3@ = 2@ + 0x2ACA10
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN    
        0A8E: 3@ = 2@ + 0x26E8C8
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN    
        0A8E: 3@ = 2@ + 0x26E9F8
    END
    0A8D: 2@ readMem 3@ sz 4 vp 0
    2@ += 0x132
    1@ *= 0xFC
    005A: 2@ += 1@
    2@ += 0x20
    0AA3: 2@
END
0AB2: ret 1 2@

: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

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 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

: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

: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@

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN    
        0A8E: 3@ = 2@ + 0x65C60
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN    
        0A8E: 3@ = 2@ + 0x65D30
    END

    IF 0@ == 3 // 0.3.DL
    THEN    
        0A8E: 3@ = 2@ + 0x69340
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN    
        0A8E: 3@ = 2@ + 0x69190
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN    
        0A8E: 3@ = 2@ + 0x698C0
    END
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0

Since i can't post code i going leave it in .txt file.
 

Attachments

  • S0urce.txt
    6.1 KB · Views: 21

Cole_Sp

Member
Joined
Feb 13, 2022
Messages
20
Reaction score
2
Location
Maz
Since i can't post code i going leave it in .txt file.
works but still makes me crash!
every 45 minutes after logging in to the game. that's the exact time.
really sorry if I bother you.
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
bro are you here?
PHP:
{$CLEO}
{$USE bitwise}
0000:

WHILE TRUE
WAIT 0

IF AND
0AB0:   key_pressed 18 {ALT}
0AB0:   key_pressed 49 {1}
THEN
    0B12: 30@ = 30@ XOR 1        
    IF 0039:   30@ == TRUE
    THEN 0AD1: show_formatted_text_highpriority "~w~Auto Signcheck ~g~Activated" time 1337
    ELSE 0AD1: show_formatted_text_highpriority "~w~Auto Signcheck ~r~Deactivated" time 137    
    END
    WAIT 137
END

IF 30@ == TRUE
THEN
    IF 0256:   player $PLAYER_CHAR defined
    THEN
        FOR 0@ = 95 to 99
            0AC8: 1@ = allocate_memory_size 1024
            0AC8: 2@ = allocate_memory_size 1024
            0AB1: @getChatString 2 SampVersionID 1 ChatID 0@ _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@    
            0AC8: 5@ = allocate_memory_size 1024
            0AB1: @DeleteColorCodeFromText 2 text 1@ memory_to_store_characters_as_text 5@
            0AC8: 6@ = allocate_memory_size 1024
            0AD3: 6@ = "/signcheck"
            IF 0AB1: @IfTextContains 2 String1 5@ String2 6@ _Returned: Text 7@
            THEN        
                0AC8: 8@ = allocate_memory_size 1024
                0AB1: @get_digits_to_print param_count 2 text 5@ memory_to_store_digits_as_text 8@               
                0AC8: 9@ = allocate_memory_size 1024
                0AD3: 9@ = "/signcheck %s" 8@
                0AD1: show_formatted_text_highpriority "~w~INFO: ~r~/signcheck %s" time 1337 8@ 
                0209: 10@ = random_int_in_ranges 1000 2000
                WAIT 10@
                0AB1: @ProcessChatInput 2 SampVersionID 1 InputText 9@
                0AC9: free_allocated_memory 9@
                WAIT 10000
                // Payday! Type '/signcheck 6284' to collect your paycheck!
            END
        END
    END
END

END
 
:getChatString
{
    0AC8: 1@ = allocate_memory_size 1024
    0AC8: 2@ = allocate_memory_size 1024
    0AB1: @getChatString 2 SampVersionID 0@ ChatID 99 _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 4 // 0.3.7 R3
        THEN 
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

:ProcessChatInput
{
    0AB1: @ProcessChatInput 2 SampVersionID 0@ InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN    
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 21@ = 20@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
           
            0A8E: 24@ = 20@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65D30 // PROCESS_INPUT  
        END
    
        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 21@ = 20@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
           
            0A8E: 24@ = 20@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x65E00 // PROCESS_INPUT 
        END
    
        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 21@ = 20@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
           
            0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT   
        END
    
        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 21@ = 20@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
           
            0A8E: 24@ = 20@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69260 // PROCESS_INPUT 
        END
    
        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
           
            0A8E: 24@ = 20@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x69990 // PROCESS_INPUT 
        END
        
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 21@ = 20@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
            0A8E: 26@ = 22@ + 0x8                 // pChatInput->pEditBox;
            0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
           
            0A8E: 24@ = 20@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 20@ + 0x699D0 // PROCESS_INPUT 
        END
        0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 1@ _retVal 6@
        0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
    END
END
0AB2: 0

:DeleteColorCodeFromText
{
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @DeleteColorCodeFromText 2 text 0@ memory_to_store_characters_as_text 1@
}
//*********************** Strlen *********************\\
0085: 27@ = 0@ // copy pointer
FOR 31@ = 0 TO 1024
    0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
    IF NOT 26@ == 0
    JF BREAK
    27@ += 1
END   
//****************************************************\\
5@ = FALSE // inbracket
    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 28@ == 123
        THEN 5@ = TRUE // inbracket begin
        END
       
        IF 5@ == FALSE // not inbracket
        THEN
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        END
       
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket end
        END
    END
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:IfTextContains
//0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
0AB1: @strlen 1 string 0@ _length 31@
0AB1: @strlen 1 string 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
// 0AB1: @strlen 1 string 1@ _return: size 3@
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@

: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
 

Attachments

  • Cole_Sp.cs
    32.7 KB · Views: 12
Top