This repository has been archived on 2023-09-28. You can view files and clone it, but cannot push or open issues or pull requests.
homepage/content/projects/noxos/docs/codebase/utils/symbol.h.md

24 lines
1.5 KiB
Markdown
Raw Normal View History

---
title: "symbol.h"
summary: "basic functions to define and resolve symbols"
---
#### `symbol_type_E` - enum
- **Function**
- **Variable**
- **Unknown**
#### `symbol_T` - struct
| Name | Type | Description |
|---------|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| name | [string_t](https://nerdcult.net/projects/noxos/docs/codebase/utils/string.h/#string_t---typedef) | The name of the symbol (e.g. the name of the kernels entry symbol would be `_start` |
| type | [symbol_type_E](https://nerdcult.net/projects/noxos/docs/codebase/utils/symbol.h/#symbol_type_e---enum) | The symbols type (elf types like `File` are of type `Unknown`) |
| address | uint64_t | The symbols address |
#### `symbol_resolve_from_name(symbols, num_symbols, name);` - function (symbol_T*)
This searches **_symbols_** for a symbol with a matching **_name_**.
#### `symbol_resolve_from_rip(symbols, num_symbols, rip);` - function (symbol_T*)
Give it a list of **_symbols_** and an instruction pointer (**_rip_**) and it will return the symbol (function), where **_rip_** lays in.