Some old code written when trying to reverse-engineer/decode
XCom-Apoc files.

Someone may find it useful...