Decent into Darkness: Understanding Your System's Binary Interface...
summary
A memory profiler that actually rewrites the running VM to catch allocations and frees, implemented as the memprof gem that hooks rb_newobj via rewrites call displacements and PLT/GOT entries, inserts assembly stubs that align the stack and call a C handler, and even patches inlined free updates by replacing moves with jumps plus no-ops. It produces per-file/line object counts, emits heap JSON for a web UI at memproff.com, requires unstripped MRI 1.8 binaries or debug packages and works on 64-bit Linux and Snow Leopard.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:27About Joe Damato
- 1:44The problem
- 3:38Problem Requirements
- 4:42WTF is an ABI?
- 5:49Evil Devices
- 7:44%rax uncensored
- 8:26Some amd64 asm notes
- 9:01Moving stuff
- 9:37Calling functions
- 12:39ELF Objects
- 13:20Sections that matter to memprof
- 14:04The ingredients for evil
- 14:58Hook rb_newobj
- 16:33Doesn't work for all
- 16:54How the plt works
- 20:15Hook add_freelist
- 21:39Isn't ready? What?
- 23:21assembly stub
- 24:28Sample Output
- 25:44Middleware • Use memprof as middleware • Get per-request object count information
- 26:34memprof limitations
- 27:21More evil is brewing
- 27:45Use RVM.
- 28:00Get memprof








