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

Disassembly:
cmp dword [0x7170a0], 0
je 0x49393f
cmp dword [0x717060], 0
jne 0x49393f
push ebx
push esi
push edi
mov dword [0x717060], 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 [0x7170b0]
test esi, esi
je 0x493397
mov eax, dword [esi]
call eax
push esi
mov esi, dword [esi + 4]
call fcn.0062f107
add esp, 4
test esi, esi
jne 0x493383
mov esi, dword [0x7170c8]
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov dword [0x7170b0], 0
test esi, esi
je 0x4933bd
push esi
call ebx
push esi
call fcn.0062f107
add esp, 4
cmp dword [0x7170c0], 0
mov esi, dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x7170c8], 0
je 0x4933e6
push dword [0x71713c]
call esi
push dword [0x717140]
call esi
mov eax, dword [0x70e5ac]
push eax
mov dword [0x70e5ac], 0xffffffff
call esi
cmp dword [0x7148c0], 0
je 0x49348c
mov eax, dword [0x7148ac]
test eax, eax
je 0x493417
mov eax, dword [eax + 8]
test eax, eax
je 0x493417
call eax
call fcn.0047f4e0
mov esi, dword [0x7148b4]
test esi, esi
je 0x493432
push esi
call ebx
push esi
call fcn.0062f107
add esp, 4
mov esi, dword [0x7148b8]
mov dword [0x7148b4], 0
test esi, esi
je 0x493452
push esi
call ebx
push esi
call fcn.0062f107
add esp, 4
mov esi, dword [0x7148b0]
mov dword [0x7148b8], 0
test esi, esi
je 0x493472
push esi
call ebx
push esi
call fcn.0062f107
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x7148b0], 0
mov dword [0x7148c0], 0
mov ecx, dword [0x717104]
test ecx, ecx
je 0x4934b5
call fcn.004b64f0
push dword [0x7170fc]
mov dword [0x717104], 0
call esi
push dword [0x717100]
call esi
call fcn.004bd670
call fcn.004bd670
mov esi, dword [0x717118]
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.0062b1e0
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.0062f107
push ebx
call fcn.0062f107
mov esi, dword [0x717118]
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.0062f107
push esi
call fcn.0062f107
add esp, 8
mov dword [0x717118], 0
mov ebx, dword [0x716d98]
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.0062f107
add esp, 4
inc esi
cmp esi, dword [ebx]
jl 0x493572
push dword [ebx + 4]
call fcn.0062f107
push ebx
call fcn.0062f107
add esp, 8
mov dword [0x716d98], 0
mov esi, dword [0x717368]
test esi, esi
je 0x4935c3
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push esi
call fcn.0062f107
add esp, 4
mov ebx, dword [0x7171f8]
mov dword [0x717368], 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.0062f107
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.0062f107
push ebx
call fcn.0062f107
add esp, 8
mov esi, dword [0x7171f4]
mov dword [0x7171f8], 0
test esi, esi
je 0x49363c
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push esi
call fcn.0062f107
add esp, 4
mov dword [0x7171f4], 0
mov ebx, 0x714850
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.0062f107
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x493660
push dword [edi + 4]
call fcn.0062f107
push edi
call fcn.0062f107
add esp, 8
mov dword [ebx], 0
add ebx, 4
cmp ebx, 0x714890
jl 0x493650
mov esi, dword [0x71484c]
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
test esi, esi
je 0x4936b6
push esi
call ebx
push esi
call fcn.0062f107
add esp, 4
cmp dword [0x716da0], 0
mov dword [0x71484c], 0
je 0x4936d9
mov dword [0x716da0], 0
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov esi, dword [0x717364]
test esi, esi
je 0x4936ef
push esi
call ebx
push esi
call fcn.0062f107
add esp, 4
mov esi, dword [0x714814]
mov dword [0x717364], 0
test esi, esi
je 0x49370f
push esi
call ebx
push esi
call fcn.0062f107
add esp, 4
mov ecx, 2
mov dword [0x714814], 0
call fcn.004c8bd0
mov ecx, 1
call fcn.004c8bd0
or ecx, 0xffffffff
call fcn.004c8bd0
mov edi, dword [0x716fac]
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.0062f107
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x493745
push dword [edi + 4]
call fcn.0062f107
push edi
call fcn.0062f107
add esp, 8
mov edi, dword [0x7170f4]
mov dword [0x716fac], 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.0062f107
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x493788
push dword [edi + 4]
call fcn.0062f107
push edi
call fcn.0062f107
add esp, 8
mov esi, dword [0x7170f0]
mov dword [0x7170f4], 0
test esi, esi
je 0x4937d6
push dword [esi + 4]
call fcn.0062f107
push esi
call fcn.0062f107
add esp, 8
mov edi, dword [0x714818]
mov dword [0x7170f0], 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.0062f107
add esp, 4
inc esi
cmp esi, dword [edi]
jl 0x4937f0
push dword [edi + 4]
call fcn.0062f107
push edi
call fcn.0062f107
add esp, 8
mov eax, dword [0x716da4]
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 [0x716da4]
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.0062f107
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.0062f107
push ebx
call fcn.0062f107
add esp, 8
mov dword [0x716da4], 0
cmp dword [0x7168dc], 0
je 0x4938b7
push dword [0x716ce4]
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov esi, dword [0x716ce0]
test esi, esi
je 0x4938d1
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push esi
call fcn.0062f107
add esp, 4
mov ebx, dword [0x7168d4]
mov dword [0x716ce0], 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.0062f107
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.0062f107
push ebx
call fcn.0062f107
add esp, 8
pop edi
pop esi
mov dword [0x7168d4], 0
mov dword [0x7170a0], 0
pop ebx
ret