Skip to content

Instantly share code, notes, and snippets.

@mitake
mitake / CMakeLists.txt
Created March 6, 2013 14:09
sample of DynamoRIO client
cmake_minimum_required(VERSION 2.8)
SET(DynamoRIO_DIR "/home/mitake/dynamorio/exports/cmake")
find_package(DynamoRIO)
add_library(sample SHARED sample.c)
configure_DynamoRIO_client(sample)
@mfukar
mfukar / inspector_malloc.gdb
Last active May 9, 2023 11:04
gdb functions to dump glibc malloc arenas + chunks
define -mem-heap-dump-chunk
printf "%#016x: ", $mem_addr
printf "%016lu %016lu %#02x ", ((long *)$mem_addr)[0], ((long *)$mem_addr)[1] & ~3, ((long*)$mem_addr)[1] & 3
printf "%016x %016x\n", ((long *)$mem_addr)[2], ((long *)$mem_addr)[3]
set $mem_addr = $mem_addr + ((long *)$mem_addr)[1] & ~3
end
document -mem-heap-dump-chunk
!!! FOR INTERNAL USE ONLY - DO NOT CALL !!!
end