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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov edx, dword [0x4e2454]
mov eax, dword [esp + 0x40]
test edx, edx
jne 0x4388e4
mov eax, dword [eax + 8]
test eax, eax
je 0x438940
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [eax + 8]
test esi, esi
je 0x438952
mov ebx, dword [0x536420]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
mov edi, eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
test ebx, ebx
je 0x4389d4
mov edx, dword [ebx]
cmp edx, esi
jb 0x438a22
lea ebx, [ebx + esi*4]
mov eax, dword [ebx]
test eax, eax
jne 0x4388dc
mov eax, dword [esp + 0x40]
call fcn.004387a0
mov dword [ebx], eax
jmp 0x4388dc
mov eax, dword [esp + 0x40]
call fcn.004387a0
mov ecx, dword [esp + 0x40]
mov dword [ecx + 8], eax
jmp 0x4388dc
mov ebp, dword [0x4e2454]
test ebp, ebp
je 0x438a98
mov edi, dword [0x4e2468]
test edi, edi
je 0x438ac1
lock add dword [0x536424], 1
jne 0x438af8
mov eax, dword [esp + 0x40]
mov esi, dword [eax + 8]
test esi, esi
je 0x438aa7
mov eax, dword [0x4e2454]
test eax, eax
je 0x4388eb
mov eax, 0xffffffff
lock xadd dword [0x536424], eax
sub eax, 1
js 0x4388eb
mov eax, dword [0x536428]
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
sub esp, 0xc
jmp 0x4388eb
lea eax, [esi + 0x21]
mov dword [esp + 4], 4
lea edx, [esi + 0x20]
mov dword [esp], eax
mov dword [esp + 0x18], edx
call sub.msvcrt.dll_calloc
mov ebx, eax
test eax, eax
je 0x4c255a
mov edx, dword [esp + 0x18]
mov dword [eax], edx
mov eax, dword [0x536420]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
test eax, eax
jne 0x438927
call ebp
jmp 0x438927
lea ecx, [edx + edx]
lea eax, [esi + 0x20]
mov dword [esp], ebx
cmp esi, ecx
mov dword [esp + 0x1c], edx
cmova ecx, eax
lea eax, [ecx*4 + 4]
mov dword [esp + 0x18], ecx
mov dword [esp + 4], eax
call sub.msvcrt.dll_realloc
mov ebx, eax
test eax, eax
je 0x4c255a
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov dword [eax], ecx
sub ecx, edx
lea eax, [eax + edx*4 + 4]
shl ecx, 2
mov dword [esp + 4], 0
mov dword [esp + 8], ecx
mov dword [esp], eax
call sub.msvcrt.dll_memset
jmp 0x4389fe
call fcn.00438840
mov dword [0x4e2468], 1
mov edx, dword [0x4e2454]
test edx, edx
jne 0x43896e
mov eax, dword [esp + 0x40]
mov esi, dword [eax + 8]
test esi, esi
jne 0x4388eb
mov eax, dword [0x53641c]
lea esi, [eax + 1]
mov dword [0x53641c], esi
mov eax, dword [esp + 0x40]
mov dword [eax + 8], esi
jmp 0x43898b
lock add dword [0x4e246c], 1
je 0x438a7b
mov esi, dword [0x4e2468]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
test esi, esi
jne 0x438a8a
nop
lea esi, [esi]
mov dword [esp], 0
call ebx
mov ecx, dword [0x4e2468]
sub esp, 4
test ecx, ecx
je 0x438ae0
jmp 0x438a8a
mov eax, dword [0x536428]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
test eax, eax
je 0x43897c
lock sub dword [0x536424], 1
jmp 0x43897c