Skip to content

Instantly share code, notes, and snippets.

View snail5008's full-sized avatar
:octocat:

snail5008

:octocat:
View GitHub Profile
@snail5008
snail5008 / main.s
Created April 7, 2022 02:16
A 'Hello World' program in GAS for linux x86_64
.global _start
.section .data
message: .ascii "Hello, World!\n"
len = . - message
.section .text
_start:
movq $1, %rax # sys_write
movq $1, %rdi # stdout

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main