Extract a DMG file.
undmg ./Sublime\ Text\ Build\ 3103.dmg
This requires zlib, bzip2, lzfse, lzma, glibc, a linker, and a c compiler to build.
git clone https://github.com/matthewbauer/undmg.git
cd undmg
make
make install
Apple has never released official specs for the DMG file format. Most of it has been reverse engineered. The best source of documentation is at newosxbook.com and the wikipedia page. However, there are some DMG files that won't work correctly with this tool.
GPL3, most of this code is from the xpwn project.