-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
19 changed files
with
223 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
#include <PatternScanConfig.h> | ||
|
||
struct FunctionScanConfig { | ||
PatternScanConfig mScanConfig; | ||
size_t mDefSize; | ||
}; |
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,52 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <unordered_map> | ||
#include <variant> | ||
#include <string> | ||
#include <iterator> | ||
|
||
namespace MHTR { | ||
using Metadata = std::variant<std::string, uint64_t>; | ||
using MetadataMap = std::unordered_map<std::string, Metadata>; | ||
|
||
class MetadataProvider { | ||
public: | ||
inline MetadataProvider() | ||
{} | ||
|
||
inline MetadataProvider(MetadataMap&& metadatas) | ||
: mMetadatas(std::move(metadatas)) | ||
{} | ||
|
||
inline MetadataProvider(MetadataProvider&& other) noexcept { | ||
mMetadatas = std::move(other.mMetadatas); | ||
} | ||
|
||
inline uint64_t GetOffset(const std::string& key) | ||
{ | ||
return std::get<uint64_t>(mMetadatas[key]); | ||
} | ||
|
||
inline std::string GetPattern(const std::string& key) | ||
{ | ||
return std::get<std::string>(mMetadatas[key]); | ||
} | ||
|
||
inline MetadataProvider& operator+(MetadataProvider&& other) | ||
{ | ||
*this += std::move(other); | ||
return *this; | ||
} | ||
|
||
inline void operator+=(MetadataProvider&& other) | ||
{ | ||
for (auto& [key, value] : other.mMetadatas) { | ||
mMetadatas[key] = std::move(value); | ||
} | ||
other.mMetadatas.clear(); | ||
} | ||
|
||
MetadataMap mMetadatas; | ||
}; | ||
} |
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
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,11 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
namespace Dummy { | ||
constexpr auto BarPattern = "42 00 ? B9"; | ||
constexpr uint64_t BarPatternResult = 0x1A94; | ||
constexpr uint64_t Baz = 0x2640; | ||
constexpr uint64_t Foo = 0x15B0; | ||
constexpr uint64_t Bar = 0x42; | ||
} |
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,8 @@ | ||
Dummy: | ||
{ | ||
BarPattern: "42 00 ? B9" | ||
BarPatternResult: 0x1a94 | ||
Baz: 0x2640 | ||
Foo: 0x15b0 | ||
Bar: 0x42 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
add_executable(MHCLI main.cpp "MH.cpp") | ||
add_executable(MHCLI main.cpp MH.cpp) | ||
|
||
target_link_libraries(MHCLI MetadataHunter cxxopts BSThreadPool) |
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
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
Oops, something went wrong.