feature (utils): Implemented a function to resolve symbols by their name
This commit is contained in:
parent
66006032b9
commit
437d7ba819
|
@ -38,6 +38,7 @@ typedef struct {
|
||||||
uint64_t address;
|
uint64_t address;
|
||||||
} symbol_T;
|
} symbol_T;
|
||||||
|
|
||||||
|
symbol_T* symbol_resolve_from_name (symbol_T* symbols, uint64_t num_symbols, string_t name);
|
||||||
symbol_T* symbol_resolve_function_from_rip (symbol_T* symbols, uint64_t num_symbols, uint64_t rip);
|
symbol_T* symbol_resolve_function_from_rip (symbol_T* symbols, uint64_t num_symbols, uint64_t rip);
|
||||||
|
|
||||||
#endif //NOX_SYMBOLS_H
|
#endif //NOX_SYMBOLS_H
|
||||||
|
|
|
@ -23,6 +23,16 @@
|
||||||
|
|
||||||
#include "utils/symbol.h"
|
#include "utils/symbol.h"
|
||||||
|
|
||||||
|
symbol_T* symbol_resolve_from_name(symbol_T* symbols, uint64_t num_symbols, string_t name) {
|
||||||
|
for (uint64_t i = 0; i < num_symbols; i++) {
|
||||||
|
if (string_compare(name, symbols[i].name)) {
|
||||||
|
return &symbols[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
symbol_T* symbol_resolve_function_from_rip(symbol_T* symbols, uint64_t num_symbols, uint64_t rip) {
|
symbol_T* symbol_resolve_function_from_rip(symbol_T* symbols, uint64_t num_symbols, uint64_t rip) {
|
||||||
symbol_T* symbol = NULL;
|
symbol_T* symbol = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue