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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa8
push ebx
push esi
xor esi, esi
push edi
lea edi, [ebp - 0x4c]
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], esi
call fcn.0040fec0
mov edi, dword [ebp + 8]
push edi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x28], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 0x10]
cmp byte [eax], 0
jne 0x4156aa
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
mov ecx, dword [edi + 0x3c]
sub ecx, dword [edi + 0x38]
lea ebx, [edi + 0x2c]
sar ecx, 6
cmp ecx, 0x7a120
jae 0x415697
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [0x5f8bd8]
push edx
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov dword [ebp - 0x14], esi
call fcn.00416020
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp esi, eax
je 0x41584e
test esi, esi
je 0x41584e
cmp byte [esi], 0
je 0x41584e
call fcn.00416020
mov ecx, dword [eax]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x415718
call fcn.0041e790
lea edx, [ebp - 0x10]
push edx
lea ecx, [ebp - 0x24]
lea eax, [edi + 0x9c]
push ecx
push eax
call fcn.00415ea0
mov edx, dword [edi + 0xb8]
mov eax, dword [edi + 0xa4]
lea esi, [ebp - 0xc]
lea edi, [ebp - 0x24]
mov dword [ebp - 8], edx
mov dword [ebp - 0xc], eax
call fcn.00415ca0
test al, al
je 0x415772
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
push ecx
push ecx
lea edx, [ebp - 0x10]
push edx
add eax, 0x9c
call fcn.00415a90
add esp, 4
mov ecx, eax
call fcn.004159f0
jmp 0x41584b
lea esi, [ebp - 0x44]
call fcn.00415cc0
push 0x5709c0
lea ecx, [ebp - 0xc]
call fcn.00402090
lea esi, [ebp - 0x24]
call fcn.00415c70
add eax, 4
push eax
lea ecx, [ebp - 0x54]
call fcn.0040a970
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 0x54]
push edx
call fcn.004042c0
add esp, 0xc
lea esi, [ebp - 0x54]
lea edi, [ebp - 0x44]
call fcn.00406b30
mov ecx, dword [eax]
mov edx, dword [eax + 4]
lea esi, [ebp - 0x64]
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
call fcn.00406b10
mov esi, dword [eax]
mov ecx, dword [eax + 4]
mov eax, dword [ebp - 8]
push eax
lea eax, [ebp - 0x14]
call fcn.00416c50
mov dword [ebp - 0xc], esi
add esp, 4
lea esi, [ebp - 0x5c]
mov dword [ebp - 8], eax
call fcn.00406b30
mov esi, eax
lea edi, [ebp - 0xc]
call fcn.00408910
test al, al
jne 0x415824
push 0x2c
lea esi, [ebp - 0x24]
call fcn.00415c70
mov ecx, eax
add ecx, 4
call fcn.00405100
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.00415c70
mov ecx, eax
add ecx, 4
call fcn.004106c0
mov eax, dword [ebp - 0x38]
xor esi, esi
cmp eax, esi
je 0x415836
push eax
call fcn.00456e75
add esp, 4
mov edx, dword [ebp - 0x44]
push edx
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x30], esi
call fcn.00456e75
add esp, 4
mov edi, dword [ebp + 8]
mov eax, dword [ebp + 0x28]
test al, 4
je 0x415867
mov ecx, dword [edi + 0xe8]
mov edx, dword [edi + 0xec]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], edx
mov ecx, dword [ebp + 0x20]
mov edx, dword [ebp + 0x1c]
push eax
mov eax, dword [ebp + 0x24]
push eax
mov eax, dword [ebp + 0x18]
mov esi, dword [ebx + 0x10]
push ecx
mov ecx, dword [ebp - 0x18]
sub esi, dword [ebx + 0xc]
push edx
mov edx, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp + 0x14]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
mov edx, dword [ebp + 0xc]
push eax
mov eax, dword [ebp - 0x48]
push ecx
mov ecx, dword [ebp - 0x4c]
push edx
mov edx, dword [ebp - 0x10]
push eax
push ecx
push edx
lea eax, [ebp - 0xa4]
push eax
sar esi, 6
call fcn.00414d70
push ebx
call fcn.00415a20
lea eax, [ebp - 0xa4]
call fcn.00415180
mov ecx, dword [ebx + 0x10]
sub ecx, dword [ebx + 0xc]
and ecx, 0xffffffc0
cmp ecx, 0x1e84800
jne 0x4158de
add edi, 0x24
push edi
lea edi, [ebp - 0x2c]
call fcn.004151b0
mov edi, dword [ebp + 8]
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [ebp - 0x2c]
test edi, edi
je 0x415917
push edi
call dword [ebp - 0x28]
add esp, 4
push 0xffffffffffffffff
add edi, 4
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
sub eax, 1
jne 0x415917
test edi, edi
je 0x415917
lea ecx, [edi - 4]
test ecx, ecx
je 0x415917
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24