Created
October 26, 2016 15:26
-
-
Save UsmanNadeem/26c38edea6a28eb510740ec56c0ce68f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <string.h> | |
| int main(int argc, char* argv[]) { | |
| char* ch = "abc"; | |
| int x = strcmp("t", ch); | |
| return x; | |
| } | |
| // Main 0x560 - 0x526 | |
| // Size 3a | |
| Disassembly of section .plt: | |
| . | |
| . | |
| . | |
| 0000000000400410 <strcmp@plt> (File Offset: 0x410): | |
| 400410: jmpq *0x200c0a(%rip) # 601020 <_GLOBAL_OFFSET_TABLE_+0x20> (File Offset: 0x201020) | |
| 400416: pushq $0x1 | |
| 40041b: jmpq 4003f0 <_init+0x28> (File Offset: 0x3f0) | |
| Disassembly of section .plt.got: | |
| 0000000000400420 <.plt.got> (File Offset: 0x420): | |
| 400420: jmpq *0x200bd2(%rip) # 600ff8 <_DYNAMIC+0x1d0> (File Offset: 0x200ff8) | |
| 400426: xchg %ax,%ax | |
| 0000000000400526 <main> (File Offset: 0x526): | |
| #include <string.h> | |
| int main(int argc, char* argv[]) { | |
| 400526: push %rbp | |
| 400527: mov %rsp,%rbp | |
| 40052a: sub $0x20,%rsp | |
| 40052e: mov %edi,-0x14(%rbp) | |
| 400531: mov %rsi,-0x20(%rbp) | |
| char* ch = "abc"; | |
| 400535: movq $0x4005e4,-0x8(%rbp) | |
| int x = strcmp("t", ch); | |
| 40053d: mov -0x8(%rbp),%rax | |
| 400541: mov %rax,%rsi | |
| 400544: mov $0x4005e8,%edi | |
| 400549: callq 400410 <strcmp@plt> (File Offset: 0x410) | |
| 40054e: mov %eax,-0xc(%rbp) | |
| return x; | |
| 400551: mov -0xc(%rbp),%eax | |
| } | |
| 400554: leaveq | |
| 400555: retq | |
| 400556: nopw %cs:0x0(%rax,%rax,1) | |
| Disassembly of section .got: | |
| 0000000000600ff8 <.got> (File Offset: 0xff8): | |
| ... | |
| Disassembly of section .got.plt: | |
| 0000000000601000 <_GLOBAL_OFFSET_TABLE_> (File Offset: 0x1000): | |
| 601000: sub %cl,(%rsi) | |
| 601002: (bad) | |
| ... (skipping 20 zeroes, resuming at file offset: 0x1017) | |
| 601017: add %al,(%rsi) | |
| 601019: add $0x40,%al | |
| 60101b: add %al,(%rax) | |
| 60101d: add %al,(%rax) | |
| 60101f: add %dl,(%rsi) | |
| 601021: add $0x40,%al | |
| 601023: add %al,(%rax) | |
| 601025: add %al,(%rax) | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment