diff options
| author | auth12 <[email protected]> | 2020-07-20 03:09:25 -0700 |
|---|---|---|
| committer | auth12 <[email protected]> | 2020-07-20 03:09:25 -0700 |
| commit | c9e48c5e9eddfe5b7a895fb3940c41ccf75d3e93 (patch) | |
| tree | 2b04471e76f7fb31aff0151b978ece9af4410a8b /client/src/util/util.h | |
| parent | Merge pull request #1 from auth12/windows (diff) | |
| download | loader-c9e48c5e9eddfe5b7a895fb3940c41ccf75d3e93.tar.xz loader-c9e48c5e9eddfe5b7a895fb3940c41ccf75d3e93.zip | |
Syscalls.
Removed asmjit submodule and embedded it instead.
Small PE wrapper.
Diffstat (limited to 'client/src/util/util.h')
| -rw-r--r-- | client/src/util/util.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/client/src/util/util.h b/client/src/util/util.h new file mode 100644 index 0000000..b4bf699 --- /dev/null +++ b/client/src/util/util.h @@ -0,0 +1,26 @@ +#pragma once + +#include "native.h" +#include "pe.h" + +namespace util { + +extern std::unordered_map<std::string, pe::image> loaded_modules; + +std::string wide_to_multibyte(const std::wstring &str); + +native::_PEB *get_peb(); + +bool init(); + +static pe::image& ntdll() { + static pe::image nt{}; + if (!nt) { + nt = loaded_modules["ntdll.dll"]; + nt.parse_exports(); + } + return nt; +} + +}; // namespace util + |