Skip to content

Comments

Port /h and /s to RzSearch.#4995

Merged
notxvilka merged 5 commits intorizinorg:devfrom
Rot127:rz-search-s
Mar 15, 2025
Merged

Port /h and /s to RzSearch.#4995
notxvilka merged 5 commits intorizinorg:devfrom
Rot127:rz-search-s

Conversation

@Rot127
Copy link
Member

@Rot127 Rot127 commented Mar 12, 2025

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository.
  • I made sure to follow the project's coding style.
  • I've documented every RZ_API function and struct this PR changes.
  • I've added tests that prove my changes are effective (required for changes to RZ_API).
  • I've updated the Rizin book with the relevant information (if needed).

Detailed description

Ports the /s (calculate blocks entropies and select those above a threshold) and /h to RzSearch and RzShell command /ce.

  • Add /ch command for hash search and an /ce alias for entropy_fract search.
  • Adds the block size as command to /ch. So the command no loner depends on core->blocksize.
  • Extends RzSearchHit with details. They can be set arbitrary by the search and printed as well. For the entropy search this is the fractured entropy value.

Test plan

Added

Closing issues

...

@Rot127 Rot127 changed the title Port /s to /cs and new RzSearch. Port /s to /ce and new RzSearch. Mar 13, 2025
@Rot127 Rot127 marked this pull request as ready for review March 13, 2025 17:58
@Rot127 Rot127 mentioned this pull request Mar 12, 2025
19 tasks
@Rot127 Rot127 changed the title Port /s to /ce and new RzSearch. Port /s to /ce and new RzSearch. Mar 13, 2025
@Rot127 Rot127 force-pushed the rz-search-s branch 3 times, most recently from 2a1a80c to ab03688 Compare March 13, 2025 19:54
@Rot127 Rot127 marked this pull request as draft March 14, 2025 11:58
Copy link
Member

@wargio wargio left a comment

Choose a reason for hiding this comment

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

For the entropy I would forbid it in the hash command and have 3 new commands to which checks if entropy is less than/equal/greater than

Rot127 added 4 commits March 15, 2025 07:29
This is important because it is required to setup a hasher.
RzHash is normally initialized with all hash-plugins and owned by RzCore.
So, if several threads need to hash data, RzHash becomes shared data.
And immutability has to be ensured.
@Rot127 Rot127 marked this pull request as ready for review March 15, 2025 12:38
@Rot127 Rot127 changed the title Port /s to /ce and new RzSearch. Port /h and /s to RzSearch. Mar 15, 2025
@Rot127
Copy link
Member Author

Rot127 commented Mar 15, 2025

For the entropy I would forbid it in the hash command and have 3 new commands to which checks if entropy is less than/equal/greater than

Equal wouldn't work too well due to rounding errors. The less than case is nice. But can I open an issue about this please? I have too many other tasks to take care of currently.

@wargio
Copy link
Member

wargio commented Mar 15, 2025

Yes. If you want we can merge it as is and I can just fix this with a pr.
Potentially this can be just a search between x and y values.

@wargio
Copy link
Member

wargio commented Mar 15, 2025

Ah this probably should be implemented for entropy and fractional entropy

- Adds the new command /ch for hash searches and the alias /ce for /s.
- Adds search hit details to the entropy hits.
@Rot127
Copy link
Member Author

Rot127 commented Mar 15, 2025

Yes. If you want we can merge it as is and I can just fix this with a pr.
Potentially this can be just a search between x and y values.
Ah this probably should be implemented for entropy and fractional entropy

Sounds good to me.

@wargio
Copy link
Member

wargio commented Mar 15, 2025

Please rebase

@notxvilka notxvilka merged commit 9baa16f into rizinorg:dev Mar 15, 2025
45 checks passed
@Rot127 Rot127 deleted the rz-search-s branch March 15, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants