mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
feat: Added LEB128 in data inspector (#615)
* feat: Added LEB128 in data inspector * feat: Added support for editing LEB128 values * Moved LEB functions from utils.cpp to crypto.cpp * Added placeholders for translations * Made DataInspector::impl::Entry.maxSize mandatory * Fixed undefined leftshifting behaviour
This commit is contained in:
@@ -206,6 +206,7 @@ namespace hex {
|
||||
struct Entry {
|
||||
std::string unlocalizedName;
|
||||
size_t requiredSize;
|
||||
size_t maxSize;
|
||||
impl::GeneratorFunction generatorFunction;
|
||||
std::optional<impl::EditingFunction> editingFunction;
|
||||
};
|
||||
@@ -213,6 +214,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
void add(const std::string &unlocalizedName, size_t requiredSize, impl::GeneratorFunction displayGeneratorFunction, std::optional<impl::EditingFunction> editingFunction = std::nullopt);
|
||||
void add(const std::string &unlocalizedName, size_t requiredSize, size_t maxSize, impl::GeneratorFunction displayGeneratorFunction, std::optional<impl::EditingFunction> editingFunction = std::nullopt);
|
||||
|
||||
std::vector<impl::Entry> &getEntries();
|
||||
}
|
||||
|
||||
@@ -39,6 +39,11 @@ namespace hex::crypt {
|
||||
std::vector<u8> decode16(const std::string &input);
|
||||
std::string encode16(const std::vector<u8> &input);
|
||||
|
||||
i128 decodeSleb128(const std::vector<u8> &bytes);
|
||||
u128 decodeUleb128(const std::vector<u8> &bytes);
|
||||
std::vector<u8> encodeSleb128(i128 value);
|
||||
std::vector<u8> encodeUleb128(u128 value);
|
||||
|
||||
enum class AESMode : u8 {
|
||||
ECB = 0,
|
||||
CBC = 1,
|
||||
|
||||
Reference in New Issue
Block a user