{"id":23196676,"url":"https://github.com/compasssecurity/jimagepatcher","last_synced_at":"2025-07-06T14:05:51.705Z","repository":{"id":78542882,"uuid":"299573792","full_name":"CompassSecurity/JimagePatcher","owner":"CompassSecurity","description":"Recreate jimage files from extracted jimages.","archived":false,"fork":false,"pushed_at":"2020-09-29T09:53:59.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-06T14:05:48.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CompassSecurity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2020-09-29T09:51:47.000Z","updated_at":"2024-05-03T16:23:20.000Z","dependencies_parsed_at":"2023-03-30T05:48:47.322Z","dependency_job_id":null,"html_url":"https://github.com/CompassSecurity/JimagePatcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CompassSecurity/JimagePatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompassSecurity%2FJimagePatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompassSecurity%2FJimagePatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompassSecurity%2FJimagePatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompassSecurity%2FJimagePatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CompassSecurity","download_url":"https://codeload.github.com/CompassSecurity/JimagePatcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompassSecurity%2FJimagePatcher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263914455,"owners_count":23529077,"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-12-18T14:20:00.962Z","updated_at":"2025-07-06T14:05:51.699Z","avatar_url":"https://github.com/CompassSecurity.png","language":"Java","readme":"# JImagePatcher  \r\nThe JDK tool `jimage`  supports only the extraction of jimage files but not the recreation of them. If you need to patch code or resources in a jimage file, you can use this tool to do so.\r\n\r\nFirst extract the modules from the jimage file to a folder with the JDK tool:\r\n\r\n    jimage extract --dir extracted-modules jimagefile\r\nThen patch the files in the extracted folder as needed.\r\n\r\nAt least recreate the jimage file with this tool:\r\n\r\n    java --add-opens jdk.jlink/jdk.tools.jlink.internal=jimagePatcher --module-path jimagePatcher.jar -m jimagePatcher/jimagePatcher.Run extracted-modules new-jimagefile\r\n\r\n## Usage\r\n    java --add-opens jdk.jlink/jdk.tools.jlink.internal=jimagePatcher --module-path jimagePatcher.jar -m jimagePatcher/jimagePatcher.Run input-folder output-file\r\n## Infos\r\nStiched together with the help of \r\nhttp://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/78a06bc11975\r\nand\r\nhttp://jar.fyicenter.com/3245_JDK_11_jdk_jlink_jmod-JLink_Tool.html\r\n\r\nBecause the jlink stuff is not exported in the module, we have to use reflection to access all that stuff. That reflection can access all that stuff, the runtime needs to be started with `--add-opens jdk.jlink/jdk.tools.jlink.internal=jimagePatcher`\r\n\r\n## TODO\r\n### Testing\r\nThis tool was only used for one project. It was only tested with OpenJDK 11.0.8\r\n### Support for Plugins (e.g. Compressions)\r\nThe creation of jimages with the JDK tool `jlink` supports plugin options used for compression and other stuff... Currently the tool does not support any plugins.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompasssecurity%2Fjimagepatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompasssecurity%2Fjimagepatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompasssecurity%2Fjimagepatcher/lists"}