Function at 0x413df0
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x34
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x41fc20
lea eax, [ebp - 0x18]
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x24], edx
mov esi, dword fs:[0]
mov dword [ebp - 0x18], esi
mov dword fs:[0], eax
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x34], edx
mov eax, dword [0x43a07c]
test eax, eax
jne 0x413e43
mov ecx, 0x43a07c
mov dword [ebp - 0x10], 1
call fcn.00411cb0
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 2
jb 0x413e59
cmp dword [eax], 1
mov esi, eax
je 0x413f80
mov eax, dword [0x43a07c]
test eax, eax
jne 0x413e73
mov ecx, 0x43a07c
mov dword [ebp - 0x10], 1
call fcn.00411cb0
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
je 0x413ecb
mov esi, eax
cmp eax, 1
jne 0x413f18
cmp dword [ebp - 0x20], 0
je 0x414086
mov dword [ebp - 0x10], 0
push dword [ebp - 0x20]
mov eax, dword [ebp - 0x24]
call dword [eax]
add esp, 4
mov eax, dword [ebp - 0x24]
cmp dword [eax + 4], 0
je 0x414086
mov eax, dword [ebp - 0x24]
cmp dword [eax + 8], 9
jae 0x414073
call sub.KERNEL32.dll_GetProcessHeap
push dword [ebp - 0x20]
jmp 0x41407e
call sub.KERNEL32.dll_GetProcessHeap
push 0x14
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x414062
mov dword [eax], 0
mov dword [eax + 0x10], 0x43a07c
mov esi, eax
mov eax, dword [0x43a07c]
test eax, eax
jne 0x413f11
mov ecx, 0x43a07c
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x10], 1
call fcn.00411cb0
mov esi, dword [ebp - 0x28]
push esi
push eax
call sub.KERNEL32.dll_TlsSetValue
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
cmp dword [esi], 0
mov dword [esi], 1
mov dword [esi + 4], 0
mov dword [esi + 8], 0
je 0x413f80
test eax, eax
je 0x413f80
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x10], 2
mov dword [ebp - 0x2c], eax
push eax
mov dword [ebp - 0x30], ecx
call dword [ecx]
add esp, 4
mov eax, dword [ebp - 0x30]
mov esi, dword [ebp - 0x28]
cmp dword [eax + 4], 0
je 0x413f80
cmp dword [eax + 8], 9
jae 0x413f6d
call sub.KERNEL32.dll_GetProcessHeap
push dword [ebp - 0x2c]
jmp 0x413f78
call sub.KERNEL32.dll_GetProcessHeap
mov ecx, dword [ebp - 0x2c]
push dword [ecx - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
cmp dword [esi + 4], 0
jne 0x414045
mov ecx, dword [esi + 8]
mov edx, dword [esi + 0xc]
mov eax, dword [ebp - 0x20]
mov edi, dword [ebp - 0x24]
test ecx, ecx
mov dword [esi + 8], eax
mov dword [esi + 0xc], edi
mov dword [esi + 4], 0
je 0x414032
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x10], 3
lea eax, [ebp - 0x38]
mov dword [ebp - 0x20], ecx
push ecx
push eax
mov dword [ebp - 0x24], edx
call dword [edx + 0x14]
add esp, 8
mov al, byte [ebp - 0x38]
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x24]
cmp al, 3
ja 0x413fda
cmp al, 2
jne 0x414032
mov ecx, dword [ebp - 0x34]
mov eax, dword [ecx]
mov dword [ebp - 0x28], ecx
mov ecx, dword [ecx + 4]
mov dword [ebp - 0x10], 4
push eax
call dword [ecx]
add esp, 4
mov edi, dword [ebp - 0x28]
mov eax, dword [edi + 4]
cmp dword [eax + 4], 0
je 0x41401e
mov esi, dword [edi]
cmp dword [eax + 8], 9
jae 0x41400e
call sub.KERNEL32.dll_GetProcessHeap
push esi
jmp 0x414016
call sub.KERNEL32.dll_GetProcessHeap
push dword [esi - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
call sub.KERNEL32.dll_GetProcessHeap
push edi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
mov eax, ecx
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x40]
mov ecx, str.already_borrowedP
mov edx, 0x10
push 0x43134c
push eax
call fcn.00408870
add esp, 8
ud2
mov ecx, 0x14
mov edx, 4
call fcn.00404cd0
ud2
call sub.KERNEL32.dll_GetProcessHeap
mov ecx, dword [ebp - 0x20]
push dword [ecx - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
lea eax, [ebp - 0x40]
mov ecx, str.cannot_access_a_TLS_value_during_or_after_it_is_destroyed
mov edx, 0x39
push 0x4315ac
push eax
call fcn.00408870
add esp, 8
ud2