{"id":18543848,"url":"https://github.com/itotaljustice/libpatch","last_synced_at":"2025-09-11T06:35:54.851Z","repository":{"id":111602487,"uuid":"513351076","full_name":"ITotalJustice/libpatch","owner":"ITotalJustice","description":"simple patcher for ips, ups and bps files! (written in c99)","archived":false,"fork":false,"pushed_at":"2025-04-10T15:00:03.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T00:15:27.906Z","etag":null,"topics":["bps","c99","ips","patch","ups"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ITotalJustice.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,"publiccode":null,"codemeta":null}},"created_at":"2022-07-13T02:11:40.000Z","updated_at":"2024-10-26T21:58:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"8c62f191-a88d-4484-9c2b-35b7acf1ea04","html_url":"https://github.com/ITotalJustice/libpatch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITotalJustice%2Flibpatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITotalJustice%2Flibpatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITotalJustice%2Flibpatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ITotalJustice%2Flibpatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ITotalJustice","download_url":"https://codeload.github.com/ITotalJustice/libpatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254281483,"owners_count":22044951,"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":["bps","c99","ips","patch","ups"],"created_at":"2024-11-06T20:14:42.100Z","updated_at":"2025-05-15T05:30:41.526Z","avatar_url":"https://github.com/ITotalJustice.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libpatch\n\nsimple patcher for ips, ups and bps files! (written in c99).\n\nNOTE: this does not current support creating patches! only applying them\n\n---\n\n## using\n\nadd this to your `CMakeLists.txt`\n\n```cmake\ninclude(FetchContent)\n\nFetchContent_Declare(patch\n    GIT_REPOSITORY https://github.com/ITotalJustice/libpatch.git\n    GIT_TAG        master\n)\n\nFetchContent_MakeAvailable(patch)\n\ntarget_link_libraries(your_exe PRIVATE patch)\n```\n\nan example of how it would look in your code.\n\n```c\nuint8_t* apply_patch(\n    const uint8_t* src_data, size_t src_size,\n    const uint8_t* patch_data, size_t patch_size,\n    size_t* out_size\n) {\n    enum PatchType type;\n    if (PatchError_OK != patch_get_type(\u0026type, patch_data, patch_size))\n    {\n        return NULL;\n    }\n\n    if (PatchError_OK != patch_get_size(type, out_size, src_size, patch_data, patch_size))\n    {\n        return NULL;\n    }\n\n    uint8_t* out = malloc(out_size);\n    if (!out)\n    {\n        return NULL\n    }\n\n    if (PatchError_OK != patch_apply(type, out, out_size, src_data, src_size, patch_data, patch_size))\n    {\n        free(out);\n        return NULL;\n    }\n\n    // patch worked, out is now pointing to allocated data.\n    // remember to call free when done!\n    return out;\n}\n```\n\n---\n\n## thanks\n\n- ips spec https://zerosoft.zophar.net/ips.php\n- ups spec by near https://www.romhacking.net/documents/392/\n- bps spec by near https://www.romhacking.net/documents/746/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitotaljustice%2Flibpatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitotaljustice%2Flibpatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitotaljustice%2Flibpatch/lists"}