Fix crash bugs, remove dev cruft, English README#1
Open
paulpel wants to merge 1 commit into
Open
Conversation
Crash / correctness:
- main.py: choose_disk_image() was called with change=False but takes no such
argument (TypeError on every invalid-image path); call it with no args.
- evidence_metadata.py: header_table/hash_table were only set for EWF images, so
raw images raised UnboundLocalError when building the report — they're now
initialised with defaults. Also removed a redundant duplicate part_metadata()
call and guarded table_1/table_2.
- watermark text used the invalid `fontsize=` kwarg on PIL ImageDraw.text
(evidence_metadata.py, open_evidence.py) — now loads a font (DejaVuSans with a
load_default fallback) and passes font=.
- pdf_analysis.py: registering DejaVuSans from a bare filename crashed when the
.ttf wasn't in the cwd — now falls back to the built-in Helvetica.
- recovery_files.py: replaced the hardcoded `~/infa/Disk-Project/...` output path
(which also created a literal `~` dir) with a RECOVERY_OUTPUT_DIR env var
defaulting to RecoveredDiskImages/, and use os.path.basename instead of a
fragile split("/")[1].
Cleanup:
- remove the `choosen` -> `chosen` typo throughout main.py (also de-duplicates a
dead self.choosen_dir attribute) and a stray debug print.
- evidence_metadata.py: drop the Python-2 `from __future__ import print_function`
shim and duplicate PyPDF2 imports.
- requirements.txt: re-encode UTF-16 -> UTF-8 and add the missing runtime deps
(pdf2image, PyMuPDF, pytz).
- remove notatki.txt (Polish course scratch notes).
- rewrite README in English with setup, system deps, usage and configuration.
Note: not executed here (pytsk3/pyewf + a disk image + foremost/poppler needed);
all five modules pass py_compile. Follow-ups: factor the duplicated EWFImgInfo /
PDF-encrypt helpers into a shared module; broaden find_pdfs beyond dirs named "pdf".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the toolkit actually run, removes course cruft, and documents it in English.
Crash / correctness fixes
choose_disk_image(change=False)was called in 3 places but the method takes nochangeargument →TypeErroron every invalid-image path. Now called with no args.UnboundLocalErroron raw images —header_table/hash_tablewere only set in the EWF branch but always passed to the report builder. They're now initialised with defaults; also removed a redundant duplicatepart_metadata()call.fontsize=kwarg onPIL.ImageDraw.text(evidence_metadata.py,open_evidence.py) → load a font (DejaVuSanswith aload_default()fallback) and passfont=.pdf_analysis.pyregisteredDejaVuSans.ttffrom a bare filename (crashes if not in cwd) → falls back to the built-inHelvetica.recovery_files.pyhardcoded~/infa/Disk-Project/...(and the~was never expanded, creating a literal~dir) →RECOVERY_OUTPUT_DIRenv var defaulting toRecoveredDiskImages/, plusos.path.basenameinstead of a fragilesplit("/")[1].Cleanup
choosen→chosentypo throughoutmain.py(also removes a deadself.choosen_dir), and a stray debugprint.from __future__ import print_functionshim and duplicatePyPDF2imports.requirements.txt: re-encode UTF-16 → UTF-8 and add the missing runtime deps (pdf2image,PyMuPDF,pytz).notatki.txt(Polish course scratch notes).foremost,poppler), usage and configuration.