{"id":20350260,"url":"https://github.com/vector-man/ninja","last_synced_at":"2025-10-04T18:33:25.527Z","repository":{"id":25794612,"uuid":"29233199","full_name":"vector-man/ninja","owner":"vector-man","description":"Patching engine that supports automatic conversion between ROM formats","archived":false,"fork":false,"pushed_at":"2015-01-14T08:52:17.000Z","size":123,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T23:46:45.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vector-man.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-14T07:45:00.000Z","updated_at":"2021-11-03T22:52:40.000Z","dependencies_parsed_at":"2022-08-23T14:00:13.132Z","dependency_job_id":null,"html_url":"https://github.com/vector-man/ninja","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vector-man%2Fninja","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vector-man%2Fninja/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vector-man%2Fninja/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vector-man%2Fninja/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vector-man","download_url":"https://codeload.github.com/vector-man/ninja/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241879635,"owners_count":20035809,"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":[],"created_at":"2024-11-14T22:29:35.039Z","updated_at":"2025-10-04T18:33:25.034Z","avatar_url":"https://github.com/vector-man.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"NINJA 1.01-vector-man (cli)\nCopyright (c) Derrick Sobodash 2004, 2012\nCopyright (c) CodeIsle.com 2015\n\n\nHISTORY\n1.01-vector-man: Added silent patching mode (-ps), requiring no user interaction.\n1.01:            Fixed binary patching to interprest a value of 0 as no known\n                 CRC32/MD5/SHA1. It was in the specs but mistakenly passed over.\n 1.0:            Initial release\n\n\nINFORMATION\n\nGiven the already wide-spread use of IPS, one may quickly wonder why I, of all\npeople, took it upon myself to create a new patching format. There are many\nreasons, but the most important ones can be summed up as follows:\n\n+ IPS format is limited to 24-bit addressing. This means you cannot make an\n  IPS of a file over 16MB. Even with PPF, which uses 32-bit addressing, you\n  are still limited to 4GB. As we're seeing more and more 8GB+ DVDs, it's\n  only a matter of time until we have a need for ISO patches supporting\n  higher addressing.\n\n+ IPS stores no information to verify the file it is being applied to is the\n  file it was intended for. Anyone who has ever done a translation should\n  appreciate the number of clueless users who can't make the patch work with\n  the interleaved, broke-ass ROM they got from BIG AL's l33t H4uS of Romhs.\n\n+ I really wanted the experience of developing my own file format for once,\n  instead of always reverse-engineering someone else's. I wanted to make\n  something I, and possibly others, would actually have a use for.\n\nFor the above reasons, I developed what I have named The NINJA Patch Formats,\na series of patch specifications designed to deal with the above issues.\n\n\nFEATURES\n\nThere are four forms of NINJA patches, all of which share the extension \".RUP\"\nThey are identified by the first eight bytes of the file (if you are curious\nabout this, you should probably read the specifications). These forms include\ntextual and binary patches in both raw and compressed forms. Compressed\npatches use the gzip compression routine. This is the only compression used in\nNINJA formats.\n\nTextual patches are larger, but they offer the user some extra options, namely\ncomments. Any line beginning with \"#\" is recognized by NINJA as a comment and\nwill be ignored. I'm sure you can think of your own uses for such.\n\nNINJA patches also store the CRC32, MD5sum and SHA1 of a source file. This\nmeans it's virtually impossible to apply a NINJA patch to a file it was not\ndesigned for. On top of this, it has special support for console systems such\nas Super Nintendo, Sega Megadrive and Nintendo Game Boy for working with the\nmany file formats. It can detect whether a ROM needs its headers removed,\ndeinterleaving or other problems, so that a patch made by NINJA will work on\nany intended ROM, regardless of its format.\n\nFor example, I make a patch of a Mega Drive game I hacked. And end user wants\nto apply it, but their ROM is in SMD (even though some jackass named it .BIN).\nNINJA will detect their SMD ROM, deinterleave it, and apply the patch properly,\nwhere other tools like IPS or PPF would fail.\n\nNINJA supports nearly infinite patch sizes and patch lengths. How infinite is\nnearly infinite? Well if you want to work out 2^2040, be my guest, but if not,\nI'll just tell you it's around 600 zeros longer than the largest number\ncommonly named -- a googolplex. And I don't expect to see hard disks, let\nalone files that size until my hair is grey. 2^2040 is the hard limit for both\naddressing and patching.\n\nThis implementation also includes support for IPS patching, as well as the\nNINJA formats, to help ease a few of the IPS die-hards over to the new format.\n\nThe PHP implementation is capable of working on any platform which supports\nPHP (currently Windows, Linux, FreeBSD/variant, AmigaOS, Mac OS X, Novell\nNetWare, OS/2, RISC OS, SGI's IRIX, AS/400 and possibly QNX).\n\n\nLIMITATIONS\n\nWhile the format may have virtually none, NINJA implementations may have some.\nFor example, this PHP implementation (that includes the EXE version) is limited\nto a max of 32-bit addressing because, as of the current PHP version, no\nvariable can hold a quantity higher than 0xffffffff. I hear int64 support is\ncoming soon, which would bring the limitations up to well over 120GB.\n\nHowever, that's just this implementation of the NINJA format. A NINJA\ncompatible patcher written in another language (for example, C with asm, which\ncould make it as high as 80-bit) could take it further. This is really a\nformat designed to grow with computers and languages, because it can always\nexpand upward while retaining full backwards compatibility.\n\n\nREQUIREMENTS\n\nFor the executable version, you will need a Windows operating system with\n32-bit executable support (I think this means Windows 95 users are out of\nluck).\n\nFor the PHP version, you will need a system with PHP 4.3.2 or later\ninstalled. If on a Windows or DOS system, it's recommended you add PHP to your\n$PATH$ Environment Variable.\n\n\nUSAGE\n\nRun NINJA without any parameters to display the quick help. Modes of operation\nare listed below:\n\nninja -p \u003cpatch file\u003e \u003cfile to patch\u003e\n  NINJA will accept any of the NINJA 1.0 formats or the IPS format with this\n  command. Your file will be backed up to FILENAME.BAK. After patching is\n  complete, you'll be prompted whether to keep or delete the file.\n\nninja [-t/-tz] \u003cmode\u003e \u003csource file\u003e \u003cmodified file\u003e \u003cpatch\u003e\n  NINJA will create a textual patch of the differences between the source and\n  modified files. For mode, specify any of the valid modes for NINJA 1.0 (note:\n  not all of them have special functions yet). If -tz is used, a gzip\n  compressed patch block will be built.\n\nninja [-b/-bz] \u003cmode\u003e \u003csource file\u003e \u003cmodified file\u003e \u003cpatch\u003e\n  NINJA will create a binary patch of the differences between the source and\n  modified files. Same rules apply for textual patches. If -bz is used, a gzip\n  compressed patch block will be built.\n\n\nMODES\n\nThe following modes are recognized by NINJA 1.0:\n\n * raw   --  RAW data, no special processing\n * nes   --  Nintendo Entertainment System/Famicom 8-bit\n * snes  --  Super Nintendo Entertainment System/Super Famicom 16-bit\n * n64   --  Nintendo 64\n * gb    --  Game Boy\n * gbc   --  Game Boy Color\n * gba   --  Game Boy Advance\n * ngp   --  NeoGeo Pocket\n * ngpc  --  NeoGeo Pocket Color\n * sms   --  Sega Master System\n * gg    --  Game Gear\n * mega  --  Genesis Megadrive\n * pce   --  NEC TurboGrafx16/PC-Engine\n * ws    --  Bandai WonderSwan\n * wsc   --  Bandai WonderSwan Color/Crystal\n * lynx  --  Atari Lynx\n * jag   --  Atari Jaguar\n * gp32  --  Gamepark GP32\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvector-man%2Fninja","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvector-man%2Fninja","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvector-man%2Fninja/lists"}