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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x40c03c]
mov dword [esp], eax
call sub.KERNEL32.dll_TlsGetValue
sub esp, 4
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
sub eax, 1
mov edx, eax
mov eax, dword [0x40c03c]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_TlsSetValue
sub esp, 8
cmp dword [ebp + 8], 0
jns 0x404045
mov eax, dword [0x40c034]
test eax, eax
jne 0x404045
mov eax, dword [0x40c040]
mov dword [esp], eax
call sub.KERNEL32.dll_TlsGetValue
sub esp, 4
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x403e6d
call sub.KERNEL32.dll_GetProcessHeap
mov dword [esp + 8], 0x2ac
mov dword [esp + 4], 8
mov dword [esp], eax
call sub.KERNEL32.dll_HeapAlloc
sub esp, 0xc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x403e54
mov eax, dword [ebp + 8]
jmp 0x40408d
mov eax, dword [0x40c040]
mov edx, dword [ebp - 0xc]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_TlsSetValue
sub esp, 8
jmp 0x403ed1
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x2a8]
test eax, eax
je 0x403ed1
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x290]
mov dword [esp], eax
call sub.OLEAUT32.DLL_SysFreeString
sub esp, 4
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x294]
mov dword [esp], eax
call sub.OLEAUT32.DLL_SysFreeString
sub esp, 4
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x298]
mov dword [esp], eax
call sub.OLEAUT32.DLL_SysFreeString
sub esp, 4
mov dword [esp + 8], 0x2ac
mov dword [esp + 4], 0
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 8]
test eax, eax
jne 0x403fd4
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 8]
mov dword [eax + 8], edx
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 0x1c]
mov dword [eax + 0x2a0], edx
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 0x20]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 0xc]
mov dword [eax + 0x2a4], edx
cmp dword [ebp + 0x10], 0
je 0x403f2c
mov eax, dword [ebp - 0xc]
lea edx, [eax + 0xc]
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x40
mov dword [esp], edx
call fcn.00403cca
cmp dword [ebp + 0x18], 0
je 0x403fd4
cmp dword [ebp + 8], 0x80020009
jne 0x403fd4
mov eax, dword [ebp + 0x18]
mov eax, dword [eax + 0x18]
test eax, eax
je 0x403f73
mov eax, dword [ebp + 0x18]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.KERNEL32.dll_IsBadCodePtr
sub esp, 4
test eax, eax
jne 0x403f73
mov eax, dword [ebp + 0x18]
mov edx, dword [eax + 0x18]
mov eax, dword [ebp + 0x18]
mov dword [esp], eax
call edx
sub esp, 4
mov eax, dword [ebp + 0x18]
mov edx, dword [eax + 8]
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x290], edx
mov eax, dword [ebp + 0x18]
mov edx, dword [eax + 4]
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x294], edx
mov eax, dword [ebp + 0x18]
mov edx, dword [eax + 0xc]
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x298], edx
mov eax, dword [ebp + 0x18]
mov edx, dword [eax + 0x10]
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x29c], edx
mov eax, dword [ebp + 0x18]
movzx eax, word [eax]
test ax, ax
je 0x403fc5
mov eax, dword [ebp + 0x18]
movzx eax, word [eax]
movzx eax, ax
jmp 0x403fcb
mov eax, dword [ebp + 0x18]
mov eax, dword [eax + 0x1c]
mov edx, dword [ebp - 0xc]
mov dword [edx + 0x28c], eax
cmp dword [ebp - 0x10], 1
jne 0x404089
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x2a8], 1
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 0x20]
mov dword [eax], edx
cmp dword [ebp + 0x14], 0
je 0x404019
mov eax, dword [ebp - 0xc]
lea edx, [eax + 0x8c]
mov eax, dword [ebp + 0x14]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x100
mov dword [esp], edx
call fcn.00403cca
mov eax, dword [0x40c030]
test eax, eax
je 0x40402d
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call fcn.0040408f
mov eax, dword [0x40c038]
test eax, eax
je 0x404089
mov eax, dword [0x40c038]
mov edx, dword [ebp - 0xc]
mov dword [esp], edx
call eax
jmp 0x404089
cmp dword [ebp + 8], 0x80020009
jne 0x40408a
cmp dword [ebp + 0x18], 0
je 0x40408a
mov eax, dword [ebp + 0x18]
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.OLEAUT32.DLL_SysFreeString
sub esp, 4
mov eax, dword [ebp + 0x18]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sub.OLEAUT32.DLL_SysFreeString
sub esp, 4
mov eax, dword [ebp + 0x18]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.OLEAUT32.DLL_SysFreeString
sub esp, 4
jmp 0x40408a
nop
mov eax, dword [ebp + 8]
leave
ret