forked from BasedInc/libhat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff3d6f4
commit 7c0cf5c
Showing
9 changed files
with
73 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Numerics; | ||
|
||
namespace Hat; | ||
|
||
public unsafe class ScanResult | ||
{ | ||
/// <summary> | ||
/// The resulting address from the pattern scan. | ||
/// </summary> | ||
public nint Address { get; } | ||
|
||
internal ScanResult(nint address) | ||
{ | ||
Address = address; | ||
} | ||
|
||
/// <summary> | ||
/// Reads a value of type <typeparamref name="T"/> located at a given offset. | ||
/// </summary> | ||
/// <param name="offset">The offset of the value. Defaults to 0.</param> | ||
public T Read<T>(int offset = 0) where T : unmanaged | ||
{ | ||
return *(T*)(Address + offset); | ||
} | ||
|
||
/// <summary> | ||
/// Resolves a RIP relative address located at a given offset. | ||
/// </summary> | ||
/// <param name="offset">The offset of the relative address.</param> | ||
public nint Relative(int offset) | ||
{ | ||
return Address + Read<int>(offset) + offset + sizeof(int); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+24.5 KB
(260%)
bindings/cs/libhat-sharp/runtimes/win-x64/native/libhat_c.dll
Binary file not shown.
Binary file modified
BIN
+16 KB
(230%)
bindings/cs/libhat-sharp/runtimes/win-x86/native/libhat_c.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters