- 论坛徽章:
- 0
|
汇编
- .file "hack1.c"
- .text
- .globl lowercase
- .type lowercase, @function
- lowercase:
- pushl %ebp
- movl %esp, %ebp
- subl $16, %esp
- movl $0, -4(%ebp)
- movl 8(%ebp), %eax
- movl %eax, -8(%ebp)
- movl $0, -4(%ebp)
- jmp .L2
- .L3:
- movl -4(%ebp), %eax
- addl 8(%ebp), %eax
- movl -4(%ebp), %edx
- addl 8(%ebp), %edx
- movzbl (%edx), %edx
- addl $32, %edx
- movb %dl, (%eax)
- addl $1, -4(%ebp)
- .L2:
- movl -4(%ebp), %eax
- addl 8(%ebp), %eax
- movzbl (%eax), %eax
- testb %al, %al
- jne .L3
- movl -8(%ebp), %eax
- leave
- ret
- .size lowercase, .-lowercase
- .section .rodata
- .LC0:
- .string " HELlo WosLD "
- .align 4
- .LC1:
- .string "the string after lowercase:%s\n"
- .text
- .globl main
- .type main, @function
- main:
- pushl %ebp
- movl %esp, %ebp
- andl $-16, %esp
- subl $32, %esp
- movl $.LC0, 28(%esp)
- movl 28(%esp), %eax
- movl %eax, (%esp)
- call lowercase
- movl %eax, 28(%esp)
- movl $.LC1, %eax
- movl 28(%esp), %edx
- movl %edx, 4(%esp)
- movl %eax, (%esp)
- call printf
- leave
- ret
- .size main, .-main
- .ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3"
- .section .note.GNU-stack,"",@progbits
复制代码 你自己看吧
.L0就是你的字符串的地址
在只读段
我懒得看了,你自己看吧 |
|