{"id":22822040,"url":"https://github.com/olivki/tos-tool","last_synced_at":"2025-04-23T03:11:17.172Z","repository":{"id":189739016,"uuid":"662789497","full_name":"Olivki/tos-tool","owner":"Olivki","description":"CLI tool and libraries for working with the various file format that ToS uses","archived":false,"fork":false,"pushed_at":"2024-08-03T17:13:21.000Z","size":1361,"stargazers_count":6,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T21:32:10.284Z","etag":null,"topics":["cli","kotlin","tos"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Olivki.png","metadata":{"files":{"readme":"README.md","changelog":"changelog_configuration.json","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-05T22:34:12.000Z","updated_at":"2025-01-05T01:52:38.000Z","dependencies_parsed_at":"2024-07-07T06:43:54.093Z","dependency_job_id":"e4ed4c34-6b69-4186-ba87-a979c6502639","html_url":"https://github.com/Olivki/tos-tool","commit_stats":null,"previous_names":["olivki/tos-tool"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olivki%2Ftos-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olivki%2Ftos-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olivki%2Ftos-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olivki%2Ftos-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Olivki","download_url":"https://codeload.github.com/Olivki/tos-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360496,"owners_count":21417721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","kotlin","tos"],"created_at":"2024-12-12T16:10:16.918Z","updated_at":"2025-04-23T03:11:17.150Z","avatar_url":"https://github.com/Olivki.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## tos-tools\n\nCLI tool and libraries for working with the various file format that ToS uses, currently supports `ies` and `ipf` files,\nwith some mappings done for the `xac` model format.\n\nThis tool has not been tested with the live version of the game, and is not intended to be used with it, therefore no\nsupport will be provided for it.\n\nNote that support for this tool is *not* provided by IMC Games, and is *not* officially supported by them.\n\n**Requires Java 17 or newer to run.**\n\nIf unsure of where to easily download Java 17, you can use the Microsoft build of OpenJDK 17, which can be\ndownloaded [here](https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-17).\n\n### Usage\n\nDownload the latest version from releases and extract it to a safe location, add the `bin` directory to your `PATH` *(or\nthe Linux equivalent)*, and you can then invoke the CLI environment by invoking `tos` in your preferred terminal.\n\nAll commands have basic `-h` / `--help` support, which will print out the usage of the command and the available\noptions. For example `tos ies unpack -h` will print out all available arguments/options for unpacking an `ies` file.\n\nThe `ies` and `ipf` commands are written to be sufficiently smart, and will try to prompt the user for input if the\ngiven file structure is somehow wrong, but they are *not* fool-proof, so errors can and will happen.\n\nNote that all commands have *more* options than what's shown below, the arguments shown below are just what you need to\nknow to quickly get started. For all arguments, like explained above, use the `-h` / `--help` option on the command.\n\n#### ies\n\nHandles the `ies` file format, which is a proprietary format used by ToS for storing game data.\n\nIES files are essentially a binary representation of a dictionary, with the mapping `string -\u003e f32`\nand `string -\u003e string`, these files are then used by the Lua scripts that run the client/server as pseudo class\nstructures.\n\nOnly 3 data types are supported by the `ies` format:\n\n- Number `0x0`\n-\n    - A 32-bit floating point number.\n- Localized String `0x1`\n-\n    - A string that can be localized by the client/server, the localized variant is stored in separate files.\n- Calculated String `0x2`\n-\n    - A string whose content is \"calculated\"/static, and is not privy to the localization mechanics.\n\nIf a string values key starts with `CP_` then its type is `Calculated String` otherwise it's a `Localized String`.\n\n##### unpack\n\n`tos ies unpack \u003cinput\u003e [output]`\n\nUnpacks an `ies` file(s) into a directory determined by the `output` argument. If `output` is not provided, the `output`\ndirectory will be created in the same directory as the `input` file, with the name `unpacked_ies`.\n\nIf `input` is a single file, only a single `ies` file will be unpacked, if `input` is a directory, then *all* files in\nthe directory will be traversed, and all `ies` files found will be unpacked.\n\n##### pack\n\n`tos ies pack \u003cinput\u003e [output]`\n\nPacks an `ies` file(s) into a directory determined by the `output` argument. If `output` is not provided, the `output`\ndirectory will be created in the same directory as the `input` file, with the name `packed_ies`.\n\nIf `input` is a single file, only a single `ies` file will be packed, if `input` is a directory, then *all* files in the\ndirectory will be traversed, and all `xml` *(this actually depends on the `format` used, but currently only the `xml`\nformat\nis supported)* files found will be packed.\n\n##### xml format\n\nThe `xml` format used by `unpack` and `pack` tries to mimic that of the official one, which means that a lot of the data\nis *inferred*.\n\nNote that \"optional\" columns are *not* supported, that means that if *one* entry has, say column, `CoolLevel`, but no\nother entry\nin the same xml file has that column, the conversion *will fail*. To fix this, either remove `CoolLevel` from the entry\nthat has it, or add `CoolLevel` to *every* entry in the xml file.\n\nFirst the `key` and `value` is checked to determine an initial type, where it's resolved as follows:\n\n- Does the `key` start with `CP_`?\n    - If yes, then the type is `Calculated String`\n    - If no, then we go to the next step\n- Does `value` start with `-` or only contain the characters `[' ', '.', '0'..'9']`?\n    - If yes, then the type is `Number`\n    - If no, then the type is `Localized String`\n\nIf a `value` that was previously inferred to be a `Number` is then inferred to be a `Localized String` then the type is\nchanged to `Localized String`. This is because the intial type is just a guess, and can be wrong.\n\nThe `kind` of a `column` is determined by the prefix of its `key`:\n\n- `EP_` -\u003e `EP`\n- `CP_` -\u003e `CP`\n- `VP_` -\u003e `VP`\n- `CT_` -\u003e `CT`\n- Anything else -\u003e `NORMAL`\n\nWhether a `column` is an `NT` column is determined by if its `key` contains `_NT`.\n\nWhether a `field` is a script field is determined by if its `value` contains `SCR_` or `SCP`.\n\n#### ipf\n\nHandles the `ipf` file format, which is a proprietary format used by ToS for storing game data and assets.\n\nIPF files are essentially just a proprietary archive format, with a custom footer, and encrypted file contents.\n\nBoth `unpack` and `pack` commands will attempt to use multiple cores by default, the amount of cores used can be changed\nwith the `-t`/`--threads` option. By default, it's half of the available cores.\n\nTo create custom `ipf` files, use the `pack` command on the directory containing the files you want to pack. To\nunderstand the structure of the `ipf` file, it's recommended to first `unpack` an ipf file and mimic that.\n\n##### unpack\n\n`tos ipf unpack \u003cinput\u003e [output]`\n\nUnpacks an `ipf` file(s) into a directory determined by the `output` argument. If `output` is not provided, the `output`\ndirectory will be created in the same directory as the `input` file, with the name `unpacked_ipf`.\n\nIf `input` is a single file, only a single `ipf` file will be unpacked, if `input` is a directory, then *all* files in\nthe directory will be traversed, and all `ipf` files found will be unpacked.\n\nUnpacked `ipf` files will contain a `.ipf_data` file, which contains data required by the `pack` command to repack\nthe `ipf` file properly.\n\n##### pack\n\n`tos ipf pack \u003cinput\u003e [output]`\n\nPacks the `input` file/directory into an `ipf` file(s), the `output` argument determines the name of the `ipf` file,\nif `input` contains multiple `ipf` directories, then `output` must be a directory, otherwise it must be a file.\n\nIf no `.ipf_data` file is located in the `input` then the user will be prompted to enter the required data, and a\nnew `.ipf_data` file will be created in `input` containing the provided data.\n\nIf the structure of the `input` directory is ambiguous then the user will be prompted for further information. Or in the\ncase that the structure is not resolvable *at all*, an error will be printed and the program will exit.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivki%2Ftos-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folivki%2Ftos-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivki%2Ftos-tool/lists"}