Git Product home page Git Product logo

mfsutil's Introduction

MFSUtil

MFS and CFG file manipulation utility

Description

This tool can be used to manipulate an MFS (ME File System) partition as well as the CFG files stored within.

Usage

The tool does one operation per run, so for most things, multiple calls will be necessary. See the examples folder for potential uses.

The manipulation of either MFS or CFG files are mutually exclusive.

usage: MFSUtil.py [-h] [-o FILE] [-i ID] [-f PATH] [--mode MODE] [--opt OPT]
                  [--uid UID] [--gid GID] [--recursive]
                  [--alignment ALIGNMENT] [--deoptimize] (-m FILE | -c FILE)
                  (-d | -z | -x | -a FILENAME | -r)

MFS and CFG file manipulation utility.

optional arguments:
  -h, --help            show this help message and exit
  -o FILE, --output FILE
                        Output file to write
  -i ID, --file-id ID   ID of the file to manipulate in the MFS file
  -f PATH, --file-path PATH
                        Path of the file to manipulate in the CFG file
  --mode MODE           Mode for file being added to CFG
  --opt OPT             Deplyoment option for file being added to CFG
  --uid UID             User ID for file being added to CFG
  --gid GID             Group ID for file being added to CFG
  --recursive           Recursive deletion for a file path in CFG
  --alignment ALIGNMENT
                        Alignment type for CFG files. (default: 0). 0 :
                        packed. 1 : align all files on chunk start. 2 : align
                        end of files on end of chunk.
  --deoptimize          De-optimize chain sequences when adding a file to MFS.
  -m FILE, --mfs FILE   MFS file to read from
  -c FILE, --cfg FILE   CFG file to read from
  -d, --dump            Dump information about the MFS file, or the CFG file
  -z, --zip             Store the MFS contents to a ZIP file
  -x, --extract         Extract a file from the MFS file, or a file from the
                        CFG file
  -a FILENAME, --add FILENAME
                        Add a file to the MFS file or a file to the CFG file
  -r, --remove          Remove a file from the MFS file, or a file from the
                        CFG file

The default output is to stdout.
Either one of --mfs or --cfg must be specified to indicate on which type of file to work (MFS or CFG).
You can specify one of the mutually exclusive actions : --dump --zip, --extract, --add, --remove.
For the --extract, --add, --remove actions, if --mfs is specified, then --file-id is required, if --cfg is specified, then --file-path is required.
When adding a file to a CFG file, the --mode, --opt, --uid and --gid options can be added.
The --mode option needs to be a string in the form 'dAEIrwxrwxrwx' where unused bits can be either a space or a dash, like --mode '    rwx---rwx' for example.
The --opt option needs to be a string in the form '?!MF' where unused bits can be either a space or a dash.
When adding a directory, both the file path needs to end with a '/' character and the --mode needs to start with 'd'.

Attribution

This tool was written by Youness Alaoui (KaKaRoTo) but inspired by the parseMFS tool by Dmitry Sklyarov from Positive Technologies, with small parts (CRC algorithm) copied as is.

License

This software is released under the MIT license.

mfsutil's People

Contributors

kakaroto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mightyhouseinc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.