Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sethhall
Created December 6, 2012 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethhall/4221576 to your computer and use it in GitHub Desktop.
Save sethhall/4221576 to your computer and use it in GitHub Desktop.
MS Cert Store parser
module MSCerts;
%byteorder=BinPAC::ByteOrder::Little;
type SerializedPropertyEntry = unit {
id : uint32;
encodingType : uint32;
len : uint32;
value : bytes &length=self.len;
};
type SerializedCertificateEntry = unit {
id : uint32(0x00000020);
encodingType : uint32;
len : uint32;
certificate : bytes &length=self.len;
};
type CertStoreCertificateGroup = unit {
# This list is terminated by a look ahead to the SerializedCertificateEntry.id field.
elementList : list<SerializedPropertyEntry>;
certificateElement : SerializedCertificateEntry;
};
type EndElementMarkerEntry = unit {
id : uint32(0x00000000);
marker : bytes &length=8;
};
export type DocSigSerializedCertStore = unit {
version : uint32;
fileType : uint32;
# This list is terminated by a look ahead to the EndElementMarkerEntry.id field.
certificateList : list<CertStoreCertificateGroup>;
endMarkerElement : EndElementMarkerEntry;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment