zombie-lib/strcmp.asm

51 lines
622 B
NASM
Raw Normal View History

2021-09-27 16:40:27 -04:00
global libz_strcmp
2021-09-26 17:30:13 -04:00
section .text
2021-09-27 16:40:27 -04:00
libz_strcmp:
2021-09-26 17:30:13 -04:00
sub rsp, 8 ;enter
xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before)
2021-09-26 20:58:38 -04:00
mov r8, rdi ;dupe them
mov r9, rsi
2021-09-26 17:30:13 -04:00
_loopwasp12bsharknado:
;loop tings
2021-09-26 20:58:38 -04:00
mov rdi, r8
mov rsi, r9
2021-09-26 17:30:13 -04:00
add rdi, rcx
add rsi, rcx
mov r10b, [rdi]
mov r11b, [rsi]
cmp r10b, r11b
jne _differiwikeassembwy
cmp r10b, 0
je _notdifferiwikeassembwy
cmp r11b, 0
je _notdifferiwikeassembwy
inc rcx
jmp _loopwasp12bsharknado
_differiwikeassembwy:
mov rax, 1
jmp _end123432345
_notdifferiwikeassembwy:
mov rax, 0
_end123432345:
add rsp, 8 ;exit
ret