Metadata-Version: 2.1
Name: strindex
Version: 3.3.2
Summary: A command line utility to extract and patch strings of various filetypes, with a focus on compatibility and translation.
Home-page: https://github.com/zWolfrost/strindex
Author: zWolfrost
Author-email: zwolfrost@gmail.com
License: MIT
Keywords: PE strings patching translation
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pefile (>=2024.8.26)
Provides-Extra: filter_language
Requires-Dist: lingua-language-detector ; extra == 'filter_language'
Provides-Extra: patch_gui
Requires-Dist: pyside6 ; extra == 'patch_gui'
Provides-Extra: spellcheck
Requires-Dist: language-tool-python ; extra == 'spellcheck'

# strindex
[![PyPI version](https://img.shields.io/pypi/v/strindex?label=PyPI%20version)](https://pypi.org/project/strindex/)
[![PyPI downloads](https://img.shields.io/pypi/dm/strindex?label=PyPI%20downloads)](https://pypi.org/project/strindex/)
[![GitHub downloads](https://img.shields.io/github/downloads/zWolfrost/strindex/total?label=GitHub%20downloads)](https://github.com/zWolfrost/strindex/releases/latest)
[![license](https://img.shields.io/github/license/zWolfrost/strindex)](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:
  ```sh
  strindex create program.exe -o strindex.txt
  ```
- Patch a PE file with a strindex:
  ```sh
  strindex patch program.exe strindex.txt
  ```

## Strindex Settings example
```json
{
    "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"]
}
```

