I've figured out half the inventory format. I can edit quantities, but not item id's.
Items are stored in groups of 4 over 13 bytes. The quantity for each item is stored in 7 scrambled bits. The bits look like:
xxxx xxxx xxxx xxxx a6a5a4a3 a2a1a0x xxxx xxxx xxxx xxxx b4b3b2b1 b0xxx xxxx...