Last active
July 4, 2019 07:03
-
-
Save kawakami-o3/ae0325c1d666b3b467cf0df988ec5750 to your computer and use it in GitHub Desktop.
print without libc
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
// Just an example. | |
#include<unistd.h> | |
int main() { | |
write(1, "hello\n", 6); | |
} |
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
.section .rodata | |
.LC0: | |
.string "hello\n" | |
.text | |
.globl main | |
.type main, @function | |
main: | |
.LFB0: | |
.cfi_startproc | |
pushq %rbp | |
.cfi_def_cfa_offset 16 | |
.cfi_offset 6, -16 | |
movq %rsp, %rbp | |
.cfi_def_cfa_register 6 | |
movl $6, %edx | |
movl $.LC0, %esi | |
movl $1, %edi | |
movl $1, %eax | |
syscall | |
movl $0, %eax | |
popq %rbp | |
.cfi_def_cfa 7, 8 | |
ret | |
.cfi_endproc |
Author
kawakami-o3
commented
Jul 4, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment