mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-30 22:14:56 +00:00
fix tls patch on windows
based on TlsGetValue in kernel32.dll
This commit is contained in:
parent
b7c3ff932b
commit
f68e2dbd6c
@ -296,9 +296,8 @@ static void GenerateTcbAccess(const ZydisDecodedOperand* operands, Xbyak::CodeGe
|
|||||||
|
|
||||||
// Load the pointer to the table of TLS slots.
|
// Load the pointer to the table of TLS slots.
|
||||||
c.putSeg(gs);
|
c.putSeg(gs);
|
||||||
c.mov(dst, ptr[reinterpret_cast<void*>(teb_offset)]);
|
|
||||||
// Load the pointer to our buffer.
|
// Load the pointer to our buffer.
|
||||||
c.mov(dst, qword[dst + tls_index * sizeof(LPVOID)]);
|
c.mov(dst, ptr[reinterpret_cast<void*>(teb_offset + tls_index * sizeof(LPVOID))]);
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
// The following logic is based on the Darwin implementation of _os_tsd_get_direct, used by
|
// The following logic is based on the Darwin implementation of _os_tsd_get_direct, used by
|
||||||
// pthread_getspecific https://github.com/apple/darwin-xnu/blob/main/libsyscall/os/tsd.h#L89-L96
|
// pthread_getspecific https://github.com/apple/darwin-xnu/blob/main/libsyscall/os/tsd.h#L89-L96
|
||||||
|
Loading…
Reference in New Issue
Block a user