Skip to content

Instantly share code, notes, and snippets.

@richardlehane
Created August 11, 2017 01:49
Show Gist options
  • Save richardlehane/1d65bc106177b71b08b13e58ba97c5a5 to your computer and use it in GitHub Desktop.
Save richardlehane/1d65bc106177b71b08b13e58ba97c5a5 to your computer and use it in GitHub Desktop.
// parse FcCompressed (section 2.9.73)
func parseFcCompressed(fcData []byte) *fcCompressed {
fCompressed := fcData[3]&64 == 64 // check fcompressed value (second bit from lestmost of the last byte in fcdata)
fcData[3] = fcData[3] & 63 // clear the fcompressed value from data
fc := binary.LittleEndian.Uint32(fcData) // word doc generally uses little endian order (1.3.7)
return &fcCompressed{fc: int(fc), fCompressed: fCompressed}
}
@Naltharial
Copy link

Naltharial commented Jun 25, 2019

Actually found someone else manually parsing .doc files. Thanks for confirming it's &64 == 64 for fCompressed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment