Use ms-files logic for generating headers and reading file. See #921