Small change
This commit is contained in:
parent
31d4abb84a
commit
6159aaea39
@ -23,8 +23,7 @@ namespace tls
|
||||
|
||||
void get_tls_stub(utils::hook::assembler& a)
|
||||
{
|
||||
std::uint8_t bytes[] = {0x65, 0x48, 0x8B, 0x04, 0x25, 0x58, 0x00, 0x00, 0x00}; // mov rax, gs:58h
|
||||
a.embed(bytes, sizeof(bytes));
|
||||
a.mov(rax, seg_ptr(gs, 0x58));
|
||||
a.add(rax, get_tls_index() * 8);
|
||||
a.ret();
|
||||
}
|
||||
|
@ -3,6 +3,13 @@
|
||||
|
||||
#include <MinHook.h>
|
||||
|
||||
Mem seg_ptr(const SReg& segment, const uint64_t off)
|
||||
{
|
||||
auto mem = ptr_abs(off);
|
||||
mem.setSegment(segment);
|
||||
return mem;
|
||||
}
|
||||
|
||||
namespace utils::hook
|
||||
{
|
||||
namespace
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
using namespace asmjit::x86;
|
||||
|
||||
Mem seg_ptr(const SReg& segment, const uint64_t off);
|
||||
|
||||
namespace utils::hook
|
||||
{
|
||||
namespace detail
|
||||
|
Loading…
Reference in New Issue
Block a user