mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
includes/hex: Added library files
This commit is contained in:
29
includes/hex/core.pat
Normal file
29
includes/hex/core.pat
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/impl/imhex_check.pat>
|
||||
|
||||
namespace hex::core {
|
||||
|
||||
struct Selection {
|
||||
bool valid;
|
||||
u64 address, size;
|
||||
};
|
||||
|
||||
fn get_selection() {
|
||||
u128 result = builtin::hex::core::get_selection();
|
||||
|
||||
Selection result;
|
||||
if (result == u128(-1)) {
|
||||
result.valid = false;
|
||||
result.address = 0x00;
|
||||
result.size = 0x00;
|
||||
} else {
|
||||
result.valid = true;
|
||||
result.address = result >> 64;
|
||||
result.size = result & u64(-1);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user