CLEO Help Substring

CLEO related
Status
Not open for further replies.

Kelsi235

Active member
Joined
Jun 2, 2019
Messages
53
Reaction score
4
string f
I
I
V
bla bla bla: 8981249812498 is big gay


f.substring(13, 13) = 8981249812498

how would I do this ?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,133
Solutions
5
Reaction score
885
Location
Lithuania
If you wanna get only digits.:
PHP:
:get_digits_to_print
{
    Example:
    0AC8: 1@ = allocate_memory_size 260 // Alloc mem to get digits
    0AB1: call_scm_func @get_digits_to_print param_count 2 TextPointer 0@ memory_to_store_digits_as_text 1@
    0@ = text
    1@ = pointer to memory where digits will be stored as text
}
0C17: 31@ = strlen 0@
    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
 
Status
Not open for further replies.
Top