Function at 0x409510
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, ecx
xor eax, eax
push edi
push esi
push ebx
sub esp, 0x80c
lea ebx, [esp + 0x2f]
lea edi, [esp + 0x30]
mov dword [esp + 0x2f], 0
mov dword [esp + 0x7fc], 0
mov ecx, ebx
sub ecx, edi
add ecx, 0x7d1
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x409559
mov esi, dword [ecx]
test esi, esi
jne 0x409708
mov esi, 0x1c
mov eax, ebx
mov edi, dword [ebp + 0xc]
mov dword [eax], 0x6f727245
mov dword [eax + 4], 0x75203a72
mov dword [eax + 8], 0x6e61686e
mov dword [eax + 0xc], 0x64656c64
mov dword [eax + 0x10], 0x63786520
mov dword [eax + 0x14], 0x69747065
mov dword [eax + 0x18], 0x203a6e6f
test edi, edi
je 0x4095c6
mov eax, dword [edi]
lea edx, [eax + esi]
cmp edx, 0x7cf
jg 0x4095c6
test eax, eax
mov ecx, 0x47328b
lea edx, [edi + 8]
mov dword [esp + 8], eax
cmove edx, ecx
lea ecx, [ebx + esi]
mov dword [esp], ecx
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcpy
add esi, dword [edi]
cmp esi, 0x7cd
jg 0x4096bf
mov edi, dword [ebp + 8]
mov ecx, 0x5b20
mov word [ebx + esi], cx
add esi, 2
test edi, edi
je 0x4097c4
mov dword [esp], edi
call sub.msvcrt.dll_strlen
lea edx, [eax + esi]
cmp edx, 0x7cf
jle 0x4096e1
cmp esi, 0x7cd
jg 0x409611
mov edx, 0xa5d
mov word [ebx + esi], dx
mov eax, dword [0x498468]
test eax, eax
je 0x4097a0
mov dword [esp], ebx
mov edi, 7
call sub.msvcrt.dll_strlen
mov ebp, dword [0x49c308]
cmp eax, edi
mov esi, eax
cmovge edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], ebp
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebp, eax
mov edx, dword [esp + 0x1c]
add ebp, 0x20
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea edx, [edi + 9]
mov ecx, 0x472020
sub esp, 4
mov dword [esp], ebp
call fcn.004082e0
lea ecx, [esi + 1]
mov dword [eax + 4], edi
sub esp, 4
lea edx, [eax + 8]
mov dword [eax], esi
cmp ecx, 4
jae 0x409770
test ecx, ecx
jne 0x4097d0
mov ecx, eax
call dword [0x498468]
add esp, 0x80c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [ebp + 0xc]
test edi, edi
jne 0x409597
cmp esi, 0x7cf
jle 0x4095c6
mov edi, dword [ebp + 8]
test edi, edi
je 0x4097b8
mov dword [esp], edi
call sub.msvcrt.dll_strlen
lea edx, [eax + esi]
cmp edx, 0x7cf
jg 0x409611
lea edx, [ebx + esi]
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 4], edi
call sub.msvcrt.dll_memcpy
mov dword [esp], edi
call sub.msvcrt.dll_strlen
add esi, eax
jmp 0x409600
call fcn.00409140
test eax, eax
je 0x409559
mov edx, dword [eax]
cmp edx, 0x7cf
jg 0x409559
lea esi, [eax + 8]
test edx, edx
mov ecx, 0x47328b
cmove esi, ecx
cmp edx, 4
jae 0x4097f0
test edx, edx
je 0x40974f
movzx ecx, byte [esi]
mov byte [esp + 0x2f], cl
test dl, 2
jne 0x409817
mov edx, dword [eax]
mov esi, edx
cmp edx, 0x7b3
jg 0x4096a8
lea eax, [ebx + edx]
add esi, 0x1c
jmp 0x409560
mov esi, dword [esp + 0x2f]
lea edi, [eax + 0xc]
and edi, 0xfffffffc
mov dword [eax + 8], esi
mov esi, dword [esp + ecx + 0x2b]
mov dword [edx + ecx - 4], esi
sub edx, edi
sub ebx, edx
add ecx, edx
mov esi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
jmp 0x409692
mov ecx, ebx
call fcn.00409e90
add esp, 0x80c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp esi, 0x7cf
jg 0x409611
xor eax, eax
jmp 0x4096e1
movzx ebx, byte [esp + 0x2f]
mov byte [eax + 8], bl
test cl, 2
je 0x409692
movzx ebx, word [esp + ecx + 0x2d]
mov word [edx + ecx - 2], bx
jmp 0x409692
mov ecx, dword [esi]
lea edi, [esp + 0x33]
and edi, 0xfffffffc
mov dword [esp + 0x2f], ecx
mov ecx, dword [esi + edx - 4]
mov dword [esp + edx + 0x2b], ecx
mov ecx, ebx
sub ecx, edi
sub esi, ecx
add ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
jmp 0x40974d
movzx ecx, word [esi + edx - 2]
mov word [esp + edx + 0x2d], cx
mov edx, dword [eax]
jmp 0x40974f