Function at 0x40fe60
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, ecx
push edi
push esi
push ebx
sub esp, 0x3c
mov ecx, dword [ecx]
mov dword [esp + 0x18], edx
mov edx, 1
mov esi, dword [esp + 0x50]
call fcn.00408ef0
mov dword [esp], ebp
mov edi, eax
call fcn.00406db0
test al, al
jne 0x40fec0
test edi, edi
je 0x40fe93
add dword [edi - 8], 8
mov eax, dword [ebp]
cmp eax, 0xfff
jbe 0x40fec0
mov ebx, dword [eax - 8]
lea ecx, [eax - 8]
mov dword [esp + 0x14], ecx
lea edx, [ebx - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x410110
lea esi, [esi]
lea esi, [esi]
mov dword [ebp], edi
mov eax, dword [edi]
mov ebx, 0x5b
mov byte [esp + 0x14], 1
mov word [edi + eax + 8], bx
add dword [edi], 1
test esi, esi
je 0x41005d
nop
mov eax, dword [esp + 0x54]
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x2c]
mov dword [esp + 0x2c], 0
mov dword [esp + 4], eax
mov eax, dword [esi + 0x10]
mov dword [esp], eax
call fcn.0040fbb0
sub esp, 8
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x410052
mov edx, dword [eax]
test edx, edx
jle 0x410052
cmp byte [esp + 0x14], 0
mov ecx, dword [ebp]
jne 0x40ff98
mov edx, 2
call fcn.00408c60
mov dword [esp], ebp
mov edi, eax
call fcn.00406db0
test al, al
jne 0x40ff70
test edi, edi
je 0x40ff46
add dword [edi - 8], 8
mov eax, dword [ebp]
cmp eax, 0xfff
jbe 0x40ff70
mov ebx, dword [eax - 8]
lea ecx, [eax - 8]
mov dword [esp + 0x14], ecx
lea edx, [ebx - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x4100c0
lea esi, [esi]
mov dword [ebp], edi
mov eax, dword [edi]
mov edx, 0xa2c
lea eax, [edi + eax + 8]
mov word [eax], dx
xor edx, edx
mov byte [eax + 2], 0
add dword [edi], 2
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40ff98
mov edx, dword [eax]
lea esi, [esi]
mov ecx, dword [ebp]
call fcn.00408ef0
mov dword [esp], ebp
mov ebx, eax
call fcn.00406db0
test al, al
jne 0x410020
test ebx, ebx
je 0x40ffb6
add dword [ebx - 8], 8
mov eax, dword [ebp]
cmp eax, 0xfff
jbe 0x410020
mov edi, dword [eax - 8]
lea ecx, [eax - 8]
mov dword [esp + 0x14], ecx
lea edx, [edi - 8]
mov dword [eax - 8], edx
cmp edx, 7
ja 0x410020
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 ecx, dword [esp + 0x14]
mov dword [esp], edi
mov dword [esp + 4], ecx
call fcn.00405190
lea esi, [esi]
lea esi, [esi]
mov edi, dword [esp + 0x2c]
mov dword [ebp], ebx
mov byte [esp + 0x14], 0
test edi, edi
je 0x410052
mov eax, dword [ebx]
lea ecx, [edi + 8]
lea edx, [ebx + eax + 8]
mov eax, dword [edi]
mov dword [esp + 4], ecx
mov dword [esp], edx
add eax, 1
mov dword [esp + 8], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [edi]
add dword [ebx], eax
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x40fee0
mov ecx, dword [ebp]
mov edx, 1
call fcn.00408ef0
mov dword [esp], ebp
mov ebx, eax
call fcn.00406db0
test al, al
jne 0x41009f
test ebx, ebx
je 0x410080
add dword [ebx - 8], 8
mov eax, dword [ebp]
cmp eax, 0xfff
jbe 0x41009f
mov esi, dword [eax - 8]
lea edi, [eax - 8]
lea edx, [esi - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x410160
mov dword [ebp], 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 ebx, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x1c], eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov edx, dword [esp + 0x1c]
add ebx, 0x2c
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov ecx, dword [esp + 0x14]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call fcn.00405190
jmp 0x40ff70
mov ebx, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x1c], eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov edx, dword [esp + 0x1c]
add ebx, 0x2c
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov ecx, dword [esp + 0x14]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call fcn.00405190
jmp 0x40fec0
mov esi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov edx, dword [esp + 0x14]
add esi, 0x2c
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.00405190
jmp 0x41009f