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.5.tar.gz (20.3 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.5-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ms_cfb-0.0.5.tar.gz
  • Upload date:
  • Size: 20.3 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.5.tar.gz
Algorithm Hash digest
SHA256 2e7bcb1e61afc59f55fee251bf49ada1dc095dd1644ee6cc946d40ff23c036b1
MD5 839dfd5241cbd1a239f2904574bb1e4a
BLAKE2b-256 53f1325e21d4733e975c60c5c459e2e89e57d46e1582b84fe52c30cef8872beb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ms_cfb-0.0.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: ms_cfb-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d8dfacc62db9698fd8fa6d2e7a138ed8e21101c798fededc205530ffe455f04d
MD5 52c679674cf2e9cae3b25927066e354a
BLAKE2b-256 86f56748ac03b36c07223d8c1566f0e5b0c0285b455ba8cc878133753683b37f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ms_cfb-0.0.5-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