Function at 0x45ce60
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov edi, dword [ebp + 8]
mov eax, dword [0x526014]
xor eax, ebp
mov dword [ebp - 0x10], eax
test edi, edi
je 0x45d06b
cmp dword [0x528cf0], 0xe69e32f3
jne 0x45d06e
mov edx, dword [edi + 8]
lea esi, [edx + 0x1c8]
mov byte [ebp - 0x11], 0xff
cmp byte [edi + 3], 0
mov eax, esi
mov dword [ebp - 0x1c], esi
je 0x45d071
mov edx, 0x20
mov ecx, 0x20
test eax, eax
je 0x45cebe
bsr ecx, eax
xor ecx, 0x1f
sub edx, ecx
mov cl, byte [edx + 0x5195a0]
mov esi, eax
shr esi, cl
and esi, 3
and eax, dword [edx*4 + 0x5195c4]
lea ecx, [esi + edx*4]
cmp eax, 1
sbb ecx, 0xffffffff
movzx esi, word [ecx + ecx + 0x519494]
shl esi, 5
lea eax, [edi + esi]
add eax, 0x48
mov dword [ebp - 0x20], eax
lea ecx, [edi + 0x40]
xor ebx, ebx
inc ebx
xor edi, edi
mov eax, dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov dword [ebp - 0x18], ecx
push ecx
call eax
test al, al
je 0x45d031
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
mov edi, dword [eax]
test edi, edi
je 0x45cfe0
mov byte [ebp - 0x11], 0
mov edx, dword [edi]
test edx, edx
je 0x45cfd6
mov ebx, dword [ebp + 8]
mov ecx, dword [ebx + esi + 0x54]
bswap edx
mov esi, edx
xor esi, edi
cmp esi, 0x1fffff
ja 0x45d066
mov esi, edx
and esi, 0x1fc000
je 0x45d066
prefetcht0 byte [edx]
mov dword [eax], edx
mov ecx, dword [eax + 0xc]
lea edx, [ecx + 2]
and edx, 0x3ffe
and ecx, 0xffffc001
or ecx, edx
mov dword [eax + 0xc], ecx
mov eax, dword [eax + 8]
mov ecx, dword [ebx + 0x8fc]
add ecx, dword [eax + 0xc]
mov eax, dword [ebx + 0x900]
mov dword [ebx + 0x8fc], ecx
cmp eax, ecx
cmovae ecx, eax
mov dword [ebx + 0x900], ecx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, edi
push ebx
call fcn.00487370
push edi
push dword [0x539054]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [0x52a234]
mov ecx, dword fs:[0x2c]
mov eax, dword [ecx + eax*4]
mov dword [eax + 0x90], edi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004948c8
mov eax, edi
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret
xor edx, edx
mov ebx, dword [ebp + 8]
jmp 0x45cf53
lea eax, [ebp - 0x11]
push eax
push 0x4000
push dword [ebp - 0x1c]
push 2
mov ebx, dword [ebp + 8]
push ebx
call fcn.004672f0
test eax, eax
je 0x45d0c0
mov edi, eax
mov ecx, eax
and ecx, 0xffe00000
mov edx, eax
shr edx, 9
and edx, 0xfe0
lea eax, [edx + ecx]
movzx ecx, byte [edx + ecx + 0x101e]
and ecx, 0x3f
shl ecx, 5
sub eax, ecx
add eax, 0x1000
jmp 0x45cf6c
mov eax, ebx
test ebx, ebx
jle 0x45d03e
pause
dec eax
jne 0x45d037
add edi, ebx
mov ecx, dword [ebp - 0x18]
add ebx, ebx
cmp ebx, 0x10
mov eax, 0x10
cmovge ebx, eax
cmp edi, 0x40
mov eax, dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
jl 0x45cf01
call fcn.0045d0e0
jmp 0x45cf0c
call fcn.004be700
int3
int3
lea ecx, [edx + 0xc7]
mov eax, esi
cmp ecx, 0x7fefe
ja 0x45ceaa
xor ecx, ecx
cmp esi, 1
sbb ecx, ecx
or ecx, 0x20
add edx, 0x1c7
je 0x45d0b9
bsr eax, edx
xor eax, 0x1f
sub ecx, eax
xor edx, edx
inc edx
shl edx, cl
mov eax, edx
shr eax, 1
lea eax, [eax + eax*4]
shr eax, 2
cmp eax, dword [ebp - 0x1c]
cmovb eax, edx
jmp 0x45ceaa
mov eax, 0x20
jmp 0x45d09d
xor edi, edi
jmp 0x45cf8f