The YR_CONFIG_MAX_PROCESS_MEMORY_CHUNK configuration is missing from yara-rust. However, there is a big issue when trying to add it, it's that this configuration uses a u64 value, while all other configs uses a u32.
The current design only works with u32s, where the get_configuration & set_configuration are generic over a config enum, and always retrieve/uses a u32 value.
To add a config that uses a u64 value, there are several possibilities:
Use the same API as YARA: add a get/set_configuration_u32 and a get/set_configuration_u64, both returning an error when not providing the right configuration. I'm not a fan, this doesn't look very rusty at all
Create helpers for each config, using the right value type. This is the design I used.
Main issue is that it breaks backward compat, and it is very verbose. For the moment (and I don't suspect it will change), there is only 4 config parameters, so the verbosity is not that high.
The
YR_CONFIG_MAX_PROCESS_MEMORY_CHUNK
configuration is missing from yara-rust. However, there is a big issue when trying to add it, it's that this configuration uses a u64 value, while all other configs uses a u32.The current design only works with u32s, where the get_configuration & set_configuration are generic over a config enum, and always retrieve/uses a u32 value.
To add a config that uses a u64 value, there are several possibilities:
Use the same API as YARA: add a get/set_configuration_u32 and a get/set_configuration_u64, both returning an error when not providing the right configuration. I'm not a fan, this doesn't look very rusty at all
Use something like this:
or something of that effect
Main issue is that it breaks backward compat, and it is very verbose. For the moment (and I don't suspect it will change), there is only 4 config parameters, so the verbosity is not that high.
Let me know what you think