Skip to content

Instantly share code, notes, and snippets.


Dhaval Kapil DhavalKapil

View GitHub Profile


ELF Header

The first portion of any ELF file is the ELF header. This generally provides offsets to other headers (program headers and section headers) within an ELF.

typedef struct {
  unsigned char e_ident[EI_NIDENT];
  uint16_t e_type;
View overlapping_chunks_smallbin.c
/* Similar to overlapping_chunks.c (from how2heap) with a small change.
* Instead of overwriting size of unsorted chunk, overwrite size of small chunk.
* Now you have to malloc the original size to retrieve this chunk
* Freeing again will now create an overlapped chunk in the unsorted bin which
* can later be retrieved using malloc(corrupt_size);
#include <stdio.h>
#include <stdlib.h>
View fastbin-loop.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main() {
uintptr_t *p1 = malloc(0);
uintptr_t *p2 = malloc(0);

Keybase proof

I hereby claim:

  • I am dhavalkapil on github.
  • I am dhavalkapil ( on keybase.
  • I have a public key ASC05olYuQRKfgaxTIZVm7Yinc4JjZ7j2e1D_D4WSvXngAo

To claim this, I am signing this object: