{"id":28945443,"url":"https://github.com/astropilot/pcrt","last_synced_at":"2026-02-24T01:35:03.151Z","repository":{"id":288341681,"uuid":"967591556","full_name":"Astropilot/PCRT","owner":"Astropilot","description":"PCRT (PNG Check \u0026 Repair Tool), a tool to help check and fix the error in a PNG image.","archived":false,"fork":false,"pushed_at":"2025-04-16T22:44:39.000Z","size":7354,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T06:53:51.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Astropilot.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,"zenodo":null}},"created_at":"2025-04-16T17:32:56.000Z","updated_at":"2025-04-17T08:03:07.000Z","dependencies_parsed_at":"2025-04-17T11:38:56.188Z","dependency_job_id":null,"html_url":"https://github.com/Astropilot/PCRT","commit_stats":null,"previous_names":["astropilot/pcrt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Astropilot/PCRT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astropilot%2FPCRT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astropilot%2FPCRT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astropilot%2FPCRT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astropilot%2FPCRT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Astropilot","download_url":"https://codeload.github.com/Astropilot/PCRT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astropilot%2FPCRT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29766813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T01:28:30.166Z","status":"ssl_error","status_checked_at":"2026-02-24T01:28:27.518Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-06-23T07:13:19.084Z","updated_at":"2026-02-24T01:35:03.125Z","avatar_url":"https://github.com/Astropilot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PCRT (PNG Check \u0026 Repair Tool)\n[![Python 2.7](https://img.shields.io/badge/Python-2.7-blue.svg)](https://www.python.org/downloads/) \n[![Version 1.1](https://img.shields.io/badge/Version-1.1-brightgreen.svg)]() \n\n## Description\n\n**PCRT** (PNG Check \u0026 Repair Tool) is a tool to help check if PNG image correct and try to auto fix the error. It's cross-platform, which can run on **Windows**, **Linux** and **Mac OS**. \n\nIt can:\n\n\tShow image information\n\tFix PNG header error\n\tFix wrong IHDR chunk crc due to error picture's width or height\n\tFix wrong IDAT chunk data length due to DOS-\u003eUNIX conversion\n\tFix wrong IDAT chunk crc due to its own error\n\tFix lost IEND chunk\n\tExtract data after IEND chunk (Malware programs like use this way to hide)\n\tShow the repaired image\n\tInject payload into image\n\tDecompress image data and show the raw image\n\t...\n\tMaybe more in the future :)  \n\n\n## Install\n\n- #### **Install Python 2.7**\n\t- [Python 2.7](https://www.python.org/downloads/)\n\n- #### **Install Python dependency packages**\n\t- Tkinter\n\t- [PIL](https://pypi.python.org/pypi/PIL/1.1.6)\n\t- ctypes (For Windows)\n\n\n- #### **Clone the source code**\n\n\t\tgit clone https://github.com/sherlly/PCRT.git\n\t\tcd PCRT\n\t\tpython PCRT.py\n\n## Usage\n\n\t\u003e python PCRT.py -h\n\tusage: PCRT.py [-h] [-q] [-y] [-v] [-m] [-n NAME] [-p PAYLOAD] [-w WAY]\n                 [-d DECOMPRESS] [-i INPUT] [-f] [-o OUTPUT]\n\n\toptional arguments:\n    -h, --help            show this help message and exit\n    -q, --quiet           don't show the banner infomation\n    -y, --yes             auto choose yes\n    -v, --verbose         use the safe way to recover\n    -m, --message         show the image information\n    -n NAME, --name NAME  payload name [Default: random]\n    -p PAYLOAD, --payload PAYLOAD\n                          payload to hide\n    -w WAY, --way WAY     payload chunk: [1]: ancillary [2]: critical\n                          [Default:1]\n    -d DECOMPRESS, --decompress DECOMPRESS\n                          decompress zlib data file name\n    -i INPUT, --input INPUT\n                          Input file name (*.png) [Select from terminal]\n    -f, --file            Input file name (*.png) [Select from window]\n    -o OUTPUT, --output OUTPUT\n                          Output repaired file name [Default: output.png]\n\n**[Notice]** without `-v` option means that assume all IDAT chunk length are correct\n\n\n## Show\n\n- Window:\n\n![](http://i.imgur.com/Ksk2ctV.png)\n\n- Linux:\n\n![](http://i.imgur.com/ZXnPqYD.png)\n\n- Mac OS:\n\n![](http://i.imgur.com/re4gQux.png)\n\n## Some Problem:\n\n- For Window:\n\n\u003e Can't show the repaired image\n\n1. Find the file named `ImageShow.py` under the path like `X:\\Python27\\lib\\site-packages\\PIL\\ImageShow.py`\n2. Find the code `return \"start /wait %s \u0026\u0026 ping -n 2 127.0.0.1 \u003eNUL \u0026\u0026 del /f %s\" % (file, file)` around line 100 and commented it\n3. Add the new code: `return \"start /wait %s \u0026\u0026 PING 127.0.0.1 -n 5 \u003e NUL \u0026\u0026 del /f %s\" % (file, file)` and save\n4. Restart the python IDE\n\n## Release Log\n\n### version 1.1:\n\n\n**Add：**\n\n- Show image information (`-m`)\n- Inject payload into image (`-p`)\n\t- add into ancillary chunk (chunk name can be randomly generated or self-defined) (`-w 1`)\n\t- add into critical chunk (only support IDAT chunk) (`-w 2`)\n- decompress image data and show the raw image (`-d`)\n\n### version 1.0：\n\n**Feature:**\n\n- Fix PNG header error\n- Fix wrong IHDR chunk crc due to error picture's width or height\n- Fix wrong IDAT chunk data length due to DOS-\u003eUNIX conversion\n- Fix wrong IDAT chunk crc due to its own error\n- Fix lost IEND chunk\n- Extract data after IEND chunk (Malware programs like use this way to hide)\n- Show the repaired image\n---\n\n## 项目描述\n\n**PCRT** (PNG Check \u0026 Repair Tool) 工具旨在实现检查并自动化修复损坏的PNG图像。 支持在**Windows/Linux/Mac OS**平台使用。\n\n它可以实现：\n\n\t显示图片文件信息\n\t修复PNG文件头错误\n\t修复由于错误的图片长度或宽度导致的IHDR块crc校验出错\n\t修复由于DOS-\u003eUNIX平台自动格式转换导致的部分IDAT块数据长度出错\n\t修复由于自身错误导致的IDAT块crc校验出错\n\t修复丢失的IEND块\n\t提取追加在IEND块后的数据（恶意程序常使用的传播方式）\n\t自动显示修复后的图片\n\t添加payload到图片文件\n\t解析图片压缩数据并显示\n\t...\n\t更多功能有待开发：）\n\t\n\n\n## 安装\n\n- #### **安装 Python 2.7**\n\t- [Python 2.7](https://www.python.org/downloads/)\n\n- #### **安装需要的Python 依赖包**\n\t- Tkinter\n\t- [PIL](https://pypi.python.org/pypi/PIL/1.1.6)\n\t- ctypes (For Windows)\n\n\n- #### **拷贝源码到本地**\n\n\t\tgit clone https://github.com/sherlly/PCRT.git\n\t\tcd PCRT\n\t\tpython PCRT.py\n\n## 使用方法\n\n\t\u003e python PCRT.py -h\n\tusage: PCRT.py [-h] [-q] [-y] [-v] [-m] [-n NAME] [-p PAYLOAD] [-w WAY]\n                 [-d DECOMPRESS] [-i INPUT] [-f] [-o OUTPUT]\n\n\toptional arguments:\n    -h, --help            show this help message and exit\n    -q, --quiet           don't show the banner infomation\n    -y, --yes             auto choose yes\n    -v, --verbose         use the safe way to recover\n    -m, --message         show the image information\n    -n NAME, --name NAME  payload name [Default: random]\n    -p PAYLOAD, --payload PAYLOAD\n                          payload to hide\n    -w WAY, --way WAY     payload chunk: [1]: ancillary [2]: critical\n                          [Default:1]\n    -d DECOMPRESS, --decompress DECOMPRESS\n                          decompress zlib data file name\n    -i INPUT, --input INPUT\n                          Input file name (*.png) [Select from terminal]\n    -f, --file            Input file name (*.png) [Select from window]\n    -o OUTPUT, --output OUTPUT\n                          Output repaired file name [Default: output.png]\n\n**[注意]** 如果不添加 `-v` 选项则默认所有IDAT块长度均合法， 即不出现声明的IDAT数据块长度和实际数据长度不符合的情况。\n\n\n## 示例\n\n- Window:\n\n![](http://i.imgur.com/Ksk2ctV.png)\n\n- Linux:\n\n![](http://i.imgur.com/ZXnPqYD.png)\n\n- Mac OS:\n\n![](http://i.imgur.com/re4gQux.png)\n\n## 可能出现的一些问题\n\n- Window下：\n\n\u003e 出现修复后图片无法显示时：\n\n1. 找到Python安装路径下的文件 `X:\\Python27\\lib\\site-packages\\PIL\\ImageShow.py`\n2. 将在100行左右的代码`return \"start /wait %s \u0026\u0026 ping -n 2 127.0.0.1 \u003eNUL \u0026\u0026 del /f %s\" % (file, file)`注释掉\n3. 添加代码：`return \"start /wait %s \u0026\u0026 PING 127.0.0.1 -n 5 \u003e NUL \u0026\u0026 del /f %s\" % (file, file)`并保存\n4. 重启运行python的IDE\n\n## 更新日志\n\n### version 1.1:\n\n\n**增加：**\n\n- 显示图片文件信息（`-m`）\n- 添加payload到图片文件（`-p`）\n\t- 支持添加到辅助块（块名可随机生成或自定义）（`-w 1`）\n\t- 支持添加到关键块（仅支持IDAT）(`-w 2`)\n- 解析图片压缩数据并显示（`-d`）\n\n### version 1.0：\n\n**特性：**\n\n- 实现修复PNG文件头错误\n- 实现修复由于错误的图片长度或宽度导致的IHDR块crc校验出错\n- 实现修复由于DOS-\u003eUNIX平台自动格式转换导致的部分IDAT块数据长度出错\n- 实现修复由于自身错误导致的IDAT块crc校验出错\n- 实现修复丢失的IEND块\n- 实现提取追加在IEND块后的数据（恶意程序常使用的传播方式）\n- 实现自动显示修复后的图片","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastropilot%2Fpcrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastropilot%2Fpcrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastropilot%2Fpcrt/lists"}