mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
includes/std: Added ptr helpers
This commit is contained in:
15
includes/libstd/ptr.pat
Normal file
15
includes/libstd/ptr.pat
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
namespace std::ptr {
|
||||||
|
|
||||||
|
fn relative_to_pointer(u128 offset) {
|
||||||
|
return $ + offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
fn relative_to_parent(u128 offset) {
|
||||||
|
return addressof(parent) + offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
fn relative_to_end(u128 offset) {
|
||||||
|
return std::mem::size() - offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user