diff --git a/includes/hex/core.pat b/includes/hex/core.pat new file mode 100644 index 0000000..988d38c --- /dev/null +++ b/includes/hex/core.pat @@ -0,0 +1,29 @@ +#pragma once + +#include + +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; + }; + +} \ No newline at end of file diff --git a/includes/hex/http.pat b/includes/hex/http.pat new file mode 100644 index 0000000..e99cd31 --- /dev/null +++ b/includes/hex/http.pat @@ -0,0 +1,11 @@ +#pragma once + +#include + +namespace hex::http { + + fn get(str url) { + return builtin::hex::http::get(url); + }; + +} \ No newline at end of file diff --git a/includes/hex/impl/imhex_check.pat b/includes/hex/impl/imhex_check.pat new file mode 100644 index 0000000..6ed3c88 --- /dev/null +++ b/includes/hex/impl/imhex_check.pat @@ -0,0 +1,3 @@ +#ifndef __IMHEX__ + #error This library is only available in the ImHex Hex editor +#endif \ No newline at end of file diff --git a/includes/std/http.pat b/includes/std/http.pat deleted file mode 100644 index fdeb323..0000000 --- a/includes/std/http.pat +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -namespace std::http { - - fn get(str url) { - return builtin::std::http::get(url); - }; - -} \ No newline at end of file