{"id":20627949,"url":"https://github.com/coxxs/patch-porter","last_synced_at":"2026-02-22T22:45:14.515Z","repository":{"id":63584518,"uuid":"568979101","full_name":"Coxxs/patch-porter","owner":"Coxxs","description":"A simple .pchtxt porting tool.","archived":false,"fork":false,"pushed_at":"2024-04-21T22:21:46.000Z","size":59,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T06:42:41.226Z","etag":null,"topics":["ips","ipswitch","pchtxt","porting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coxxs.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-11-21T20:27:02.000Z","updated_at":"2025-03-27T20:13:56.000Z","dependencies_parsed_at":"2023-11-28T14:29:53.097Z","dependency_job_id":"fcdf8e1f-c0d6-4181-8f19-da3ba7671894","html_url":"https://github.com/Coxxs/patch-porter","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":"0.15384615384615385","last_synced_commit":"6db19a9b0f4754a0ed7ea2b7e892418a1de7aab9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coxxs%2Fpatch-porter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coxxs%2Fpatch-porter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coxxs%2Fpatch-porter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coxxs%2Fpatch-porter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coxxs","download_url":"https://codeload.github.com/Coxxs/patch-porter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249098957,"owners_count":21212582,"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":["ips","ipswitch","pchtxt","porting"],"created_at":"2024-11-16T13:18:48.799Z","updated_at":"2026-02-22T22:45:14.507Z","avatar_url":"https://github.com/Coxxs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# patch-porter\n\nA simple `.pchtxt` porting tool.\n\n\u003e **Playground:** https://moe.tools/patch-porter/\n\n## Usage\n\n1. Install [Node.js](https://nodejs.org), then install `patch-porter` using npm:\n\n    ```shell\n    npm install -g patch-porter\n    ```\n\n2. Port your pchtxt:\n\n    ```shell\n    patch-porter --from=mainA --to=mainB --input=A.pchtxt --output=B.pchtxt\n    ```\n    - `--comment`: Add ported address as comment to the output file\n    - `--arch=arm64`: Set the processor architecture for the NSO file (arm/arm64/none), default: arm64\n\n3. Done!\n\n## Tips\n- Please keep `@flag offset_shift ...` in your pchtxt to help `patch-porter` finding the correct address\n- If your pchtxt doesn't have `@flag offset_shift 0x100`, it means that the addresses in your pchtxt are not based on the NSO header offset.\\\n  In this case, you need to decompress your NSO file using [hactool](https://github.com/SciresM/hactool), and disable NSO mode in `patch-porter` (`--no-nso`).\n\n    ```shell\n    hactool -t nso --uncompressed mainA.raw mainA\n    hactool -t nso --uncompressed mainB.raw mainB\n    patch-porter --from=mainA.raw --to=mainB.raw --input=A.pchtxt --output=B.pchtxt --no-nso\n    ```\n- After porting, search for `[x]` in new pchtxt to find errors\n- `patch-porter` will automatically update assembly code for `b` and `bl` instructions, but some patches may still require manual updates\n\n## Use in Node.js\n\n```javascript\nimport { promises as fs } from 'fs'\nimport { portPchtxt } from 'patch-porter'\n\nlet fileA = await fs.readFile('mainA')\nlet fileB = await fs.readFile('mainB')\nlet pchtxtA = await fs.readFile('A.pchtxt', 'utf8')\n\nlet pchtxtB = await portPchtxt(fileA, fileB, pchtxtA)\n\nawait fs.writeFile('B.pchtxt', pchtxtB)\n```\n\n## Credits\n\n- [disasm-web](https://github.com/CzBiX/disasm-web)\n- [capstone](https://github.com/capstone-engine/capstone)\n- [keystone](https://github.com/keystone-engine/keystone)\n- [IPSwitch](https://github.com/3096/ipswitch)\n- [libsais](https://github.com/IlyaGrebnov/libsais)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoxxs%2Fpatch-porter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoxxs%2Fpatch-porter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoxxs%2Fpatch-porter/lists"}