TLS -Rückrufe nicht zu einer Bibliothek hinzufügen

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: TLS -Rückrufe nicht zu einer Bibliothek hinzufügen

by Anonymous » 04 Mar 2025, 09:10

Im Grunde möchte ich meine TLS -Rückrufe in einer LIB haben, in der die PPL, die meine Bibliothek verwenden// .cpp file

void ProtectionSDK::TlsCallback(PVOID hModule, DWORD reason, PVOID reserved)
{
if (reason == DLL_PROCESS_ATTACH) {
if (anti_debug::perform_all_checks()) {
ExitProcess(0); // Terminate the process if a debugger is detected
}
}
}

// Define the TLS callback section
#pragma section(".CRT$XLB", long, read)
__declspec(allocate(".CRT$XLB")) PIMAGE_TLS_CALLBACK _tls_callback[] = { ProtectionSDK::TlsCallback, nullptr };

// Ensure the linker includes the TLS callback
#pragma comment(linker, "/INCLUDE:_tls_callback")
< /code>
// .h file
static void NTAPI TlsCallback(PVOID hModule, DWORD reason, PVOID reserved);
< /code>
I get unresolved external symbol _tls_callback

Top