Function at 0x4afd00
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x7c], 0
je 0x4afd6c
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx eax, word [eax + 0x80]
test eax, eax
jne 0x4afd6c
push 0x7d87d8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
dec dword [0x7d87f0]
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [eax + 0x7c], 0
push 0x7d87f8
call fcn.0048dab0
pop ecx
push 0x7d87d8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0x7d87c0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x1654], 0
je 0x4afd9c
push 0x7d87c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.0048d580
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [eax + 0x1658], 1
push 0x7d87c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x7c036c], 0
jne 0x4afdda
mov dword [0x7c036c], 1
call fcn.004bf6e0
mov dword [0x7cdd98], eax
movzx eax, word [ebp + 0x14]
mov esi, eax
and esi, 0xff
je 0x4afdf6
cmp esi, 1
je 0x4afe93
jmp 0x4afef4
cmp dword [0x7cdd98], 0
je 0x4afe72
push edi
lea edi, [ebp - 0x14]
push edi
xor eax, eax
mov ecx, 5
rep stosd dword es:[edi], eax
pop eax
pop edi
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
movzx eax, word [ebp + 0x14]
and eax, 0x100
je 0x4afe28
xor edi, edi
jmp 0x4afe2d
mov edi, 2
mov eax, edi
mov dword [ebp - 0x18], eax
cmp dword [0x7c0368], 0
je 0x4afe46
movzx eax, word [ebp + 0x14]
and eax, 0x200
jne 0x4afe4a
or dword [ebp - 0x18], 1
mov eax, dword [ebp + 8]
push eax
call fcn.004ae4c0
pop ecx
lea edx, [ebp - 0x14]
push edx
push 0
mov edx, dword [ebp + 0x10]
push edx
push 0
mov edx, dword [ebp - 0x18]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_LockFileEx]
mov ebx, eax
jmp 0x4afef6
mov eax, dword [ebp + 8]
push eax
call fcn.004ae4c0
pop ecx
push 0
mov edx, dword [ebp + 0x10]
push edx
push 0
mov edx, dword [ebp + 0xc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_LockFile]
mov ebx, eax
jmp 0x4afef6
cmp dword [0x7cdd98], 0
je 0x4afed3
push edi
lea edi, [ebp - 0x14]
push edi
xor eax, eax
mov ecx, 5
rep stosd dword es:[edi], eax
pop eax
pop edi
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
push eax
call fcn.004ae4c0
pop ecx
lea edx, [ebp - 0x14]
push edx
push 0
mov edx, dword [ebp + 0x10]
push edx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
mov ebx, eax
jmp 0x4afef6
mov eax, dword [ebp + 8]
push eax
call fcn.004ae4c0
pop ecx
push 0
mov edx, dword [ebp + 0x10]
push edx
push 0
mov edx, dword [ebp + 0xc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFile]
mov ebx, eax
jmp 0x4afef6
xor ebx, ebx
push 0
push ebx
call fcn.004be070
add esp, 8
push 0x7d87c0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [eax + 0x1658], 0
push 0x7d87c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x7c], 0
jne 0x4affa4
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx eax, word [eax + 0x80]
test eax, eax
jne 0x4affa4
push 0x7d87d8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x4aff77
push 0xffffffffffffffff
push 0x7d87d8
push 0x7d87f8
call fcn.0048db80
add esp, 0xc
mov eax, dword [0x7d87f4]
test eax, eax
jne 0x4aff63
inc dword [0x7d87f0]
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [eax + 0x7c], 1
push 0x7d87d8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret