CLEO SNIPPET [Snippet] Remove last character string

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
713
Likes
22
Points
48
#2
RE: [Snippet] Remove last string

mom im famous
That "snippet" removes last character in the string
 
OP
OP
Ninja FTW

Ninja FTW

Well-Known Member
Joined
Aug 11, 2017
Messages
61
Likes
0
Points
6
Location
Saturn
5
#3
RE: [Snippet] Remove last string

supahdupahnubah said:
mom im famous
That "snippet" removes last character in the string
Lol. That might come in handy for newbie. Actually i also wasn't know how to dot that.
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
713
Likes
22
Points
48
#4
RE: [Snippet] Remove last string

Ninja FTW said:
Lol. That might come in handy for newbie. Actually i also wasn't know how to dot that.
Nah, I mean, the title is misleading
 

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
1,409
Likes
153
Points
78
Location
Lithuania
Website
ugbase.eu
15
#5
100 % working without SAMPFUNCS
PHP:
:DeleteLastChars
{
    0AB1: @delete_last_chars_from_string 2 [email protected] 2
}
var
[email protected]: int
[email protected]: int
[email protected]: int
end

0AB1: @strlen 1 string [email protected] rtn [email protected]
[email protected] -= [email protected]
[email protected] += [email protected]
0AB1: @memset 3 destination [email protected] value 0 size [email protected]
0AB2: ret 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]

:memset

var
[email protected] : integer
[email protected] : integer
[email protected] : integer
[email protected] : integer
end

// [email protected] - destination, [email protected] - value, [email protected] - size
// Example: 0AB1: @memset 3 destination [email protected] value 32 size 1
[email protected] -= 1
for [email protected] = 0 to [email protected]
0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect 0
[email protected] += 1
end

0AB2: ret 0
 
Last edited:
Top