daily pastebin goal
29%
SHARE
TWEET

Replace all

almdudler Jan 20th, 2019 (edited) 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; rdi - buffer, rsi - string, rdx - symbol to replace, rcx - replacement
  2. replace_all:
  3. xor r9, r9
  4. _loop:
  5. mov al, byte[rsi + r9]
  6. cmp al, dl
  7. jne no_rep
  8. mov [rdi+r9], cl
  9. jmp continue
  10. no_rep:
  11. mov [rdi+r9], al
  12. continue:
  13. inc r9
  14. cmp al, 0
  15. je replace_all_exit
  16. jmp _loop
  17.  
  18. replace_all_exit:
  19. mov rax, rdi
  20. ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top