Refactor
I don't know C so I can't really comment, the one thing I did notice when scrolling through was hand-aligned decimal literals which could be tab-aligned hex.
If you're going to do this, remember that it has to work on Windows too, so don't add any dependencies.