title: Reverse engineering war stories
body: <p>Sometimes you don't have the source code and need to reverse engineer a program or a black box.  Any fun war stories?</p>
  
  <p>Here's one of mine:</p>
  
  <p>Some years ago I needed to rewrite a device driver for which I didn't have source code.  The device driver ran on an old CP/M microcomputer and drove a dedicated phototypesetting machine through a serial port.  Almost no documentation for the phototypesetting machine was available to me.</p>
  
  <p>I finally hacked together a serial port monitor on a DOS PC that mimicked the responses of the phototypesetting machine.  I cabled the DOS PC to the CP/M machine and started logging the data coming out of the device driver as I feed data in through the CP/M machine.  This enabled me to figure out the handshaking and encoding used by the device driver and re-create an equivalent one for a DOS machine.</p>