> For the complete documentation index, see [llms.txt](https://docs.werwolv.net/pattern-language/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.werwolv.net/pattern-language/libraries/hex/core.pat.md).

# core

Core intrinsic functions to interact with the ImHex Hex Editor

## Types

### `hex::core::Selection`

A type representing a selection in the hex editor

```rust
struct Selection { ... };
```

## Functions

### `hex::core::get_selection`

Returns the current selection in the hex editor

* `return`: The current selection

```rust
fn get_selection();
```

### `hex::core::add_virtual_file`

Add a file to the Virtual Filesystem

* `path`: The name of the file
* `pattern`: The pattern associated with the file

```rust
fn add_virtual_file( path,  pattern);
```
