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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov dword [ebp - 8], esi
mov esi, dword [0x64893088]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], edi
test esi, esi
jne 0x64851e34
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
test eax, eax
je 0x64851f4d
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
mov edi, dword [eax + 8]
test edi, edi
je 0x64851eca
mov ebx, dword [0x648930d8]
call sub.KERNEL32.dll_GetLastError
mov dword [esp], ebx
mov esi, eax
call sub.KERNEL32.dll_TlsGetValue
sub esp, 4
mov ebx, eax
mov dword [esp], esi
call sub.KERNEL32.dll_SetLastError
sub esp, 4
test ebx, ebx
je 0x64851e8c
mov esi, ebx
mov ebx, dword [ebx]
cmp edi, ebx
jae 0x64851f5f
lea ebx, [esi + edi*4]
mov eax, dword [ebx]
test eax, eax
jne 0x64851e27
mov eax, dword [ebp + 8]
call fcn.64851c90
mov dword [ebx], eax
jmp 0x64851e27
lea ebx, [edi + 0x20]
mov dword [esp + 4], 4
mov dword [esp], ebx
call sub.msvcrt.dll_calloc
test eax, eax
je 0x6485204f
mov esi, eax
mov dword [eax], ebx
mov eax, dword [0x648930d8]
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.KERNEL32.dll_TlsSetValue
sub esp, 8
test eax, eax
jne 0x64851e77
call sub.KERNEL32.dll_GetLastError
jmp 0x64851e77
mov ebx, dword [0x64858300]
test ebx, ebx
je 0x64851fb0
mov dword [esp], 0x648930c8
call sub.KERNEL32.dll_InterlockedIncrement
sub esp, 4
test eax, eax
jne 0x6485200a
mov edi, dword [0x648930e8]
mov eax, dword [0x64893088]
mov edx, dword [ebp + 8]
add edi, 1
test eax, eax
mov dword [0x648930e8], edi
mov dword [edx + 8], edi
je 0x64851e42
mov dword [esp], 0x648930c8
call sub.KERNEL32.dll_InterlockedDecrement
sub esp, 4
test eax, eax
js 0x64851e42
mov eax, dword [0x648930cc]
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.KERNEL32.dll_ReleaseSemaphore
sub esp, 0xc
jmp 0x64851e42
mov eax, edx
call fcn.64851c90
mov edx, dword [ebp + 8]
mov dword [edx + 8], eax
jmp 0x64851e27
lea eax, [ebx + ebx]
cmp edi, eax
mov dword [ebp - 0x10], eax
jb 0x64851f6f
lea edx, [edi + 0x20]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
mov dword [esp], esi
shl eax, 2
mov dword [esp + 4], eax
call sub.msvcrt.dll_realloc
test eax, eax
je 0x6485204f
sub dword [ebp - 0x10], ebx
mov esi, eax
mov eax, dword [ebp - 0x10]
lea edx, [esi + ebx*4]
mov dword [esp + 4], 0
mov dword [esp], edx
shl eax, 2
mov dword [esp + 8], eax
call sub.msvcrt.dll_memset
jmp 0x64851eab
mov dword [esp], 0x64858304
call sub.KERNEL32.dll_InterlockedIncrement
sub esp, 4
test eax, eax
jne 0x64851fd8
jmp 0x6485203e
mov dword [esp], 0
lea esi, [esi]
call sub.KERNEL32.dll_Sleep
sub esp, 4
mov ecx, dword [0x64858300]
test ecx, ecx
je 0x64851fc5
mov edx, dword [0x64893088]
test edx, edx
jne 0x64851ed8
mov edi, dword [0x648930e8]
mov eax, dword [ebp + 8]
add edi, 1
mov dword [0x648930e8], edi
mov dword [eax + 8], edi
jmp 0x64851e42
mov eax, dword [0x648930cc]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call sub.KERNEL32.dll_WaitForSingleObject
sub esp, 8
test eax, eax
je 0x64851eef
mov dword [esp], 0x648930c8
call sub.KERNEL32.dll_InterlockedDecrement
sub esp, 4
jmp 0x64851eef
call fcn.64851d30
mov dword [0x64858300], 1
jmp 0x64851fe2
call sub.msvcrt.dll_abort
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
push ebp
mov ebp, esp
push ebx
sub esp, 0x14
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 4]
sub eax, 1
test eax, eax
mov dword [ebx + 4], eax
je 0x64852080
mov ebx, dword [ebp - 4]
xor eax, eax
leave
ret
mov dword [ebx + 8], 0
mov dword [esp], ebx
call sub.KERNEL32.dll_InterlockedDecrement
sub esp, 4
test eax, eax
js 0x64852077
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov eax, dword [ebx + 0xc]
mov dword [esp], eax
call sub.KERNEL32.dll_ReleaseSemaphore
mov ebx, dword [ebp - 4]
sub esp, 0xc
test eax, eax
leave
sete al
movzx eax, al
ret