Function at 0x41fef0
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, 0x3c
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x4365d0
mov esi, edx
lea eax, [ebp - 0x18]
mov dword [ebp - 0x28], ecx
mov edx, dword fs:[0]
mov dword [ebp - 0x18], edx
mov dword fs:[0], eax
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x3c], esi
mov eax, dword [0x452054]
mov dword [ebp - 0x24], esi
test eax, eax
je 0x41ff4b
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 2
jb 0x41ff6e
cmp dword [eax], 1
mov edi, eax
jne 0x41ff6e
jmp 0x4200b0
mov ecx, 0x452054
mov byte [ebp - 0x1d], 1
mov dword [ebp - 0x10], 1
call fcn.0041d970
mov esi, dword [ebp - 0x24]
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 2
jae 0x41ff3f
mov eax, dword [0x452054]
test eax, eax
je 0x41ffcf
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
je 0x41fff1
mov edi, eax
cmp eax, 1
jne 0x420045
cmp dword [ebp - 0x28], 0
je 0x4201c1
mov dword [ebp - 0x10], 0
push dword [ebp - 0x28]
mov eax, dword [ebp - 0x24]
call dword [eax]
add esp, 4
mov eax, dword [ebp - 0x24]
cmp dword [eax + 4], 0
je 0x4201c1
mov eax, dword [ebp - 0x24]
cmp dword [eax + 8], 9
jae 0x4201ae
call sub.KERNEL32.dll_GetProcessHeap
push dword [ebp - 0x28]
jmp 0x4201b9
mov ecx, 0x452054
mov byte [ebp - 0x1d], 1
mov dword [ebp - 0x10], 1
call fcn.0041d970
mov esi, dword [ebp - 0x24]
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
jne 0x41ff81
call sub.KERNEL32.dll_GetProcessHeap
push 0x14
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x42019d
mov dword [eax], 0
mov dword [eax + 0x10], 0x452054
mov edi, eax
mov eax, dword [0x452054]
test eax, eax
jne 0x42003e
mov ecx, 0x452054
mov dword [ebp - 0x30], edi
mov byte [ebp - 0x1d], 1
mov dword [ebp - 0x10], 1
call fcn.0041d970
mov esi, dword [ebp - 0x24]
mov edi, dword [ebp - 0x30]
push edi
push eax
call sub.KERNEL32.dll_TlsSetValue
mov eax, dword [edi + 8]
mov ecx, dword [edi + 0xc]
cmp dword [edi], 0
mov dword [edi], 1
mov dword [edi + 4], 0
mov dword [edi + 8], 0
je 0x4200b0
test eax, eax
je 0x4200b0
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x10], 3
mov dword [ebp - 0x34], eax
push eax
mov dword [ebp - 0x38], ecx
call dword [ecx]
add esp, 4
mov eax, dword [ebp - 0x38]
mov esi, dword [ebp - 0x24]
mov edi, dword [ebp - 0x30]
cmp dword [eax + 4], 0
je 0x4200b0
cmp dword [eax + 8], 9
jae 0x42009d
call sub.KERNEL32.dll_GetProcessHeap
push dword [ebp - 0x34]
jmp 0x4200a8
call sub.KERNEL32.dll_GetProcessHeap
mov ecx, dword [ebp - 0x34]
push dword [ecx - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], esi
cmp dword [edi + 4], 0
jne 0x420179
mov eax, dword [edi + 8]
mov edx, dword [edi + 0xc]
mov dword [edi + 8], ecx
mov dword [edi + 0xc], esi
mov dword [edi + 4], 0
test eax, eax
je 0x420167
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x10], 4
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x24], eax
push eax
push ecx
mov dword [ebp - 0x28], edx
call dword [edx + 0x14]
add esp, 8
mov cl, byte [ebp - 0x48]
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x28]
cmp cl, 3
ja 0x42010f
cmp cl, 2
jne 0x420167
mov ecx, dword [ebp - 0x44]
mov eax, dword [ecx]
mov dword [ebp - 0x30], ecx
mov ecx, dword [ecx + 4]
mov dword [ebp - 0x10], 5
push eax
call dword [ecx]
add esp, 4
mov edi, dword [ebp - 0x30]
mov eax, dword [edi + 4]
cmp dword [eax + 4], 0
je 0x420153
mov esi, dword [edi]
cmp dword [eax + 8], 9
jae 0x420143
call sub.KERNEL32.dll_GetProcessHeap
push esi
jmp 0x42014b
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 eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x18]
mov dword fs:[0], ecx
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x10], 2
lea eax, [ebp - 0x2c]
mov ecx, str.already_borrowed_sA
mov edx, 0x10
push 0x447f7c
push eax
call fcn.00411a20
add esp, 8
ud2
mov ecx, 0x14
mov edx, 4
call fcn.0040dcf0
ud2
call sub.KERNEL32.dll_GetProcessHeap
mov ecx, dword [ebp - 0x28]
push dword [ecx - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov dword [ebp - 0x10], 0xffffffff
lea eax, [ebp - 0x2c]
mov ecx, 0x44943b
mov edx, 0x46
push 0x448144
push eax
call fcn.00411a20
add esp, 8
ud2