diff options
| author | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
|---|---|---|
| committer | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
| commit | 76424950e373d3b04ac3dd13019151bfba3e8423 (patch) | |
| tree | 4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/common/binary.h | |
Add the files
Diffstat (limited to 'src/common/binary.h')
| -rw-r--r-- | src/common/binary.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/binary.h b/src/common/binary.h new file mode 100644 index 0000000..2d2d784 --- /dev/null +++ b/src/common/binary.h @@ -0,0 +1,18 @@ +#pragma once + +#include "fastfetch.h" + +/** + * Extracts string literals from a binary file + * + * @param file Path to the binary file to extract strings from + * @param cb Callback function that will be called for each string found + * Return false from callback to stop extraction + * @param userdata User-provided data passed to the callback function + * @param minLength Minimum length of strings to extract + * + * @return NULL on success, error message on failure. + * @note This function won't return an error if no strings are found. + * Always check if strings are correctly extracted after this function all. + */ +const char* ffBinaryExtractStrings(const char* file, bool (*cb)(const char* str, uint32_t len, void* userdata), void* userdata, uint32_t minLength); |