Skip to content

Conversation

@bandrel
Copy link
Collaborator

@bandrel bandrel commented Feb 2, 2026

Fixed pathing issues from refactor.

- Add directory existence check in ensure_binary() before attempting make
- Provide clear error message when build directory doesn't exist
- Add troubleshooting section to README.md explaining common hcatPath mistakes
- Add tests for invalid hcatPath scenario and installed tool execution
- Helps users distinguish between hashcat path and hate_crack path

Fixes issue where users set hcatPath to hashcat installation directory
instead of hate_crack repository directory, causing confusing errors.
BREAKING CHANGE: Corrected understanding of hcatPath configuration

- hcatPath should point to hashcat binary location (or omit if in PATH)
- hashcat-utils and princeprocessor are located in hate_crack repo
- Changed code to use hate_path for utilities instead of hcatPath
- Updated error messages to guide users correctly
- Updated README with correct configuration examples
- Asset discovery now properly uses HATE_CRACK_HOME environment variable

This fixes the issue where users had hcatPath pointing to hashcat
installation but the code was looking there for hashcat-utils.
Tests now verify that hashcat-utils are loaded from hate_crack repo
even when hcatPath points to a different directory (like /opt/hashcat).

Why previous tests didn't catch this bug:
- config.json.example has hcatPath = "" (empty)
- Code has fallback: hcatPath = config.get('hcatPath', '') or hate_path
- So hcatPath accidentally defaulted to hate_path during testing
- This masked the bug where utilities incorrectly used hcatPath

Added tests that would have caught this:
- test_hashcat_utils_uses_hate_path_not_hcat_path
- test_config_with_explicit_hashcat_path
- test_readme_documents_correct_usage

Also added code comment documenting the fallback behavior.
Instead of automatically running 'make' when binaries are missing,
now provides clear instructions for users to manually build utilities.

This gives users more control and makes the build process explicit.
Users will see: 'Please build the utilities by running: cd <dir> && make'
Copilot AI review requested due to automatic review settings February 2, 2026 21:10
Copy link

Copilot AI left a comment

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 addresses pathing issues that arose from a previous refactor, focusing on improving asset resolution, config path handling, and menu numbering consistency. The changes enhance the tool's ability to locate required assets (hashcat-utils, princeprocessor) when installed via uv tool install and ensure proper configuration path resolution across different working directories.

Changes:

  • Renumbered menu options from 91-100 to 90-99 for consistency
  • Added comprehensive asset path resolution logic to handle installation scenarios
  • Replaced shell command execution with Python subprocess calls for better cross-platform compatibility
  • Added new test files to verify asset location handling and tool installation behavior

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/test_ui_menu_options.py Updated menu option numbers from 91-100 to 90-99
tests/test_invalid_hcatpath.py New test file for error handling when hcatPath is misconfigured
tests/test_installed_tool_execution.py New test file verifying tool execution from various directories
tests/test_e2e_local_install.py Removed HATE_CRACK_HOME environment variable from test setup
tests/test_asset_path_separation.py New test file verifying hashcat-utils assets are loaded from hate_crack repo
pyproject.toml Added hashcat-utils and princeprocessor to package data
hate_crack/main.py Major refactoring of path resolution, config loading, and subprocess execution
hate_crack/formatting.py New utility module for multi-column list formatting
hate_crack/attacks.py Updated to use new formatting utilities and path resolution
hate_crack/api.py Improved config path resolution using shared helper functions
hate_crack.py Updated menu option numbers from 91-100 to 90-99
config.json.example Changed hcatPath from empty string to placeholder path
TESTING.md Added documentation about asset location requirements
README.md Expanded troubleshooting section with asset path guidance
Makefile Enhanced to handle submodule initialization and asset syncing

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

@bandrel
Copy link
Collaborator Author

bandrel commented Feb 2, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 2, 2026

@bandrel I've opened a new pull request, #68, to work on those changes. Once the pull request is ready, I'll request review from you.

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.

2 participants