Function at 0x40db2a
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, edx
mov edx, 1
push edi
mov edi, ecx
push esi
push ebx
mov ebx, 0x22
sub esp, 0x2c
mov ecx, dword [ecx]
call fcn.00408ef0
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov edx, dword [eax]
mov word [eax + edx + 8], bx
add dword [eax], 1
test ebp, ebp
je 0x40dc90
mov eax, dword [ebp]
mov dword [esp + 0x10], eax
test eax, eax
jle 0x40dc90
xor ebx, ebx
mov esi, ebp
lea esi, [esi]
cmp ebx, eax
jae 0x40dcbe
movzx ebp, byte [esi + ebx + 8]
mov ecx, dword [edi]
mov eax, ebp
movsx edx, al
mov dword [esp + 0x14], edx
test al, al
js 0x40dbf0
lea eax, [ebp - 7]
cmp al, 0x77
ja case.0x40d92a.7
movzx eax, al
jmp dword [eax*4 + 0x473604]
mov edx, dword [esp + 0x14]
call fcn.00408ff0
mov ecx, edi
mov edx, eax
call fcn.00406e10
lea esi, [esi]
mov eax, dword [esp + 0x10]
add ebx, 1
cmp eax, dword [esi]
je 0x40d965
mov ecx, 0x473a20
call fcn.00401700
cmp dword [esp + 0x10], ebx
jle 0x40dc90
mov eax, dword [esi]
jmp 0x40d900
mov edx, 2
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov ecx, 0x785c
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], cx
mov byte [edx + 2], 0
add dword [eax], 2
mov eax, dword [esp + 0x14]
mov ecx, dword [edi]
sar eax, 4
movsx edx, byte [eax + 0x473a90]
call fcn.00408ff0
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, ebp
mov ecx, dword [edi]
and eax, 0xf
movsx edx, byte [eax + 0x473a90]
call fcn.00408ff0
mov ecx, edi
mov edx, eax
call fcn.00406e10
jmp 0x40d950
mov edx, 2
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov ecx, 0x665c
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], cx
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
mov ebp, 0x765c
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], bp
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov ecx, 0x6e5c
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], cx
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
mov ebp, 0x745c
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], bp
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov ecx, 0x655c
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], cx
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
mov ebp, 0x635c
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], bp
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov ecx, 0x625c
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], cx
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
mov ebp, 0x615c
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], bp
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
mov ebp, 0x5c5c
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], bp
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov ecx, 0x275c
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], cx
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
mov edx, 2
mov ebp, 0x225c
call fcn.00408c60
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], bp
mov byte [edx + 2], 0
add dword [eax], 2
jmp 0x40d950
call fcn.00408ff0
mov dword [esp], edi
mov ebp, eax
call fcn.00406db0
test al, al
jne 0x40dc80
test ebp, ebp
je 0x40dc0b
add dword [ebp - 8], 8
mov eax, dword [edi]
cmp eax, 0xfff
jbe 0x40dc80
lea ecx, [eax - 8]
mov dword [esp + 0x14], ecx
mov ecx, dword [eax - 8]
lea edx, [ecx - 8]
mov dword [eax - 8], edx
cmp edx, 7
ja 0x40dc80
mov eax, dword [0x49c308]
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x18]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x18], eax
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
add eax, 0x2c
mov dword [esp + 4], ecx
mov dword [esp], eax
call fcn.00405190
lea esi, [esi]
nop
mov dword [edi], ebp
jmp 0x40d950
mov ecx, dword [edi]
mov edx, 1
call fcn.00408ef0
mov ecx, edi
mov edx, eax
call fcn.00406e10
mov eax, dword [edi]
mov ecx, 0x22
mov edx, dword [eax]
mov word [eax + edx + 8], cx
add dword [eax], 1
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
sub eax, 1
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.0040a570
lea esi, [esi]