Code:
0C17: 1@ = strlen 0@
1@ -= 1
0C24: strncpy destination 0@ source 0@ size 1@
All credits to him.
0C17: 1@ = strlen 0@
1@ -= 1
0C24: strncpy destination 0@ source 0@ size 1@
supahdupahnubah said:mom im famous
That "snippet" removes last character in the string
Ninja FTW said:Lol. That might come in handy for newbie. Actually i also wasn't know how to dot that.
:DeleteLastChars
{
0AB1: @delete_last_chars_from_string 2 6@ 2
}
var
0@: int
1@: int
2@: int
end
0AB1: @strlen 1 string 0@ rtn 2@
2@ -= 1@
0@ += 2@
0AB1: @memset 3 destination 0@ value 0 size 1@
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@
:memset
var
0@ : integer
1@ : integer
2@ : integer
3@ : integer
end
// 0@ - destination, 1@ - value, 2@ - size
// Example: 0AB1: @memset 3 destination 0@ value 32 size 1
2@ -= 1
for 3@ = 0 to 2@
0A8C: write_memory 0@ size 1 value 1@ virtual_protect 0
0@ += 1
end
0AB2: ret 0