Function at 0x4105a0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
mov esi, ecx
push ebx
sub esp, 0x3c
mov dword [esp + 0x18], edx
mov edi, dword [esp + 0x50]
test edx, edx
je 0x410830
mov dword [esp + 4], 0x45
mov ebp, edx
mov dword [esp], 0x472020
call fcn.00408420
mov dword [eax + 4], 0x3c
mov ebx, eax
lea eax, [eax + 8]
mov dword [eax - 8], 0x3c
mov dword [esp + 8], ebp
mov dword [esp + 4], 0x4731a0
mov dword [esp], eax
call fcn.00403100
mov ecx, ebx
mov edx, eax
call fcn.00408790
mov ebx, eax
test eax, eax
je 0x4107b0
mov edx, dword [eax]
mov ecx, dword [esi]
call fcn.00408ef0
mov ecx, esi
mov edx, eax
call fcn.00406e10
mov ebp, dword [esi]
lea ecx, [ebx + 8]
mov eax, dword [ebp]
lea edx, [ebp + eax + 8]
mov eax, dword [ebx]
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 [ebx]
add dword [ebp], eax
mov ecx, dword [esi]
mov edx, 2
mov ebp, 0x5b40
call fcn.00408c60
mov ecx, esi
mov edx, eax
call fcn.00406e10
mov eax, dword [esi]
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], bp
mov byte [edx + 2], 0
add dword [eax], 2
mov eax, dword [edi + 0xc]
mov eax, dword [eax]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
mov eax, dword [eax]
mov dword [esp + 0x1c], eax
test eax, eax
jle 0x4107d0
xor ebx, ebx
xor ebp, ebp
jmp 0x41079b
sub eax, 1
jo 0x4108b2
mov edx, eax
add edx, 8
jo 0x4108b2
not eax
and eax, edx
mov ecx, dword [esp + 0x18]
add ebp, 1
lea edx, [ecx + eax]
mov eax, dword [esp + 0x54]
mov ecx, esi
add edx, ebx
mov dword [esp + 4], eax
mov eax, dword [edi + 0xc]
mov dword [esp], eax
call fcn.0040f4f0
sub esp, 8
cmp dword [esp + 0x1c], ebp
je 0x4107d0
mov ecx, dword [esi]
mov edx, 2
call fcn.00408c60
mov dword [esp], esi
mov dword [esp + 0x14], eax
call fcn.00406db0
mov edx, dword [esp + 0x14]
test al, al
jne 0x410780
test edx, edx
je 0x41070a
add dword [edx - 8], 8
mov eax, dword [esi]
cmp eax, 0xfff
jbe 0x410780
lea ecx, [eax - 8]
mov dword [esp + 0x14], ecx
mov ecx, dword [eax - 8]
sub ecx, 8
mov dword [eax - 8], ecx
cmp ecx, 7
ja 0x410780
mov eax, dword [0x49c308]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x24], eax
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
add eax, 0x2c
mov dword [esp + 4], ecx
mov dword [esp], eax
call fcn.00405190
mov edx, dword [esp + 0x2c]
nop
mov dword [esi], edx
mov eax, dword [edx]
mov ecx, 0x202c
add ebx, dword [esp + 0x20]
lea eax, [edx + eax + 8]
mov word [eax], cx
mov byte [eax + 2], 0
add dword [edx], 2
mov eax, dword [edi + 4]
test eax, eax
jne 0x410698
mov eax, 8
jmp 0x4106b0
mov ecx, dword [esi]
xor edx, edx
call fcn.00408ef0
mov ecx, esi
mov edx, eax
call fcn.00406e10
jmp 0x410641
mov ecx, dword [esi]
mov edx, 1
call fcn.00408ef0
mov dword [esp], esi
mov ebx, eax
call fcn.00406db0
test al, al
jne 0x41080c
test ebx, ebx
je 0x4107f2
add dword [ebx - 8], 8
mov eax, dword [esi]
cmp eax, 0xfff
jbe 0x41080c
mov edi, dword [eax - 8]
lea ebp, [eax - 8]
lea edx, [edi - 8]
mov dword [eax - 8], edx
cmp edx, 7
jbe 0x410870
mov dword [esi], ebx
mov eax, dword [ebx]
mov esi, 0x5d
mov word [ebx + eax + 8], si
add dword [ebx], 1
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov ecx, dword [ecx]
mov edx, 2
call fcn.00408c60
mov ecx, esi
mov edx, eax
call fcn.00406e10
mov eax, dword [esi]
mov ecx, 0x5d5b
mov edx, dword [eax]
lea edx, [eax + edx + 8]
mov word [edx], cx
mov byte [edx + 2], 0
add dword [eax], 2
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 + 0x14], eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov edi, eax
mov edx, dword [esp + 0x14]
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 0x41080c
call fcn.00409ba0
lea esi, [esi]
nop
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov esi, dword [ecx + 8]
mov dword [esp + 0x1c], ecx
test esi, esi
je 0x410913
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 0x4108d8
mov ebp, dword [esp + 0x1c]
mov esi, dword [0x49c308]
mov ebx, dword [ebp + 0xc]
mov dword [ebp + 8], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea edx, [ebx - 8]
lea ecx, [esi + 0x54]
sub esp, 4
call fcn.00404df0
mov dword [ebp + 0xc], 0
mov dword [ebp], 0
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret