Skip to content

Instantly share code, notes, and snippets.

View basavesh's full-sized avatar
👨‍💻

Basavesh Ammanaghatta Shivakumar basavesh

👨‍💻
View GitHub Profile
@basavesh
basavesh / memory_layout.md
Created January 13, 2018 23:39 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@basavesh
basavesh / x86-assembly-notes.md
Created April 22, 2024 21:15 — forked from mikesmullin/x86-assembly-notes.md
Notes on x86-64 Assembly and Machine Code

Mike's x86-64 Assembly (ASM) Notes

Assembling Binary Machine Code

Operating Modes:

These determine the assumed/default size of instruction operands, and restricts which opcodes are available, and how they are used.

Modern operating systems, booted inside Real mode,

// demo_new_delete.cpp
#include <cstddef>
#include <new>
struct Base {
Base();
virtual ~Base(); // virtual => emits D0, D1, D2
static void* operator new(std::size_t);
static void operator delete(void*) noexcept;
};