Function at 0x40858b
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push 0x70
mov eax, 0x41b668
call fcn.0041280d
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
xor ebx, ebx
push ebx
push ebx
push 1
push ebx
mov dword [ebp - 0x40], eax
mov eax, str.struct_HINSTANCE_____stdcall_CHookLoadLibrary::XLLoadLibraryExW_const_wchar_t__void__unsigned_long_
push eax
push 0x420b50
push eax
lea ecx, [ebp - 0x7c]
mov dword [ebp - 0x44], esi
call fcn.00407ab1
mov dword [ebp - 4], ebx
push esi
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x34], ebx
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov byte [ebp - 4], 1
push dword [0x431014]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp eax, ebx
jne 0x408763
cmp dword [ebp + 0x10], ebx
je 0x4085f5
cmp dword [ebp + 0x10], 8
jne 0x408770
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x30], ebx
mov eax, ebp
add eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x30], 0
mov eax, dword [ebp - 0x38]
cmp eax, dword [0x431568]
jl 0x408626
cmp eax, dword [0x431570]
jg 0x408626
mov dword [ebp - 0x30], 1
nop
cmp dword [ebp - 0x30], 1
jne 0x408654
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call fcn.0040816e
pop ecx
test al, al
je 0x408654
push str.mswsock.dll
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_wchar_t_const__]
jmp 0x408770
cmp dword [ebp + 0x10], 8
jne 0x408770
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x3c], 0
mov eax, dword [ebp - 0x38]
cmp eax, dword [0x431564]
jl 0x408682
cmp eax, dword [0x43156c]
jg 0x408682
mov dword [ebp - 0x3c], 1
nop
cmp dword [ebp - 0x3c], 1
jne 0x408770
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::_String_iterator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::begin_void_]
mov esi, eax
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::_String_iterator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::end_void_]
mov edi, eax
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::_String_iterator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::begin_void_]
push dword [sym.imp.MSVCR90.dll_tolower]
push dword [esi + 4]
push dword [esi]
push dword [edi + 4]
push dword [edi]
push dword [eax + 4]
push dword [eax]
lea eax, [ebp - 0x54]
push eax
call fcn.00404ed5
add esp, 0x20
call fcn.004059df
mov ecx, dword [eax + 0x18]
push eax
push ecx
lea ecx, [ebp - 0x4c]
call fcn.00403fed
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x54]
push eax
call fcn.004059df
mov ecx, eax
call fcn.0040512e
mov ecx, eax
call fcn.004027c0
test al, al
je 0x408770
mov esi, 0x420b08
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40873f
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push str.lyc:It_is_an_invalid_hook.Module_name_is__s.
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
push eax
call fcn.00406d6c
add esp, 0xc
xor esi, esi
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.00407d23
mov eax, esi
call fcn.00412890
ret 0xc
push ebx
push dword [0x431014]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [0x431580]
pop ecx
test al, al
je 0x4087cb
cmp dword [0x43157c], ebx
jne 0x4087a5
push dword [ebp + 0x10]
lea ecx, [ebp - 0x2c]
push dword [ebp - 0x40]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [0x431590]
jmp 0x4087c8
push 0xffffffffffffffff
push dword [0x431014]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [ebp + 0x10]
lea ecx, [ebp - 0x2c]
push dword [ebp - 0x40]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call fcn.00408374
mov dword [ebp - 0x34], eax
mov esi, 0x420b08
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x4087f8
push dword [ebp - 0x44]
push dword [ebp - 0x34]
push str.XLLoadLibraryExW_handle:0x_X_dll_name:_s._n
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
push eax
call fcn.00406d6c
add esp, 0x10
mov esi, dword [ebp - 0x34]
jmp 0x408741