-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/sdasgup3/binary-decompilation/issues/77
- Loading branch information
Showing
23 changed files
with
3,505 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,7 @@ | ||
strchr: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
movq %rdi, -8(%rbp) | ||
movl %esi, -12(%rbp) | ||
nop | ||
movq -8(%rbp), %rax | ||
movzbl (%rax), %edx | ||
movl -12(%rbp), %eax | ||
cmpb %al, %dl | ||
je L6 | ||
movq -8(%rbp), %rax | ||
leaq 1(%rax), %rdx | ||
movq %rdx, -8(%rbp) | ||
movzbl (%rax), %eax | ||
testb %al, %al | ||
jne L3 | ||
movl $0, %eax | ||
jmp L1 | ||
L3: | ||
movq -8(%rbp), %rax | ||
jmp L1 | ||
L6: | ||
L1: | ||
popq %rbp | ||
ret | ||
strlen: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
movq %rdi, -24(%rbp) | ||
movq $0, -8(%rbp) | ||
jmp L8 | ||
L9: | ||
addq $1, -8(%rbp) | ||
L8: | ||
movq -24(%rbp), %rdx | ||
movq -8(%rbp), %rax | ||
addq %rdx, %rax | ||
movzbl (%rax), %eax | ||
testb %al, %al | ||
jne L9 | ||
movq -8(%rbp), %rax | ||
popq %rbp | ||
ret | ||
strcpy: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
movq %rdi, -24(%rbp) | ||
movq %rsi, -32(%rbp) | ||
movq -24(%rbp), %rax | ||
movq %rax, -8(%rbp) | ||
nop | ||
L12: | ||
movq -24(%rbp), %rax | ||
leaq 1(%rax), %rdx | ||
movq %rdx, -24(%rbp) | ||
movq -32(%rbp), %rdx | ||
leaq 1(%rdx), %rcx | ||
movq %rcx, -32(%rbp) | ||
movzbl (%rdx), %edx | ||
movb %dl, (%rax) | ||
movzbl (%rax), %eax | ||
testb %al, %al | ||
jne L12 | ||
movq -8(%rbp), %rax | ||
popq %rbp | ||
ret | ||
exit: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
movl %edi, -4(%rbp) | ||
movq $-1, %rax | ||
jmp %rax | ||
popq %rbp | ||
ret | ||
abort: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
movq $-1, %rax | ||
jmp %rax | ||
popq %rbp | ||
ret | ||
memset: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
movq %rdi, -24(%rbp) | ||
movl %esi, -28(%rbp) | ||
movq %rdx, -40(%rbp) | ||
movq -24(%rbp), %rax | ||
movq %rax, -8(%rbp) | ||
jmp L17 | ||
L18: | ||
movq -8(%rbp), %rax | ||
leaq 1(%rax), %rdx | ||
movq %rdx, -8(%rbp) | ||
movl -28(%rbp), %edx | ||
movb %dl, (%rax) | ||
L17: | ||
movq -40(%rbp), %rax | ||
leaq -1(%rax), %rdx | ||
movq %rdx, -40(%rbp) | ||
testq %rax, %rax | ||
jne L18 | ||
movq -24(%rbp), %rax | ||
popq %rbp | ||
ret | ||
.comm y,2112,64 | ||
.globl _start | ||
_start: | ||
pushq %rbp | ||
movq %rsp, %rbp | ||
subq $528, %rsp | ||
call abort | ||
movl $0, %edi | ||
call exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.