Skip to content

My fellows, play on playground so that you learn better at assembly!

Notifications You must be signed in to change notification settings

ThinerDAS/asm-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Yellow Playground

Hello, fellows!

I hope that a linux assembly playground will be very helpful for you.

Make sure you have gef installed in your gdb, along with its suggested libraries, in specific "keystone".

Clone the repo:

git clone https://github.com/ThinerDAS/asm-playground.git
cd asm-playground

Then, type in shell:

gcc main.c -o main

and use gdb to open it:

gdb main

and inside gdb, type:

source play.py
play

Homework:

  • Try out normal instructions like mov, add, etc. You will need to become familiar with some debugging commands in gdb, including stepi (si), continue (c), break (b), etc.
  • Try out instructions related to stack and rip, like push, pop, jmp, call, ret, leave, etc.
  • Try a C function call. Find out the address of printf and call printf("Hello, %dth challenger!\n", 100);. Find the address of malloc, allocate a memory, malloc(0x100);, with assembly and put the memory address to rdi.
  • Try a syscall. Do sys_read(0, rsp, 100) to populate the stack, and sys_execve(rsp, 0, 0) to execute your program.
  • Reread the programs we have compiled using gcc up to this time, and compile some more programs. Point out the calling convention inside the assembly.

About

My fellows, play on playground so that you learn better at assembly!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published