master ohmu/fastfetch-openbsd / src / common / binary.h
ohmu  ·  2026-10-15
 1#pragma once
 2
 3#include "fastfetch.h"
 4
 5/**
 6 * Extracts string literals from a binary file
 7 *
 8 * @param file Path to the binary file to extract strings from
 9 * @param cb Callback function that will be called for each string found
10 *           Return false from callback to stop extraction
11 * @param userdata User-provided data passed to the callback function
12 * @param minLength Minimum length of strings to extract
13 *
14 * @return nullptr on success, error message on failure.
15 * @note This function won't return an error if no strings are found.
16 *       Always check if strings are correctly extracted after this function all.
17 */
18const char* ffBinaryExtractStrings(const char* file, bool (*cb)(const char* str, uint32_t len, void* userdata), void* userdata, uint32_t minLength);