Skip to main content

A command line utility to extract and patch strings of various filetypes, with a focus on compatibility and translation.

Project description

strindex

PyPI version PyPI downloads GitHub downloads license

A command line utility to extract and patch strings of various filetypes, with a focus on compatibility and translation.

This utility will allow you to replace strings in supported filetypes with other strings. It's useful to change the text of a program without having to recompile it, for example, to translate a program into another language.

Apart from using offsets to replace strings, there's also an option to use the original string itself to ensure compatibility with different versions of the same program.

There are a lot of features to help with translation, such as spellchecking & filtering strings by length and character set.

The release includes a precompiled version of the program, which ONLY does the patching. If you want to use the other features, you will need to install Python 3.6 or later and the required libraries.

Supported filetypes

Support for more types won't be added unless I find some motivation to...

  • PE files (".exe, ".dll"...)
  • Gamemaker data file ("data.win")

Installation

You can install the program with the command pip install strindex.

Usage

You can run the program with the command strindex <action> <input file(s)> [options].

These are the available actions:

  • create: Create a list of strings from a PE file (a strindex). Use -c to create a strindex that uses the original strings as references.
  • patch: Patch a PE file with a strindex.
  • patch_gui: Patch a PE file with a strindex using a GUI.
  • filter: Filter a strindex by detected language, wordlist or length. You can specify those in the strindex settings.
  • delta: Create a delta file between two strindexes, that only contains the lines of the first strindex missing in the second one.
  • spellcheck: Spellcheck a strindex. You can specify the target language in the strindex settings as an ISO 639-1 code.

Usage Examples

  • Create a strindex from a PE file:
    strindex create program.exe -o strindex.txt
    
  • Patch a PE file with a strindex:
    strindex patch program.exe strindex.txt
    

Strindex Settings example

{
    "md5": "29ed1f9e450d43815c2d1a0cab168da3",

    "prefix_bytes": ["24c7442404", "ec04c70424"],

    "patch_replace": {
        "ì": "í",
        "Ì": "Í",
        "ò": "ó",
        "Ò": "Ó"
    },

    "clean_pattern": "\\[.*?\\]|\\*",
    "whitelist": ["latin", "spanish", "cyrillic"],

    "source_language": "es",
    "target_language": "it",
    "among_languages": ["en", "ja", "ko", "de", "fr", "es", "pt", "ru", "zh"]
}

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

strindex-3.3.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

strindex-3.3.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file strindex-3.3.0.tar.gz.

File metadata

  • Download URL: strindex-3.3.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for strindex-3.3.0.tar.gz
Algorithm Hash digest
SHA256 1d1d8032089b3f08d686b9ec902c7c8b6e4ef4e43d641c73015c809a1d173dfc
MD5 c635abae57c26f0f735edb35db5b55d8
BLAKE2b-256 c43f4c6157e6f750c45b47ec4cf3903e83f836060bfd73f092b54772b386414f

See more details on using hashes here.

File details

Details for the file strindex-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: strindex-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for strindex-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73251b210326cc2d67aa51a7a309a10a47d9cc56bd18895ea21abe20c9d43117
MD5 d5f9b3954e37769fa52d59be04257533
BLAKE2b-256 e32de67983ddcde8fea8ce57e7373cd0ea4021064ee7e2d63890850104f57362

See more details on using hashes here.

Supported by

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