Core file handling and execution API for Baseer.
More...
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <stdbool.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include "linenoise.h"
Go to the source code of this file.
|
#define | BASEER_VERSION_MAJOR 0 |
#define | BASEER_VERSION_MINOR 2 |
#define | BASEER_VERSION_MICRO 0 |
#define | STRINGIFY(x) |
#define | TOSTRING(x) |
#define | BASEER_VERSION |
#define | BASEER_MAX_FILE_SIZE 1024 * 1024 * 4 |
#define | RETURN_NULL_IF(con) |
#define | BASEER_BASE_OFFSET(b, i, sf) |
#define | COLOR_RESET "\033[0m" |
#define | COLOR_BLACK "\033[30m" |
#define | COLOR_GRAY "\033[90m" |
#define | COLOR_RED "\033[31m" |
#define | COLOR_GREEN "\033[32m" |
#define | COLOR_YELLOW "\033[33m" |
#define | COLOR_BLUE "\033[34m" |
#define | COLOR_MAGENTA "\033[35m" |
#define | COLOR_CYAN "\033[36m" |
#define | COLOR_WHITE "\033[37m" |
#define | COLOR_BBLACK "\033[1;30m" |
#define | COLOR_BRED "\033[1;31m" |
#define | COLOR_BGREEN "\033[1;32m" |
#define | COLOR_BYELLOW "\033[1;33m" |
#define | COLOR_BBLUE "\033[1;34m" |
#define | COLOR_BMAGENTA "\033[1;35m" |
#define | COLOR_BCYAN "\033[1;36m" |
#define | COLOR_BWHITE "\033[1;37m" |
#define | COLOR_BG_BLACK "\033[40m" |
#define | COLOR_BG_RED "\033[41m" |
#define | COLOR_BG_GREEN "\033[42m" |
#define | COLOR_BG_YELLOW "\033[43m" |
#define | COLOR_BG_BLUE "\033[44m" |
#define | COLOR_BG_MAGENTA "\033[45m" |
#define | COLOR_BG_CYAN "\033[46m" |
#define | COLOR_BG_WHITE "\033[47m" |
#define | MAX_INPUT_ARGS 20 |
#define | DEFAULT_BLOCK_LENGTH 16 |
#define | BLOCK_LENGTH (get_block_length()) |
|
typedef struct baseer_target_t | baseer_target_t |
| Struct representing a file target in memory or streaming mode.
|
typedef bool(* | baseer_callback_t) (baseer_target_t *, void *arg) |
| Callback function type for file analysis.
|
|
enum | baseer_mode_t { BASEER_MODE_MEMORY
, BASEER_MODE_STREAM
, BASEER_MODE_BOTH
} |
| Enum representing file access modes.
|
Core file handling and execution API for Baseer.
Provides memory and streaming file access, as well as execution of analysis tools using a unified callback interface.
◆ BASEER_BASE_OFFSET
#define BASEER_BASE_OFFSET |
( |
| b, |
|
|
| i, |
|
|
| sf ) |
◆ BASEER_MAX_FILE_SIZE
#define BASEER_MAX_FILE_SIZE 1024 * 1024 * 4 |
Max file size for memory mode
◆ BASEER_VERSION
Value: TOSTRING(BASEER_VERSION_MAJOR) "." \
TOSTRING(BASEER_VERSION_MINOR) "." \
TOSTRING(BASEER_VERSION_MICRO)
◆ RETURN_NULL_IF
#define RETURN_NULL_IF |
( |
| con | ) |
|
Value: if ((con)) \
{ \
return NULL; \
}
◆ STRINGIFY
◆ TOSTRING
◆ baseer_callback_t
Callback function type for file analysis.
- Parameters
-
target | Pointer to the file target |
arg | Additional user argument |
- Returns
- true on success, false on failure
◆ baseer_close()
Close a file target and free associated resources.
- Parameters
-
target | Pointer to the file target |
◆ baseer_execute()
Execute a callback on a file target.
- Parameters
-
target | Pointer to the file target |
callback | Callback function |
arg | Additional argument |
- Returns
- true on success, false on failure
◆ baseer_open()
Open a file in specified mode (memory, streaming, or both)
- Parameters
-
file_path | Path to the file |
mode | Access mode (MEMORY, STREAM, BOTH) |
- Returns
- Pointer to baseer_target_t on success, NULL on failure
◆ baseer_print()
Print a hex dump of the file target.
- Parameters
-
target | Pointer to the file target |