mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 07:47:02 -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;
|
||||
};
|
||||
|
||||
}
|
||||
11
includes/hex/http.pat
Normal file
11
includes/hex/http.pat
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/impl/imhex_check.pat>
|
||||
|
||||
namespace hex::http {
|
||||
|
||||
fn get(str url) {
|
||||
return builtin::hex::http::get(url);
|
||||
};
|
||||
|
||||
}
|
||||
3
includes/hex/impl/imhex_check.pat
Normal file
3
includes/hex/impl/imhex_check.pat
Normal file
@@ -0,0 +1,3 @@
|
||||
#ifndef __IMHEX__
|
||||
#error This library is only available in the ImHex Hex editor
|
||||
#endif
|
||||
@@ -1,9 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace std::http {
|
||||
|
||||
fn get(str url) {
|
||||
return builtin::std::http::get(url);
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user