Copy a string: Difference between revisions
Content added Content deleted
m (→UASM 2.54) |
m (→UASM 2.52) |
||
Line 2,325: | Line 2,325: | ||
jne _getsize ;; nope, jump back and check again |
jne _getsize ;; nope, jump back and check again |
||
mov tb, ecx ;; tb = Total bytes |
mov tb, ecx ;; tb = Total bytes, Keep a copy of the size of the string |
||
lea rsi, s ;; Copy the address of s into the source index(rsi) |
lea rsi, s ;; Copy the address of s into the source index(rsi) |
||
lea rdi, d ;; Copy the address of d into the destination index(rdi) |
lea rdi, d ;; Copy the address of d into the destination index(rdi) |
||
Line 2,333: | Line 2,333: | ||
mov dp, rax ;; Copy it from RAX to dp |
mov dp, rax ;; Copy it from RAX to dp |
||
mov rbx,rdi |
mov rbx,rdi ;; Make a copy of RDI, cause over writes due to ABI call args T_T |
||
invoke printf, CSTR("-> s (0x%x) = %s",10), rsi, addr s |
invoke printf, CSTR("-> s (0x%x) = %s",10), rsi, addr s |
||
invoke printf, CSTR("-> d (0x%x) = %s",10), rbx, addr d |
invoke printf, CSTR("-> d (0x%x) = %s",10), rbx, addr d |