Function at 0x407d20
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov eax, ecx
push edi
add eax, 0x14b8
push esi
push ebx
lea ebx, [ecx + 0x10b8]
sub esp, 0x4c
mov byte [ecx + 0x14c8], 1
mov dword [esp + 0x20], ecx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x38]
mov eax, dword [eax]
mov dword [esp + 0x24], eax
test eax, eax
je 0x406bb4
mov dword [esp + 0x28], 0
lea esi, [esi]
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x24]
mov esi, dword [edi + eax*4 + 8]
shl eax, 5
mov ebp, eax
test esi, esi
jne 0x406a43
jmp 0x406b90
add ebp, 1
shr esi, 1
je 0x406b90
test esi, 1
je 0x406a38
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x20]
mov eax, dword [eax + 4]
mov ecx, eax
mov dword [esp + 0x1c], eax
shl ecx, 9
or ecx, ebp
mov edx, ecx
sar edx, 9
movzx eax, dl
mov eax, dword [edi + eax*4 + 0x10b8]
test eax, eax
jne 0x406a86
jmp 0x406a38
mov eax, dword [eax]
test eax, eax
je 0x406a38
cmp dword [eax + 4], edx
jne 0x406a80
mov edx, ecx
mov ebx, 1
and edx, 0x1ff
shl ebx, cl
sar edx, 5
and ebx, dword [eax + edx*4 + 8]
je 0x406a38
shl ecx, 0xc
test byte [ecx], 1
je 0x406a38
mov eax, dword [ecx + 4]
mov dword [esp + 0x1c], eax
cmp eax, 0xfe0
jle 0x406bda
cmp dword [ecx + 0x14], 1
jbe 0x406a38
mov ebx, dword [esp + 0x20]
lea eax, [ecx + 0x10]
mov edi, ecx
mov dword [esp + 0x2c], eax
shr edi, 0xc
mov eax, dword [ebx + 0x1604]
mov ebx, dword [ebx + 0x160c]
mov dword [esp + 0x1c], eax
and eax, edi
mov edx, dword [ebx + eax*4]
test edx, edx
je 0x406b24
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x1c]
jmp 0x406b11
lea eax, [eax + eax*4 + 1]
and eax, ecx
mov edx, dword [ebx + eax*4]
test edx, edx
je 0x406cd0
cmp edi, dword [edx + 4]
jne 0x406b00
mov ecx, dword [esp + 0x30]
test byte [edx + 8], 2
jne 0x406a38
mov ebx, dword [0x49c308]
mov dword [esp + 0x1c], ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov ecx, dword [esp + 0x1c]
mov eax, dword [ecx + 0x14]
mov edx, dword [eax + 0x14]
test edx, edx
je 0x406b70
mov edi, dword [esp + 0x2c]
add dword [ebx + 0x50], 1
lea ecx, [edi + 8]
call dword [eax + 0x14]
sub dword [ebx + 0x50], 1
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x2c]
add ebp, 1
lea ecx, [eax + 0x34]
call fcn.00404df0
shr esi, 1
jne 0x406a43
lea esi, [esi]
nop
add dword [esp + 0x28], 1
mov eax, dword [esp + 0x28]
cmp eax, 0x10
jne 0x406a18
mov eax, dword [esp + 0x24]
mov eax, dword [eax]
mov dword [esp + 0x24], eax
test eax, eax
jne 0x406a09
add dword [esp + 0x38], 4
mov eax, dword [esp + 0x38]
cmp dword [esp + 0x3c], eax
jne 0x4069f7
mov eax, dword [esp + 0x20]
mov byte [eax + 0x14c8], 0
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [ecx + 0x18]
lea eax, [ecx + 0x20]
mov ebx, eax
add edi, eax
mov dword [esp + 0x2c], edi
cmp edi, eax
jbe 0x406a38
mov dword [esp + 0x34], ebp
mov dword [esp + 0x30], esi
mov esi, eax
lea esi, [esi]
cmp dword [esi + 4], 1
jbe 0x406c5e
mov eax, dword [esp + 0x20]
mov ecx, ebx
shr ecx, 0xc
mov ebp, dword [eax + 0x1604]
mov edi, dword [eax + 0x160c]
mov eax, ecx
and eax, ebp
mov edx, dword [edi + eax*4]
test edx, edx
jne 0x406c3d
jmp 0x406c80
lea eax, [eax + eax*4 + 1]
and eax, ebp
mov edx, dword [edi + eax*4]
test edx, edx
je 0x406c80
cmp ecx, dword [edx + 4]
jne 0x406c30
mov eax, ebx
mov ecx, ebx
mov edi, 1
shr ecx, 4
shr eax, 9
shl edi, cl
and eax, 7
mov ecx, edi
and ecx, dword [edx + eax*4 + 8]
je 0x406c80
add ebx, dword [esp + 0x1c]
mov esi, ebx
cmp dword [esp + 0x2c], ebx
ja 0x406c00
mov esi, dword [esp + 0x30]
mov ebp, dword [esp + 0x34]
jmp 0x406a38
mov edi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov edi, eax
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 4]
sub esp, 4
mov ecx, dword [eax + 0x14]
test ecx, ecx
je 0x406cc0
add dword [edi + 0x50], 1
lea ecx, [ebx + 8]
call dword [eax + 0x14]
sub dword [edi + 0x50], 1
mov eax, dword [esp + 0x20]
mov edx, esi
lea ecx, [eax + 0x34]
call fcn.00404df0
jmp 0x406c5e
mov ecx, dword [esp + 0x30]
jmp 0x406b24
push ebp
lea eax, [ecx + 0x1624]
push edi
mov edi, ecx
push esi
push ebx
sub esp, 0x2c
mov dword [esp + 0x18], ecx
mov ecx, eax
mov dword [esp + 0x1c], eax
call fcn.00401820
mov eax, dword [edi + 0x161c]
mov dword [esp + 0x10], eax
test eax, eax
je 0x407e36
mov eax, dword [esp + 0x10]
xor edi, edi
mov eax, dword [eax + 4]
mov dword [esp + 0x14], eax
test eax, eax
jle 0x407e24
lea esi, [esi]
mov eax, dword [esp + 0x10]
mov esi, dword [0x49c308]
mov ebp, dword [eax + edi*4 + 8]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
sub esp, 4
mov dword [esp], ebx
lea ebx, [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 0x1630]
mov edx, dword [esi + 0x1638]
sub esp, 4
sub eax, 1
js 0x407dd2
lea ecx, [edx + eax*4]
mov edx, ecx
jmp 0x407dc3
sub eax, 1
sub edx, 4
cmp eax, 0xffffffff
je 0x407dd2
cmp ebx, dword [edx]
jne 0x407db8
mov eax, dword [ecx]
mov dword [edx], eax
sub dword [esi + 0x1630], 1
mov eax, dword [ebp - 8]
sub eax, 8
mov dword [ebp - 8], eax
cmp eax, 7
ja 0x407e17
mov esi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov dword [esp], ebp
add esi, 0x2c
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov dword [esp + 4], ebx
mov dword [esp], esi
call fcn.00405190
add edi, 1
cmp dword [esp + 0x14], edi
jne 0x407d68
mov eax, dword [esp + 0x10]
mov eax, dword [eax]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x407d50
mov ecx, dword [esp + 0x1c]
call fcn.00401840
mov eax, dword [esp + 0x18]
mov edx, dword [eax + 0xc]
mov ebx, eax
test edx, edx
jle 0x407e5e
lea esi, [esi]
mov ecx, ebx
call fcn.00407a00
mov eax, dword [ebx + 0xc]
test eax, eax
jg 0x407e50
mov eax, dword [esp + 0x18]
mov esi, dword [eax + 0x1608]
test esi, esi
je 0x407eab
lea esi, [esi]
mov ebx, dword [0x49c308]
mov edi, esi
mov esi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea edx, [edi - 8]
lea ecx, [ebx + 0x54]
sub esp, 4
call fcn.00404df0
test esi, esi
jne 0x407e70
mov ebp, dword [esp + 0x18]
mov ebx, dword [0x49c308]
mov dword [ebp + 0x1608], 0
mov esi, dword [ebp + 0x160c]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea edx, [esi - 8]
lea ecx, [ebx + 0x54]
sub esp, 4
call fcn.00404df0
mov ebx, dword [0x49c308]
mov dword [ebp + 0x160c], 0
mov dword [ebp + 0x1600], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea ecx, [ebx + 0x54]
mov edx, 0x1008
sub esp, 4
call fcn.00404070
mov edi, eax
lea edx, [eax + 8]
mov dword [eax + 4], 1
add edi, 0xc
mov ecx, edx
mov dword [eax + 8], 0
mov dword [eax + 0x1004], 0
and edi, 0xfffffffc
xor eax, eax
sub ecx, edi
add ecx, 0x1000
shr ecx, 2
rep stosd dword es:[edi], eax
mov dword [ebp + 0x160c], edx
mov dword [ebp + 0x1604], 0x3ff
mov esi, dword [ebp + 0x18]
mov edi, dword [ebp + 0x20]
mov dword [ebp + 0x1600], 0
mov dword [ebp + 0x1608], 0
test esi, esi
jle 0x407fb1
xor ebx, ebx
nop
mov edx, dword [edi + ebx*4]
mov ecx, ebp
add ebx, 1
call fcn.00407af0
cmp esi, ebx
jne 0x407fa0
mov edi, dword [esp + 0x18]
mov ecx, edi
call fcn.00407ca0
add esp, 0x2c
mov ecx, edi
pop ebx
pop esi
pop edi
pop ebp
jmp 0x4069d0