msoffcrypto.method.container package

Submodules

msoffcrypto.method.container.ecma376_encrypted module

class msoffcrypto.method.container.ecma376_encrypted.DSPos[source]

Bases: object

dirNum = 11
iDataSpaceInfo = 5
iDataSpaceMap = 4
iDataSpaces = 2
iEncryptionInfo = 10
iEncryptionPackage = 1
iPrimary = 9
iRoot = 0
iStongEncryptionDataSpace = 6
iStrongEncryptionTransform = 8
iTransformInfo = 7
iVersion = 3
class msoffcrypto.method.container.ecma376_encrypted.DefaultContent[source]

Bases: object

DataSpaceMap = b'\x08\x00\x00\x00\x01\x00\x00\x00h\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00E\x00n\x00c\x00r\x00y\x00p\x00t\x00e\x00d\x00P\x00a\x00c\x00k\x00a\x00g\x00e\x002\x00\x00\x00S\x00t\x00r\x00o\x00n\x00g\x00E\x00n\x00c\x00r\x00y\x00p\x00t\x00i\x00o\x00n\x00D\x00a\x00t\x00a\x00S\x00p\x00a\x00c\x00e\x00\x00\x00'
Primary = b'X\x00\x00\x00\x01\x00\x00\x00L\x00\x00\x00{\x00F\x00F\x009\x00A\x003\x00F\x000\x003\x00-\x005\x006\x00E\x00F\x00-\x004\x006\x001\x003\x00-\x00B\x00D\x00D\x005\x00-\x005\x00A\x004\x001\x00C\x001\x00D\x000\x007\x002\x004\x006\x00}\x00N\x00\x00\x00M\x00i\x00c\x00r\x00o\x00s\x00o\x00f\x00t\x00.\x00C\x00o\x00n\x00t\x00a\x00i\x00n\x00e\x00r\x00.\x00E\x00n\x00c\x00r\x00y\x00p\x00t\x00i\x00o\x00n\x00T\x00r\x00a\x00n\x00s\x00f\x00o\x00r\x00m\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00'
StrongEncryptionDataSpace = b'\x08\x00\x00\x00\x01\x00\x00\x002\x00\x00\x00S\x00t\x00r\x00o\x00n\x00g\x00E\x00n\x00c\x00r\x00y\x00p\x00t\x00i\x00o\x00n\x00T\x00r\x00a\x00n\x00s\x00f\x00o\x00r\x00m\x00\x00\x00'
Version = b'<\x00\x00\x00M\x00i\x00c\x00r\x00o\x00s\x00o\x00f\x00t\x00.\x00C\x00o\x00n\x00t\x00a\x00i\x00n\x00e\x00r\x00.\x00D\x00a\x00t\x00a\x00S\x00p\x00a\x00c\x00e\x00s\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00'
class msoffcrypto.method.container.ecma376_encrypted.DirectoryEntry(name='', _type=0, color=0, leftId=4294967295, rightId=4294967295, childId=4294967295, clsid='', bits=0, ct=0, mt=0, loc=0, content=b'')[source]

Bases: object

property CLSID
property ChildId
property LeftSiblingId
property Name
property RightSiblingId
write_filetime(obuf, ft)[source]
write_header_to(obuf)[source]

Write 128 bytes header in the output buffer. The Name property needs to be converted to UTF-16; Content is _not_ written out by this method.

class msoffcrypto.method.container.ecma376_encrypted.DirectoryEntryType[source]

Bases: object

EMPTY = 0
LOCK_BYTES = 3
PROPERTY = 4
ROOT_STORAGE = 5
STORAGE = 1
STREAM = 2
class msoffcrypto.method.container.ecma376_encrypted.ECMA376Encrypted(encryptedPackage=b'', encryptionInfo=b'')[source]

Bases: object

set_payload(encryptedPackage, encryptionInfo)[source]
write_to(obuf)[source]

Writes the encrypted data to obuf

class msoffcrypto.method.container.ecma376_encrypted.ECMA376EncryptedLayout(sectorSize)[source]

Bases: object

property contentSectorNum
property directoryEntryPos
property encryptionPackagePos
property fatPos
property miniFatDataPos
property miniFatPos
offsetData(startingSectorLocation)[source]
offsetDifat(n)[source]
property offsetDirectoryEntries
property offsetFat
offsetMiniData(startingSectorLocation)[source]
property offsetMiniFat
property offsetMiniFatData
property totalSectors
property totalSize
class msoffcrypto.method.container.ecma376_encrypted.Header[source]

Bases: object

BUFFER_SIZE = 512
FIRSTNUMDIFAT = 109
write_to(obuf)[source]
class msoffcrypto.method.container.ecma376_encrypted.RedBlack[source]

Bases: object

BLACK = 1
RED = 0
class msoffcrypto.method.container.ecma376_encrypted.SectorTypes[source]

Bases: object

DIFSECT = 4294967292
ENDOFCHAIN = 4294967294
FATSECT = 4294967293
FREESECT = 4294967295
MAXREGSECT = 4294967290
NOSTREAM = 4294967295
msoffcrypto.method.container.ecma376_encrypted.datetime2filetime(dt)[source]

Convert Python datetime.datetime to FILETIME (64 bits unsigned int)

A file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).

https://learn.microsoft.com/en-us/windows/win32/sysinfo/file-times

Module contents