Skip to main content

Microsoft Compound File Binary File Format.

Project description

Coverage Status Build Status

MS-CFB

About

MS-CFB allows users to create, modify, and disassemble Microsoft Compound File Binary Files. This software can be used from the command line, or as a library within other projects.

This software operates as recommended in the Microsoft interoperability guidelines

Requirements

MS-CFB is tested on python 3.7 and higher.

Installation

Use the package manager pip to install MS_OVBA_Compression.

pip install ms_cfb

Getting Started

MS-CFB will take a specified directory, and combine all directories and files within the directory tree into a compound binary file. Each storage directory will be given the name of the directory, and each stream directory will be given the name of the file minus its extension.

For example, the following

./project
├── PROJECT.txt
└───VBA
     ├── Sheet1.bin
     ├── ThisWorkbook.bin
     ├── Module1.bin
     ├── dir.bin
     └── _VBA_PROJECT.bin

Will be transformed to:

Root Entry
├── PROJECT
└───VBA
     ├── Sheet1
     ├── ThisWorkbook
     ├── Module1
     ├── dir
     └── _VBA_PROJECT

To run the program

python ole_file.py [-h] [-c] [-l] [-x] [-v {3,4}]
                   [-f FILE] [-X EXTRA]
                   [directory]

positional arguments:
  directory             The input or output directory.

options:
  -h, --help            show this help message and
                        exit
  -c, --create          Create an OLE file from a
                        directory.
  -l, --list            Display metadata on the OLE
                        file and list the files that
                        it contains.
  -x, --extract         Extract files from an OLE file
                        to a directory.
  -v {3,4}, --version {3,4}
                        The OLE version to use.
  -f FILE, --file FILE  The input or output bin file
                        name
  -X EXTRA, --extra EXTRA
                        Path to exta settings yml
                        file.

examples:
  python -m ms_cfb -c -f vbaProject.bin -v 3 -X info.yml ./project

  python -m ms_cfb -x -f vbaProject.bin ./project

  python -m ms_cfb -l -f vbaProject.bin

Some directory settings can be specified from a YAML file. Directory paths are relative to the project root. Users can specify creation and modification date in ISO format, class id as a UUID string, and user flags as a four byte integer.

directories:
  .:
    clsid: 56616700-C154-11CE-8553-00AA00A1F95B
  Storage 1:
    created: "1995-11-16 17:43:44"
    clsid: 56616100-C154-11CE-8553-00AA00A1F95B

Tests

The tests directory contains examples of how the classes can be used within other projects. There are also complete functional tests that include full working examples of creating the OLE file from CLI or using the module's objects.

Contributing

Contributions are welcome. Please ensure new features include unit tests to maintain 100% coverage. All code must adhere to the PEP8 Standards for both formatting and naming. Method signatures must be fully annotated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ms_cfb-0.0.3.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ms_cfb-0.0.3-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file ms_cfb-0.0.3.tar.gz.

File metadata

  • Download URL: ms_cfb-0.0.3.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ms_cfb-0.0.3.tar.gz
Algorithm Hash digest
SHA256 36d5ef0b4e5e98a2a03546392e504b4b573d23d02e380da9f9af22fde6efe405
MD5 eed7197be0556f6c097a02e316bebae5
BLAKE2b-256 2c6427eb8cd32e6f10b7560904815142458c9cdd24bd4a4554cf12b3db78a8bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for ms_cfb-0.0.3.tar.gz:

Publisher: python-publish.yml on Beakerboy/MS-CFB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ms_cfb-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ms_cfb-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ms_cfb-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d3441817df2c8f9d76e8ed59b57d8b2e2245b86f80bdd4b86244f77c557811ee
MD5 1b83085cd85d9a44ae352b9a03e4a95c
BLAKE2b-256 f139f56e950105fbabc4c4f35915242740181f38351f9576309c19e2c4abbe9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ms_cfb-0.0.3-py3-none-any.whl:

Publisher: python-publish.yml on Beakerboy/MS-CFB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page