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

Disassembly:
cmp dword [0x7170d0], 0
je 0x49393f
cmp dword [0x717090], 0
jne 0x49393f
push ebx
push esi
push edi
mov dword [0x717090], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [0x70e5ac]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
push dword [0x70e5ac]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, edi
call fcn.00493240
mov esi, dword [0x7170e0]
test esi, esi
je 0x493397
mov eax, dword [esi]
call eax
push esi
mov esi, dword [esi + 4]
call fcn.0062f9c7
add esp, 4
test esi, esi
jne 0x493383
mov esi, dword [0x7170f8]
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov dword [0x7170e0], 0
test esi, esi
je 0x4933bd
push esi
call ebx
push esi
call fcn.0062f9c7
add esp, 4
cmp dword [0x7170f0], 0
mov esi, dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x7170f8], 0
je 0x4933e6
push dword [0x71716c]
call esi
push dword [0x717170]
call esi
mov eax, dword [0x70e5ac]
push eax
mov dword [0x70e5ac], 0xffffffff
call esi
cmp dword [0x7148f0], 0
je 0x49348c
mov eax, dword [0x7148dc]
test eax, eax
je 0x493417
mov eax, dword [eax + 8]
test eax, eax
je 0x493417
call eax
call fcn.0047f4e0
mov esi, dword [0x7148e4]
test esi, esi
je 0x493432
push esi
call ebx
push esi
call fcn.0062f9c7
add esp, 4
mov esi, dword [0x7148e8]
mov dword [0x7148e4], 0
test esi, esi
je 0x493452
push esi
call ebx
push esi
call fcn.0062f9c7
add esp, 4
mov esi, dword [0x7148e0]
mov dword [0x7148e8], 0
test esi, esi
je 0x493472
push esi
call ebx
push esi
call fcn.0062f9c7
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x7148e0], 0
mov dword [0x7148f0], 0
mov ecx, dword [0x717134]
test ecx, ecx
je 0x4934b5
call fcn.004b64f0
push dword [0x71712c]
mov dword [0x717134], 0
call esi
push dword [0x717130]
call esi
call fcn.004bd670
call fcn.004bd670
mov esi, dword [0x717148]
test esi, esi
je 0x493562
mov edi, dword [esi]
sub edi, 1
js 0x49353e
test esi, esi
je 0x4934e4
cmp edi, dword [esi]
jge 0x4934e4
mov eax, dword [esi + 4]
mov ebx, dword [eax + edi*4]
jmp 0x4934e6
xor ebx, ebx
test esi, esi
je 0x49351b
mov edx, dword [esi]
cmp edi, edx
jge 0x49351b
lea eax, [edx - 1]
cmp edi, eax
je 0x493516
mov eax, dword [esi + 4]
sub edx, edi
lea ecx, [eax + edi*4]
lea eax, [edx*4 - 4]
push eax
lea eax, [ecx + 4]
push eax
push ecx
call fcn.0062baa0
mov edx, dword [esi]
add esp, 0xc
lea eax, [edx - 1]
mov dword [esi], eax
mov ecx, dword [ebx]
call fcn.004ede50
push dword [ebx + 4]
call fcn.0062f9c7
push ebx
call fcn.0062f9c7
mov esi, dword [0x717148]
add esp, 8
sub edi, 1
jns 0x4934d4
test esi, esi
je 0x493562
cmp dword [esi], 0
jne 0x493562
push dword [esi + 4]
call fcn.0062f9c7
push esi
call fcn.0062f9c7
add esp, 8
mov dword [0x717148], 0
mov ebx, dword [0x716dc8]
test ebx, ebx
je 0x4935a9
xor esi, esi
cmp dword [ebx], esi
jle 0x49358e
mov eax, dword [ebx + 4]
mov edi, dword [eax + esi*4]
test edi, edi
je 0x493589
mov eax, dword [edi]
call eax
push edi
call fcn.0062f9c7
add esp, 4
inc esi
cmp esi, dword [ebx]
jl 0x493572
push dword [ebx + 4]
call fcn.0062f9c7
push ebx
call fcn.0062f9c7
add esp, 8
mov dword [0x716dc8], 0
mov esi, dword [0x717398]
test esi, esi
je 0x4935c3
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push esi
call fcn.0062f9c7
add esp, 4
mov ebx, dword [0x717228]
mov dword [0x717398], 0
test ebx, ebx
je 0x493618
xor edi, edi
cmp dword [ebx + 0xc], edi
jbe 0x493608
nop
mov eax, dword [ebx]
mov eax, dword [eax + edi*4]
test eax, eax
je 0x493602
nop dword [eax]
mov esi, dword [eax + 4]
push eax
call fcn.0062f9c7
add esp, 4
mov eax, esi
test esi, esi
jne 0x4935f0
inc edi
cmp edi, dword [ebx + 0xc]
jb 0x4935e0
push dword [ebx]
call fcn.0062f9c7
push ebx
call fcn.0062f9c7
add esp, 8
mov esi, dword [0x717224]
mov dword [0x717228], 0
test esi, esi
je 0x49363c
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push esi
call fcn.0062f9c7
add esp, 4
mov dword [0x717224], 0
mov ebx, 0x714880
nop dword [eax + eax]
mov edi, dword [ebx]
test edi, edi
je 0x493689
xor esi, esi
cmp dword [edi], esi
jle 0x493678
nop dword [eax]
mov eax, dword [edi + 4]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x493673
push eax
call fcn.0062f9c7
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x493660
push dword [edi + 4]
call fcn.0062f9c7
push edi
call fcn.0062f9c7
add esp, 8
mov dword [ebx], 0
add ebx, 4
cmp ebx, 0x7148c0
jl 0x493650
mov esi, dword [0x71487c]
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
test esi, esi
je 0x4936b6
push esi
call ebx
push esi
call fcn.0062f9c7
add esp, 4
cmp dword [0x716dd0], 0
mov dword [0x71487c], 0
je 0x4936d9
mov dword [0x716dd0], 0
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov esi, dword [0x717394]
test esi, esi
je 0x4936ef
push esi
call ebx
push esi
call fcn.0062f9c7
add esp, 4
mov esi, dword [0x714844]
mov dword [0x717394], 0
test esi, esi
je 0x49370f
push esi
call ebx
push esi
call fcn.0062f9c7
add esp, 4
mov ecx, 2
mov dword [0x714844], 0
call fcn.004c8bd0
mov ecx, 1
call fcn.004c8bd0
or ecx, 0xffffffff
call fcn.004c8bd0
mov edi, dword [0x716fdc]
test edi, edi
je 0x49376e
xor esi, esi
cmp dword [edi], esi
jle 0x49375d
mov eax, dword [edi + 4]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x493758
push eax
call fcn.0062f9c7
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x493745
push dword [edi + 4]
call fcn.0062f9c7
push edi
call fcn.0062f9c7
add esp, 8
mov edi, dword [0x717124]
mov dword [0x716fdc], 0
test edi, edi
je 0x4937b1
xor esi, esi
cmp dword [edi], esi
jle 0x4937a0
mov eax, dword [edi + 4]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x49379b
push eax
call fcn.0062f9c7
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x493788
push dword [edi + 4]
call fcn.0062f9c7
push edi
call fcn.0062f9c7
add esp, 8
mov esi, dword [0x717120]
mov dword [0x717124], 0
test esi, esi
je 0x4937d6
push dword [esi + 4]
call fcn.0062f9c7
push esi
call fcn.0062f9c7
add esp, 8
mov edi, dword [0x714848]
mov dword [0x717120], 0
test edi, edi
je 0x49381f
xor esi, esi
cmp dword [edi], esi
jle 0x49380e
mov eax, dword [edi + 4]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x493809
test byte [eax + 4], 1
je 0x493809
push eax
call fcn.0062f9c7
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x4937f0
push dword [edi + 4]
call fcn.0062f9c7
push edi
call fcn.0062f9c7
add esp, 8
mov eax, dword [0x716dd4]
test eax, eax
je 0x4938a2
mov edx, 0x489070
mov dword [eax + 0x20], 0
call fcn.00488e10
mov edx, 0x489090
call fcn.00488e10
mov edx, 0x4890a0
call fcn.00488e10
mov ebx, dword [0x716dd4]
test ebx, ebx
je 0x493898
xor edi, edi
cmp dword [ebx + 0xc], edi
jbe 0x493888
mov eax, dword [ebx]
mov eax, dword [eax + edi*4]
test eax, eax
je 0x493882
nop dword [eax + eax]
mov esi, dword [eax + 4]
push eax
call fcn.0062f9c7
add esp, 4
mov eax, esi
test esi, esi
jne 0x493870
inc edi
cmp edi, dword [ebx + 0xc]
jb 0x493862
push dword [ebx]
call fcn.0062f9c7
push ebx
call fcn.0062f9c7
add esp, 8
mov dword [0x716dd4], 0
cmp dword [0x71690c], 0
je 0x4938b7
push dword [0x716d14]
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov esi, dword [0x716d10]
test esi, esi
je 0x4938d1
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push esi
call fcn.0062f9c7
add esp, 4
mov ebx, dword [0x716904]
mov dword [0x716d10], 0
test ebx, ebx
je 0x493928
xor edi, edi
cmp dword [ebx + 0xc], edi
jbe 0x493918
nop dword [eax]
mov eax, dword [ebx]
mov eax, dword [eax + edi*4]
test eax, eax
je 0x493912
nop dword [eax]
mov esi, dword [eax + 4]
push eax
call fcn.0062f9c7
add esp, 4
mov eax, esi
test esi, esi
jne 0x493900
inc edi
cmp edi, dword [ebx + 0xc]
jb 0x4938f0
push dword [ebx]
call fcn.0062f9c7
push ebx
call fcn.0062f9c7
add esp, 8
pop edi
pop esi
mov dword [0x716904], 0
mov dword [0x7170d0], 0
pop ebx
ret