Skip to content

Avoid recovered output basename collisions#2

Open
sickn33 wants to merge 2 commits into
Saddytech:mainfrom
sickn33:fix/collision-safe-manifest
Open

Avoid recovered output basename collisions#2
sickn33 wants to merge 2 commits into
Saddytech:mainfrom
sickn33:fix/collision-safe-manifest

Conversation

@sickn33

@sickn33 sickn33 commented Jun 23, 2026

Copy link
Copy Markdown

Summary

  • disambiguate duplicate recovered basenames within each KEK group using a stable source-path hash
  • write a manifest.csv mapping source paths to output paths and per-file recovery status
  • save recovered files via an atomic temp-file replace

Tests

  • python3 tests/test_output_paths.py
  • python3 -m py_compile lockbit-rescue.py verify-recovered.py lockbit-extend.py tests/test_output_paths.py

Copilot AI review requested due to automatic review settings June 23, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the recovery output layout to prevent recovered files from overwriting each other when multiple encrypted inputs share the same basename within a KEK group, and adds a CSV manifest to map each source file to its recovered output and status.

Changes:

  • Add stable basename disambiguation per KEK group by suffixing duplicates with a source-path hash.
  • Write manifest.csv containing source/output/status (and related metadata) for each attempted recovery.
  • Save recovered outputs via an atomic temp-file + os.replace() flow, and add tests for output-path stability + manifest header behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
lockbit-rescue.py Adds collision-safe output naming, manifest writing, and atomic save behavior; updates resume/group logic to use the new output-path mapping.
README.md Documents duplicate-basename handling and the new manifest.csv output.
tests/test_output_paths.py Adds tests validating stable unique output paths for duplicates and manifest header/rows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lockbit-rescue.py
Comment thread lockbit-rescue.py Outdated
Comment thread lockbit-rescue.py
Comment thread lockbit-rescue.py
Comment thread tests/test_output_paths.py Outdated
@sickn33

sickn33 commented Jun 23, 2026

Copy link
Copy Markdown
Author

Addressed Copilot's review in 2a0bf93:

  • use a short fixed-length temp filename for atomic output saves
  • avoid resolving source paths when computing collision hashes, and preserve full fallback paths
  • keep resume progress accounting consistent for existing outputs and oracle-copy failures
  • make the tqdm test stub deterministic

Tests:

  • python3 tests/test_output_paths.py
  • python3 -m py_compile lockbit-rescue.py verify-recovered.py lockbit-extend.py tests/test_output_paths.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants