mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
feat: Added skipping sequences of repeating bytes (#2228)
This PR implements a neat little feature I missed - the ability to jump to the next/previous differing byte, skipping the chunk of repeating bytes. Very useful when you analyze a raw flash dump and want to skip the large sections of `0x00`s/`0xFF`s. Some implementation details worth validating: - I wasn't sure what is the correct place to put the new menu entries into. The possible candidates were `File -> Go to address...` and `Edit -> Follow selection`. I chose the former, although the latter may be a better fit since it already states that the action is related to the selection. Overall, it may be a good moment to refine these menu entries in general. - I didn't add any tests since I'm not sure what is the project's policy for those. Please let me know if I need to add some! - I added the machine-generated translations for the new menu entries which may be considered a questionable thing. Please let me know if you're unhappy with those, I'll drop the commit. Also, thanks for such a nice tool, I use it a lot and was glad to build a new feature for it!
This commit is contained in:
19
plugins/builtin/include/content/differing_byte_searcher.hpp
Normal file
19
plugins/builtin/include/content/differing_byte_searcher.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <hex/providers/provider.hpp>
|
||||
#include <wolv/types.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
void findNextDifferingByte(
|
||||
const std::function< u64(prv::Provider*) >& lastValidAddressProvider,
|
||||
const std::function< bool(u64, u64) >& addressComparator,
|
||||
const std::function< void(u64*) >& addressStepper,
|
||||
bool *didFindNextValue,
|
||||
bool *didReachEndAddress,
|
||||
u64* foundAddress
|
||||
);
|
||||
|
||||
bool canSearchForDifferingByte();
|
||||
}
|
||||
Reference in New Issue
Block a user