{ "info": { "author": "NLeseul", "author_email": "nleseul@this-life.us", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "License :: Freeware", "Natural Language :: English", "Programming Language :: Python :: 3.2", "Topic :: Utilities" ], "description": "# ips-util\n\n## Summary\n\nThis is a Python package for manipulating binary patches encoded in the International Patching System (IPS) format, as documented [here](http://fileformats.archiveteam.org/wiki/IPS_(binary_patch_format)) and [here](http://old.smwiki.net/wiki/IPS_file_format). IPS is a format that historically has been widely used for the distribution of ROM hacks for classic game consoles; as far as I know it remains a standard format today, despite its known limitations, and tools for using it are still helpful.\n\nWhile the ips-util package does provide a command-line interface for creating and applying patches analagous to the GUI provided by [Lunar IPS](https://fusoya.eludevisibility.org/lips/) and similar tools, I created it mainly to assist in writing Python scripts that generate ROM hacks and output IPS patches. Thus it may not be as full-featured as other programs... but given how bare-bones the IPS format is, I'm not sure how \"full-featured\" such a tool could really be. \n\nI've included a suite of tests to verify that ips-util handles the known pitfalls of the IPS format as best I can, but there may still be some edge cases I haven't thought of. I also haven't put too much thought into optimizing the creation of patches from a source and target file... the results seem pretty good based on limited testing, but I know that [Flips](https://github.com/Alcaro/Flips), for example, still has some optimizations I haven't bothered to implement. I'm not too worried about it; we don't live in a world where the difference between a 2Kb and a 3Kb patch matters to anyone that much anymore. \n\n## Command line usage\n\nThe package provides a command-line interface which can be accessed independently of the Python shell (although `python -m ips_util` will still work if you really want it...). \n\nTo create a patch, using existing source and target binary files:\n\n```bash\n> ips_util create \"Super Mario World.smc\" \"Super Mario World [1337357_h4x_3v4r].smc\" -o 1337_p47ch.ips\n```\n\nTo apply a patch to a binary file:\n\n```bash\n> ips_util apply 1337_p47ch.ips \"Super Mario World.smc\" -o w00t.smc\n```\n\nNote that in both cases, if an output file is not specified using the `-o` flag, the result will be written to stdout, for use in whatever complicated `bash` shenanigans you Linux kids get up to these days. \n\nYou can also dump the contents of a patch, to preview it or to debug your patch creation scripts:\n\n```bash\n> ips_util trace 1337_p47ch.ips\n```\n\n(However, for the moment, a proper visual tool like [ips-peek](https://github.com/vector-man/IPS-Peek) is probably better in every way for that purpose.)\n\n## Usage in scripts\n\nVery simple:\n\n```python\nfrom ips_util import Patch\n\ndef this_is_my_patch():\n patch = Patch()\n\n patch.add_record(0x1234, 999.to_bytes(2, byteorder='little')) # Max out some stat\n patch.add_rle_record(0x5678, b'\\xea', 0x10) # NOP out a bunch of code\n\n with open('gavroche.ips', 'w+b') as f:\n f.write(patch.encode())\n```\n\nOr:\n\n```python\nfrom ips_util import Patch\n\ndef dude_wheres_my_patch():\n patch = Patch.load('gavroche.ips')\n\n with open('some_data.smc', 'rb') as f_in:\n with open('some_patched_data.smc', 'w+b') as f_out:\n f_out.write(patch.apply(f_in.read()))\n```\n\n## License\n\nCopy[right|left] is dumb and oppressive. So just do whatevs; I don't care. \n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nleseul/ips_util", "keywords": "", "license": "Unlicense", "maintainer": "", "maintainer_email": "", "name": "ips-util", "package_url": "https://pypi.org/project/ips-util/", "platform": "", "project_url": "https://pypi.org/project/ips-util/", "project_urls": { "Homepage": "https://github.com/nleseul/ips_util" }, "release_url": "https://pypi.org/project/ips-util/1.0/", "requires_dist": null, "requires_python": ">=3.2", "summary": "A Python package for manipulating IPS patches", "version": "1.0" }, "last_serial": 4635627, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "dee8023eb5d8be96426d3bcfa9d44e38", "sha256": "7862e9fbf09d7a9cdfdac05062755a1bad2d64bd54737046b497852b84d98f2b" }, "downloads": -1, "filename": "ips_util-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dee8023eb5d8be96426d3bcfa9d44e38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.2", "size": 7418, "upload_time": "2018-12-26T16:28:43", "url": "https://files.pythonhosted.org/packages/c4/88/472d4c77ec23a6ba1fa824800d39b0917010bdb25cc9574c4bb13547e894/ips_util-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b7d8f2cad92519b5480054b082a04ce", "sha256": "478502f573f2b92f6409ae9efb129025b9e2cd2d71b2c9b6f1fd1796cb311933" }, "downloads": -1, "filename": "ips_util-1.0.tar.gz", "has_sig": false, "md5_digest": "6b7d8f2cad92519b5480054b082a04ce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.2", "size": 5871, "upload_time": "2018-12-26T16:28:44", "url": "https://files.pythonhosted.org/packages/e3/68/4250a1ca49778ec7bd00ac408c0cf8a56d09ab8adbfa59f63f14c84d089e/ips_util-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dee8023eb5d8be96426d3bcfa9d44e38", "sha256": "7862e9fbf09d7a9cdfdac05062755a1bad2d64bd54737046b497852b84d98f2b" }, "downloads": -1, "filename": "ips_util-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dee8023eb5d8be96426d3bcfa9d44e38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.2", "size": 7418, "upload_time": "2018-12-26T16:28:43", "url": "https://files.pythonhosted.org/packages/c4/88/472d4c77ec23a6ba1fa824800d39b0917010bdb25cc9574c4bb13547e894/ips_util-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b7d8f2cad92519b5480054b082a04ce", "sha256": "478502f573f2b92f6409ae9efb129025b9e2cd2d71b2c9b6f1fd1796cb311933" }, "downloads": -1, "filename": "ips_util-1.0.tar.gz", "has_sig": false, "md5_digest": "6b7d8f2cad92519b5480054b082a04ce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.2", "size": 5871, "upload_time": "2018-12-26T16:28:44", "url": "https://files.pythonhosted.org/packages/e3/68/4250a1ca49778ec7bd00ac408c0cf8a56d09ab8adbfa59f63f14c84d089e/ips_util-1.0.tar.gz" } ] }