Skip to main content

Utilities to automate the modification to il2cpp string literals in metadata

Project description

il2cpp-strings-patcher

Utilities to extract and modify string literals in unencrypted global-metadata.dat file.

Usage

Install

The Python package is available on PyPI.

pip install il2cpp-strings-patcher

Extract Literals

Extract all strings from a metadata file. Unlike Il2CppDumper, this tool only extracts the text, and the image offset is not dumped.

from il2cpp_strings import StringsPatcher

with open('/path/to/global-metadata.dat', 'r') as f:
    patcher = StringsPatcher(f)
    strings = [x.original_string for x in f.literals]

Modify Literals and Save

patcher.patch_literals({
    'old_literal_content1': 'new_literal_content1',
    'old_literal_content2': 'new_literal_content2',
})
# Generate new global-metadata.dat file
result = patcher.generate_patched_file()
with open('/path/to/new-global-metadata.dat', 'w') as f:
    f.write(result)

Or, if your need to match the original string and generate patched string in custom way:

for literal in patcher.literals:
    # Replace all string literals that start with "some-string" with "my-string"
    if literal.original_string.startswith('some-string'):
        literal.patch('my-string')
result = patcher.generate_patched_file()

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

il2cpp_strings_patcher-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

il2cpp_strings_patcher-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file il2cpp_strings_patcher-0.1.0.tar.gz.

File metadata

  • Download URL: il2cpp_strings_patcher-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for il2cpp_strings_patcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbee689ef36ddb3892df2b255cbdc919eeea6e9cfd6b5a3dc332418e86f80be1
MD5 40768b5e55203d53798dc6724c4ee403
BLAKE2b-256 cd9443d7eab483fc5b968e98288ce144a4fd5e16031ecc995e448e49af8d2b36

See more details on using hashes here.

File details

Details for the file il2cpp_strings_patcher-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for il2cpp_strings_patcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10ff4d3e666b64460bf38b848f321a8a48b0befb082a08dff5d43000a740bd2f
MD5 3e5c826f0d851778ace7bc6855d65a4e
BLAKE2b-256 8e40a5629b358ad111b7ed8964b9bf31c507143d3ba492c284805f313091c402

See more details on using hashes here.

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