Function at 0x40f960
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
mov edi, edx
mov edx, 1
push esi
mov esi, ecx
push ebx
sub esp, 0x3c
mov ecx, dword [ecx]
call fcn.00408ef0
mov dword [esp], esi
mov ebp, eax
call fcn.00406db0
test al, al
jne 0x40f9b0
test ebp, ebp
je 0x40f98d
add dword [ebp - 8], 8
mov eax, dword [esi]
cmp eax, 0xfff
jbe 0x40f9b0
mov edx, dword [eax - 8]
lea ecx, [eax - 8]
mov dword [esp + 0x1c], ecx
sub edx, 8
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x40fb60
nop
mov dword [esi], ebp
mov eax, dword [ebp]
mov ebx, 0x5b
mov word [ebp + eax + 8], bx
mov eax, dword [esp + 0x50]
add dword [ebp], 1
mov ecx, dword [eax + 0xc]
mov eax, dword [eax]
mov edx, dword [ecx]
mov ebx, edx
mov dword [esp + 0x20], edx
cdq
idiv ebx
mov dword [esp + 0x1c], eax
test eax, eax
jle 0x40fac6
xor ebp, ebp
jmp 0x40faa2
mov ecx, dword [esi]
mov edx, 2
call fcn.00408c60
mov dword [esp], esi
mov ebx, eax
call fcn.00406db0
test al, al
jne 0x40fa80
test ebx, ebx
je 0x40fa12
add dword [ebx - 8], 8
mov eax, dword [esi]
cmp eax, 0xfff
jbe 0x40fa80
lea edx, [eax - 8]
mov dword [esp + 0x24], edx
mov edx, dword [eax - 8]
lea ecx, [edx - 8]
mov dword [eax - 8], ecx
cmp ecx, 7
ja 0x40fa80
mov eax, dword [0x49c308]
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x28], eax
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
add eax, 0x2c
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00405190
nop
mov dword [esi], ebx
mov eax, dword [ebx]
mov edx, 0x202c
add edi, dword [esp + 0x20]
lea eax, [ebx + eax + 8]
mov word [eax], dx
mov byte [eax + 2], 0
mov eax, dword [esp + 0x50]
add dword [ebx], 2
mov ecx, dword [eax + 0xc]
mov eax, dword [esp + 0x54]
mov dword [esp], ecx
mov edx, edi
mov ecx, esi
add ebp, 1
mov dword [esp + 4], eax
call fcn.0040f4f0
sub esp, 8
cmp dword [esp + 0x1c], ebp
jne 0x40f9f0
mov ecx, dword [esi]
mov edx, 1
call fcn.00408ef0
mov dword [esp], esi
mov ebx, eax
call fcn.00406db0
test al, al
jne 0x40fb02
test ebx, ebx
je 0x40fae8
add dword [ebx - 8], 8
mov eax, dword [esi]
cmp eax, 0xfff
jbe 0x40fb02
mov edi, dword [eax - 8]
lea ebp, [eax - 8]
lea edx, [edi - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x40fb20
mov dword [esi], ebx
mov eax, dword [ebx]
mov ecx, 0x5d
mov word [ebx + eax + 8], cx
add dword [ebx], 1
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov edi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x1c], eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov edi, eax
mov edx, dword [esp + 0x1c]
add edi, 0x2c
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov dword [esp + 4], ebp
mov dword [esp], edi
call fcn.00405190
jmp 0x40fb02
mov ebx, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x20], eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov edx, dword [esp + 0x20]
add ebx, 0x2c
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov ecx, dword [esp + 0x1c]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call fcn.00405190
jmp 0x40f9b0