GNU General Public License v3.0

项目介绍

PabloLec/RecoverPy 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 GNU General Public License v3.0 许可证,目前获得 1.8k 个 Star、88 次 Fork。

仓库全名
PabloLec/RecoverPy
开源许可证
GNU General Public License v3.0
Star 数
1.8k
Fork 数
88

README 摘要

RecoverPy Scan raw partitions and recover data by inspecting disk blocks directly. 🎬 Demo 🔎 Overview When a file is deleted, its metadata disappears first. The underlying disk blocks often remain intact until they are reused. RecoverPy scans raw partition data directly and searches for byte patterns across the entire device. If the blocks have not been overwritten, fragments of deleted files can still be located…

完整内容见 GitHub 原始 README 或本页 。

常见问题

RecoverPy 用什么语言开发?

主要使用 Python 编写,采用 GNU General Public License v3.0 许可证,目前有 1.8k 个 Star。

RecoverPy 可以免费商用吗?

仓库标注的许可证为 GNU General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 RecoverPy 的源码?

可以直接克隆仓库:git clone https://github.com/PabloLec/RecoverPy.git;安装与运行步骤见仓库 README。

RecoverPy 最近还在维护吗?

仓库最近一次更新为 5月20日,当前没有未关闭的 Issue;Star 数为 1.8k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Interactively find and recover deleted or :point_right: overwritten :point_left: files from your terminal

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

CSS
Python

Release

README

RecoverPy

RecoverPy

Scan raw partitions and recover data by inspecting disk blocks directly.



GitHub release License Downloads Tests


🎬 Demo

RecoverPy Demo

🔎 Overview

When a file is deleted, its metadata disappears first. The underlying disk blocks often remain intact until they are reused.

RecoverPy scans raw partition data directly and searches for byte patterns across the entire device. If the blocks have not been overwritten, fragments of deleted files can still be located by their content.

It lets you inspect matching blocks, navigate adjacent ones, and extract what remains in a straightforward way.

If the blocks are gone, recovery is impossible. If they are still there, RecoverPy helps you retrieve them.


🧭 What you can do

  • Search a partition or disk image for a specific string.
  • Inspect the disk blocks where matches are found.
  • Move across adjacent blocks to recover fragmented data.
  • Select and save useful content.

RecoverPy does not attempt to interpret filesystem structures or restore filenames. It focuses on exposing what remains on disk and making it accessible.


📦 Installation

Requirements

  • Linux
  • Python 3.9+

Accessing raw block devices typically requires sudo.

Using uv

sudo uvx recoverpy

Or install locally:

uv tool install recoverpy
sudo recoverpy

Using pip

python -m pip install recoverpy
sudo recoverpy

▶️ Usage

Start RecoverPy:

sudo recoverpy
  1. Select a partition.
  2. Enter a distinctive search string.
  3. Start the scan.
  4. Open a result.
  5. Inspect and navigate blocks.
  6. Save useful content.

Using a unique identifier, configuration key, or sentence fragment generally produces better results than common words.


⚙️ How it works

RecoverPy operates directly on the raw byte stream of a block device.

The selected partition is opened in read-only mode and scanned sequentially using fixed-size chunks. The scanner processes the stream incrementally, keeping a small overlap between chunks to ensure that matches spanning chunk boundaries are not missed.

Pattern matching is performed at the byte level. For every match, RecoverPy records the exact absolute offset within the device. This offset becomes the reference point for block inspection and navigation.

Block reads are performed using explicit offsets rather than relying on filesystem abstractions. This allows precise access to adjacent blocks without loading large portions of the device into memory.

The entire scan is streaming-based and memory-bounded: RecoverPy never loads the full partition into memory.


⚠️ Limitations

RecoverPy works on raw data. It does not reconstruct files automatically or infer file boundaries.

Results may be partial or fragmented. If the underlying blocks have already been overwritten, recovery is not possible.

Accessing block devices typically requires sudo. To reduce the risk of further overwriting, avoid writing to the target partition during recovery and unmount it when possible.


🤝 Contributing

If you run into a bug or think something could be improved, feel free to open an issue. And if you’d like to work on it yourself, pull requests are always appreciated.


🛠 Development

Project structure:

  • recoverpy/ui/ — Textual interface
  • recoverpy/lib/search/ — streaming search engine
  • recoverpy/lib/storage/ — block and device access
  • recoverpy/lib/text/ — decoding utilities
  • tests/ — unit and integration tests

Setup

uv sync --dev

Run locally

sudo uv run recoverpy

Run tests

uv run pytest -q

评论

暂无评论