Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- globl old_memcpy
- .type old_memcpy, @function
- old_memcpy:
- pushl %ebp
- movl %esp, %ebp
- subl $20, %esp
- movl 12(%ebp), %eax
- movl %eax, -4(%ebp)
- movl 8(%ebp), %eax
- movl %eax, -8(%ebp)
- jmp .L2
- .L3:
- movl -4(%ebp), %eax
- movzbl (%eax), %edx
- movl -8(%ebp), %eax
- movb %dl, (%eax)
- addl $1, -8(%ebp)
- addl $1, -4(%ebp)
- subl $1, 16(%ebp)
- .L2:
- cmpl $0, 16(%ebp)
- jne .L3
- leave
- ret
- .size old_memcpy, .-old_memcpy
- ## memcopy
- .globl memcpy
- .type memcpy, @function
- memcpy:
- pushl %ebp
- movl %esp, %ebp
- subl $32, %esp
- movl 8(%ebp), %eax
- movl %eax, -4(%ebp)
- movl 12(%ebp), %eax
- movl %eax, -8(%ebp)
- movl 16(%ebp), %eax
- shrl $2, %eax
- movl %eax, -12(%ebp)
- andl $3, 16(%ebp)
- jmp .L6
- .L7:
- movl -8(%ebp), %eax
- movl (%eax), %edx
- movl -4(%ebp), %eax
- movl %edx, (%eax)
- addl $4, -4(%ebp)
- addl $4, -8(%ebp)
- subl $1, -12(%ebp)
- .L6:
- cmpl $0, -12(%ebp)
- jne .L7
- movl -8(%ebp), %eax
- movl %eax, -16(%ebp)
- movl -4(%ebp), %eax
- movl %eax, -20(%ebp)
- jmp .L8
- .L9:
- movl -16(%ebp), %eax
- movzbl (%eax), %edx
- movl -20(%ebp), %eax
- movb %dl, (%eax)
- addl $1, -20(%ebp)
- addl $1, -16(%ebp)
- subl $1, 16(%ebp)
- .L8:
- cmpl $0, 16(%ebp)
- jne .L9
- movl 8(%ebp), %eax
- leave
- ret
- .size memcpy, .-memcpy
- .globl memset
- .type memset, @function
Add Comment
Please, Sign In to add comment