Look at common/patches/Client62.cpp and common/patches/Titanium.cpp at function char *SerializeItem(const ItemInst *inst, sint16 slot_id, uint32 *length, uint8 depth).
There is an article in the Wiki that describes serialization as well.
Edit: Wiki article:
http://www.eqemulator.net/wiki/wikka...=ItemStructure