Function at 0x409140
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, ecx
sub esp, 0x4c
mov dword [esp + 4], 0x7d9
mov dword [esp], 0x472020
call fcn.00408420
mov dword [eax + 4], 0x7d0
mov ebp, eax
mov dword [eax], 0
mov dword [esp + 0x38], eax
test ebx, ebx
je 0x4093b4
mov eax, dword [ebx]
mov dword [esp + 0x24], eax
test eax, eax
jle 0x4093b4
lea eax, [ebx + 8]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], eax
lea esi, [esi]
mov eax, dword [esp + 0x18]
mov edx, dword [eax + 4]
cmp edx, 0xfffffff6
je 0x4093e8
cmp edx, 0xffffff9c
je 0x4093c0
mov eax, dword [ebp]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x18]
mov ebx, dword [eax + 8]
test ebx, ebx
je 0x4094f0
movzx eax, byte [ebx]
test al, al
je 0x4094f0
add ebx, 1
lea esi, [esp + 0x38]
movsx edx, al
lea esi, [esi]
mov ecx, ebp
mov edi, ebp
call fcn.00408ff0
mov dword [esp], esi
mov ebp, eax
call fcn.00406db0
test al, al
jne 0x409260
test ebp, ebp
je 0x4091ff
add dword [ebp - 8], 8
cmp edi, 0xfff
jbe 0x409260
mov eax, dword [edi - 8]
lea edx, [edi - 8]
mov dword [esp + 0x20], edx
sub eax, 8
mov dword [edi - 8], eax
cmp eax, 7
ja 0x409260
mov edi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x2c], eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov edi, eax
mov ecx, dword [esp + 0x2c]
add edi, 0x2c
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov edx, dword [esp + 0x20]
mov dword [esp], edi
mov dword [esp + 4], edx
call fcn.00405190
lea esi, [esi]
movsx edx, byte [ebx]
add ebx, 1
mov dword [esp + 0x38], ebp
test dl, dl
jne 0x4091e0
mov eax, dword [esp + 0x18]
mov edi, dword [eax + 4]
test edi, edi
jg 0x409430
xor eax, eax
test ebp, ebp
jne 0x4094f8
mov edx, dword [esp + 0x28]
mov ebx, 1
mov ecx, ebp
sub edx, eax
mov eax, 1
lea esi, [edx + 0x19]
test esi, esi
cmovle esi, eax
lea esi, [esi]
mov edx, 0x20
add ebx, 1
call fcn.00408ff0
mov dword [esp + 0x38], eax
mov ecx, eax
cmp esi, ebx
jge 0x4092a8
mov eax, dword [esp + 0x18]
mov ebp, ecx
mov ebx, dword [eax]
test ebx, ebx
je 0x40937a
movsx edx, byte [ebx]
test dl, dl
je 0x40937a
add ebx, 1
lea esi, [esp + 0x38]
lea esi, [esi]
mov ecx, ebp
mov edi, ebp
call fcn.00408ff0
mov dword [esp], esi
mov ebp, eax
call fcn.00406db0
test al, al
jne 0x409368
test ebp, ebp
je 0x409307
add dword [ebp - 8], 8
cmp edi, 0xfff
jbe 0x409368
mov eax, dword [edi - 8]
lea edx, [edi - 8]
mov dword [esp + 0x20], edx
sub eax, 8
mov dword [edi - 8], eax
cmp eax, 7
ja 0x409368
mov edi, dword [0x49c308]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x28], eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov edi, eax
mov ecx, dword [esp + 0x28]
add edi, 0x2c
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
mov edx, dword [esp + 0x20]
mov dword [esp], edi
mov dword [esp + 4], edx
call fcn.00405190
lea esi, [esi]
movsx edx, byte [ebx]
add ebx, 1
mov dword [esp + 0x38], ebp
test dl, dl
jne 0x4092e8
mov edx, 1
mov ecx, ebp
call fcn.00408ef0
mov edx, 0xa
mov ebp, eax
mov dword [esp + 0x38], eax
mov eax, dword [eax]
mov word [ebp + eax + 8], dx
add dword [ebp], 1
add dword [esp + 0x1c], 1
mov eax, dword [esp + 0x1c]
add dword [esp + 0x18], 0xc
cmp dword [esp + 0x24], eax
jne 0x409198
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, ebp
mov edx, 3
call fcn.00408ef0
mov ebp, eax
mov dword [esp + 0x38], eax
mov eax, dword [eax]
mov dword [ebp + eax + 8], 0xa5d5d
add dword [ebp], 3
jmp 0x40939c
mov edx, 0x11
mov ecx, ebp
call fcn.00408ef0
mov edx, 0xa
mov ebp, eax
mov dword [esp + 0x38], eax
mov eax, dword [eax]
lea eax, [ebp + eax + 8]
mov dword [eax], 0x65725b5b
mov dword [eax + 4], 0x73696172
mov dword [eax + 8], 0x66206465
mov dword [eax + 0xc], 0x3a6d6f72
mov word [eax + 0x10], dx
add dword [ebp], 0x11
jmp 0x40939c
mov edx, 1
mov ecx, ebp
mov esi, 0x28
call fcn.00408ef0
mov dword [esp + 0x38], eax
mov ebx, eax
mov eax, dword [eax]
mov word [ebx + eax + 8], si
mov eax, dword [esp + 0x18]
add dword [ebx], 1
mov esi, dword [eax + 4]
mov dword [esp + 4], 0x19
mov dword [esp], 0x472020
call fcn.00408420
lea ecx, [esp + 0x3c]
mov dword [eax + 4], 0x10
mov dword [eax], 0
mov dword [esp], esi
sar esi, 0x1f
mov dword [esp + 4], esi
mov dword [esp + 0x3c], eax
call fcn.004088d0
sub esp, 8
mov esi, dword [esp + 0x3c]
test esi, esi
je 0x409500
mov edx, dword [esi]
mov ecx, ebx
call fcn.00408ef0
lea ecx, [esi + 8]
mov ebx, eax
mov eax, dword [eax]
lea edx, [ebx + eax + 8]
mov eax, dword [esi]
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 [esi]
add dword [ebx], eax
mov ecx, ebx
mov edx, 1
call fcn.00408ef0
mov ecx, 0x29
mov ebp, eax
mov eax, dword [eax]
mov word [ebp + eax + 8], cx
mov eax, dword [ebp]
add eax, 1
mov dword [ebp], eax
jmp 0x40928b
test edx, edx
jg 0x409430
mov eax, dword [ebp]
jmp 0x40928b
mov ecx, ebx
xor edx, edx
call fcn.00408ef0
mov ebx, eax
jmp 0x4094c8