Giter Club home page Giter Club logo

libasm's Introduction

LibASM

Notes

rsp --> adress of the top of the stack [addr] --> ptr, not value push reg --> push reg value on the top of the stack pop reg --> pop value out of the stack in reg mov reg, [rsp] --> copy top value of the stack in reg

var db byte,byte,"ascii string",byte

Registers sizes : (last bits)

  • 64bits --> rax
  • 32bits --> eax
  • 16bits --> ax
  • 8bits --> al

Syscall --> call function from kernel (OS) Syscall ID: rax Arg1: rdi Arg2: rsi Arg3: rdx Arg4: r10 Arg5: r8 Arg6: r9 Return value: eax

Syscall IDs examples: 0 --> read 1 --> write 2 --> open 3 --> close

Flags --> single bit register CF, PF, ZF, SF... 8 flags --> one 'flags' register

RIP register --> contains the next instruction adress, auto increments after each instruction

CMP compares multiple variables, stores the result in flags

jmp --> set RIP to the adress of given label je --> jumps if equals jne --> jumps if not equals jg --> jumps if greater than jge --> jumps if greater and equals to jl --> jumps if smaller than jle --> jumps if smaller or equels to jz --> jumps if equals 0

Exemple of conditional jump : cmp rax,23 je doThis

subroutine --> function _start: call _function

_function: mov rax,23 ret

ret = return, goes back to the call adress

Debug

lldb

run --> run the program register read --> print all registers kill --> kill current thread memory read -c --> read bytes from address

Resources

libasm's People

Contributors

t0mm4rx avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.