Last active
May 1, 2026 05:18
-
-
Save yellowbyte/d91da3c3b0bc3ee6d1d1ac5327b1b4b2 to your computer and use it in GitHub Desktop.
Revisions
-
yellowbyte revised this gist
May 30, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -100,7 +100,6 @@ global _start %macro call_func 1 call %1 %endmacro _start: -
yellowbyte revised this gist
Jan 18, 2019 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -65,14 +65,14 @@ template code (hello world): extern puts extern exit section .text global _start %macro call_func 1 call %1 add esp, 0x4 %endmacro _start: push hello call_func puts @@ -95,14 +95,14 @@ template code (hello world): extern puts extern exit section .text global _start %macro call_func 1 call %1 add rsp, 0x8 %endmacro _start: mov rdi, hello call_func puts -
yellowbyte revised this gist
Jan 18, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -118,4 +118,6 @@ __NOTE__ : * Assembler Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA * extern: declare a symbol which is defined in another module that will later be linked with current one * section: identifies the section the code you write will go into. Examples of common ones are .text, .data, and .bss * global: defines symbols such that other modules that EXTERN those symbols can correctly reference them after linking * macro: a name that represents a snippet of code * define: a single-line macro -
yellowbyte revised this gist
Jan 18, 2019 . 1 changed file with 16 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,16 +9,18 @@ template code (hello world): section .text global _start %define system_call int 0x80 _start: mov ebx, 0x1 mov ecx, hello mov edx, helloLen mov eax, 0x4 system_call xor ebx, ebx mov eax, 0x1 system_call section .data hello db "Hello World", 0xa @@ -63,13 +65,17 @@ template code (hello world): extern puts extern exit %macro call_func 1 call %1 add esp, 0x4 %endmacro section .text global _start _start: push hello call_func puts mov eax, 0xa call exit @@ -89,13 +95,17 @@ template code (hello world): extern puts extern exit %macro call_func 1 call %1 add rsp, 0x8 %endmacro section .text global _start _start: mov rdi, hello call_func puts mov rax, 0xa call exit -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -103,9 +103,7 @@ _start: section .data hello db "Hello World" ``` --- __NOTE__ : * Assembler Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA * extern: declare a symbol which is defined in another module that will later be linked with current one -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -103,10 +103,10 @@ _start: section .data hello db "Hello World" ``` <br /> __NOTE__ : * Assembler Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA * extern: declare a symbol which is defined in another module that will later be linked with current one * section: identifies the section the code you write will go into. Examples of common ones are .text, .data, and .bss -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -104,6 +104,7 @@ section .data hello db "Hello World" ``` <br /> __NOTE__ : * Assembler Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -104,9 +104,9 @@ section .data hello db "Hello World" ``` <br /> __NOTE__ : * Assembler Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA * extern: declare a symbol which is defined in another module that will later be linked with current one * section: identifies the section the code you write will go into. Examples of common ones are .text, .data, and .bss * global: defines symbols such that other modules that EXTERN those symbols can correctly reference them after linking -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -105,7 +105,8 @@ section .data ``` <br /> __NOTE__: * Assembler Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA * extern: declare a symbol which is defined in another module that will later be linked with current one * section: identifies the section the code you write will go into. Examples of common ones are .text, .data, and .bss * global: defines symbols such that other modules that EXTERN those symbols can correctly reference them after linking -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -105,7 +105,7 @@ section .data ``` <br /> __NOTE__: * Assembler Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA * extern: declare a symbol which is defined in another module that will later be linked with current one * section: identifies the section the code you write will go into. Examples of common ones are .text, .data, and .bss * global: defines symbols such that other modules that EXTERN those symbols can correctly reference them after linking -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -102,4 +102,10 @@ _start: section .data hello db "Hello World" ``` <br /> __NOTE__: * Assembly Directives: instructions for the assembler (e.g. NASM) and not a part of the ISA * extern: declare a symbol which is defined in another module that will later be linked with current one * section: identifies the section the code you write will go into. Examples of common ones are .text, .data, and .bss * global: defines symbols such that other modules that EXTERN those symbols can correctly reference them after linking -
yellowbyte revised this gist
Jan 16, 2019 . 1 changed file with 26 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -74,6 +74,32 @@ _start: mov eax, 0xa call exit section .data hello db "Hello World" ``` ### 64-bit ELF binary with libc how to assemble and link: ```bash nasm -f elf64 -o <filename>.o <filename>.asm ld -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o <filename> -lc <filename>.o ``` template code (hello world): ```assembly extern puts extern exit section .text global _start _start: mov rdi, hello call puts add rsp, 0x8 mov rax, 0xa call exit section .data hello db "Hello World" ``` -
yellowbyte revised this gist
Mar 3, 2018 . No changes.There are no files selected for viewing
-
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ### 32-bit ELF binary how to assemble and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ### 32-bit ELF binary how to assemble — and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ### 32-bit ELF binary how to assemble &mdash and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ### 32-bit ELF binary how to assemble -- and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ### 32-bit ELF binary how to assemble - and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ### 32-bit ELF binary how to assemble and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm @@ -25,7 +25,7 @@ section .data helloLen equ $-hello ``` ### 64-bit ELF binary how to assemble and link: ```bash nasm -f elf64 -o <filename>.o <filename>.asm @@ -52,7 +52,7 @@ section .data helloLen equ $-hello ``` ### 32-bit ELF binary with libc how to assemble and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm -
yellowbyte revised this gist
Feb 17, 2018 . No changes.There are no files selected for viewing
-
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 20 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ## 32-bit ELF binary how to assemble and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o @@ -25,10 +25,14 @@ section .data helloLen equ $-hello ``` ## 64-bit ELF binary how to assemble and link: ```bash nasm -f elf64 -o <filename>.o <filename>.asm ld -o <filename> <filename>.o ``` template code (hello world): ```assembly section .text global _start @@ -46,11 +50,16 @@ _start: section .data hello db "Hello World", 0xa helloLen equ $-hello ``` ## 32-bit ELF binary with libc how to assemble and link: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o <filename> -lc <filename>.o ``` template code (hello world): ```assembly extern puts extern exit @@ -67,3 +76,4 @@ _start: section .data hello db "Hello World" ``` -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## 32-bit ELF binary how to compile: ```bash nasm -f elf32 -o <filename>.o <filename>.asm -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ ### 32-bit ELF binary how to compile: ```bash nasm -f elf32 -o <filename>.o <filename>.asm -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ ### how to compile assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc #### 32-bit ELF binary how to compile: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o ``` template code (hello world): ```assembly section .text global _start -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,8 @@ how to compile: nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o ``` template code (hello world) ```assembly section .text global _start @@ -24,6 +25,7 @@ _start: section .data hello db "Hello World", 0xa helloLen equ $-hello ``` ##### 64-bit ELF binary ; nasm -f elf64 -o <filename>.o <filename>.asm -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #### how to compile assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc ##### 32-bit ELF binary how to compile: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #### how to compile assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc ##### 32-bit ELF binary * how to compile: ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,10 @@ #### how to compile assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc ##### 32-bit ELF binary ```bash nasm -f elf32 -o <filename>.o <filename>.asm ld -m elf_i386 -o <filename> <filename>.o ``` ; template code: hello world section .text global _start -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ section .data hello db "Hello World", 0xa helloLen equ $-hello ##### 64-bit ELF binary ; nasm -f elf64 -o <filename>.o <filename>.asm ; ld -o <filename> <filename>.o ; template code: hello world @@ -44,7 +44,7 @@ section .data hello db "Hello World", 0xa helloLen equ $-hello ##### 32-bit ELF binary with libc ; nasm -f elf32 -o <filename>.o <filename>.asm ; ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o <filename> -lc <filename>.o ; template code: hello world -
yellowbyte revised this gist
Feb 17, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #### how to compile assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc ##### 32-bit ELF binary ; nasm -f elf32 -o <filename>.o <filename>.asm ; ld -m elf_i386 -o <filename> <filename>.o ; template code: hello world
NewerOlder