Rizin
unix-like reverse engineering framework and cli tools
rz_basefind.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
2 // SPDX-License-Identifier: MIT
3 
4 #ifndef RZ_BASEFIND_H
5 #define RZ_BASEFIND_H
6 
7 #include <rz_core.h>
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #define RZ_BASEFIND_STRING_MIN_LENGTH (10)
14 #define RZ_BASEFIND_BASE_MIN_ADDRESS (0ull)
15 #define RZ_BASEFIND_BASE_MAX_ADDRESS (0xf0000000ull)
16 #define RZ_BASEFIND_BASE_ALIGNMENT (0x1000)
17 #define RZ_BASEFIND_SCORE_MIN_VALUE (1)
18 
19 typedef struct rz_basefind_t {
23 
24 typedef struct rz_basefind_info_t {
32 
33 // Used to provide user information regarding the running threads and to stop the execution when needed.
34 typedef bool (*RzBaseFindThreadInfoCb)(const RzBaseFindThreadInfo *th_info, void *user);
35 
36 typedef struct rz_basefind_options_t {
37  size_t max_threads;
45  void *user;
47 
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif /* RZ_BASEFIND_H */
#define RZ_API
uint32_t ut32
static const char struct stat static buf struct stat static buf static vhangup int options
Definition: sflib.h:145
RZ_API RZ_OWN RzList * rz_basefind(RZ_NONNULL RzCore *core, RZ_NONNULL RzBaseFindOpt *options)
Calculates a list of possible base addresses candidates using the strings position.
Definition: basefind.c:336
bool(* RzBaseFindThreadInfoCb)(const RzBaseFindThreadInfo *th_info, void *user)
Definition: rz_basefind.h:34
struct rz_basefind_info_t RzBaseFindThreadInfo
struct rz_basefind_t RzBaseFindScore
struct rz_basefind_options_t RzBaseFindOpt
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
ut32 n_threads
Total number of search threads.
Definition: rz_basefind.h:25
ut64 current_address
Thread related search address (current).
Definition: rz_basefind.h:28
ut32 percentage
Progress made by the search thread.
Definition: rz_basefind.h:30
ut64 begin_address
Thread related search address (start).
Definition: rz_basefind.h:27
ut32 thread_idx
Sesarch thread number.
Definition: rz_basefind.h:26
ut64 end_address
Thread related search address (end).
Definition: rz_basefind.h:29
void * user
User pointer to pass to the callback function for the thread info.
Definition: rz_basefind.h:45
ut32 pointer_size
Pointer size in bits (32 or 64)
Definition: rz_basefind.h:38
ut64 start_address
Start search address.
Definition: rz_basefind.h:39
ut32 min_string_len
Min string length to search for.
Definition: rz_basefind.h:43
ut32 min_score
Minimum score to reach to be part of the list of possible addresses.
Definition: rz_basefind.h:42
RzBaseFindThreadInfoCb callback
When set allows to get the thread information.
Definition: rz_basefind.h:44
ut64 alignment
Memory alignment in bytes (suggested to set it to RZ_BASEFIND_BASE_ALIGNMENT)
Definition: rz_basefind.h:41
size_t max_threads
Max requested number of threads (not guaranteed).
Definition: rz_basefind.h:37
ut64 end_address
End search address.
Definition: rz_basefind.h:40
ut64 candidate
Candidate physical base address.
Definition: rz_basefind.h:20
ut32 score
Score of the candidate address.
Definition: rz_basefind.h:21
#define bool
Definition: sysdefs.h:146
ut64(WINAPI *w32_GetEnabledXStateFeatures)()