Function at 0x4835d0
Capabilities:
Get thread local storage value
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
push 1
call fcn.0049df20
pop ecx
mov ebx, eax
push 0x400
push 2
call fcn.0049cf60
add esp, 8
mov dword [ebp - 0x10], eax
mov eax, ebx
test eax, eax
je 0x48361a
mov eax, dword [ebx]
cmp eax, 0xf0123a42
jne 0x48361a
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x48361a
push 2
call fcn.0049e0e0
pop ecx
and eax, 0x2000
jne 0x48364e
push 1
call fcn.0049d010
pop ecx
mov dword [ebp - 0x18], eax
push 2
call fcn.0049d010
pop ecx
push eax
mov eax, dword [ebp - 0x18]
push eax
push 2
mov eax, dword [ebp + 8]
push eax
push 0
push 0xbc4
push 1
call fcn.00492c70
add esp, 0x1c
jmp 0x483a5e
mov eax, dword [ebp - 0x10]
push eax
call fcn.004a0ae0
pop ecx
mov dword [ebp - 0x10], eax
or eax, 0xffffffff
push eax
push 3
call fcn.0049cf60
add esp, 8
test eax, eax
je 0x483681
or eax, 0xffffffff
push eax
push 3
call fcn.0049cf60
add esp, 8
mov eax, dword [eax]
test eax, eax
jne 0x48368c
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov dword [ebp - 4], eax
jmp 0x4836ab
push 3
call fcn.0049dbf0
pop ecx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
cmp eax, dword [ebp - 4]
jge 0x4836ab
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x14], eax
xor esi, esi
mov dword [ebp - 0xc], 0
mov dword [ebx + 0xc], 0
lea eax, [0x6994ed]
mov dword [ebx + 8], eax
cmp dword [ebp + 0xc], 1
jne 0x4836f8
mov eax, dword [ebp - 4]
sub eax, esi
cmp eax, 0x578
jge 0x4836e9
mov eax, dword [ebp - 4]
sub eax, esi
mov dword [ebp - 0x18], eax
jmp 0x4836f0
mov dword [ebp - 0x18], 0x578
mov eax, dword [ebp - 0x18]
mov dword [ebp - 8], eax
jmp 0x4836fe
mov eax, dword [ebp - 4]
mov dword [ebp - 8], eax
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x7c], 0
je 0x483761
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx eax, word [eax + 0x80]
test eax, eax
jne 0x483761
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 0x483791
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]
push ebx
call fcn.004827d0
pop ecx
test eax, eax
je 0x483891
push 0
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0x14]
add eax, esi
push eax
mov eax, dword [ebx + 4]
push eax
call dword [sym.imp.WSOCK32.dll_recv]
mov edi, eax
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 0x48387c
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx eax, word [eax + 0x80]
test eax, eax
jne 0x48387c
push 0x7d87d8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x48384f
push 0xffffffffffffffff
push 0x7d87d8
push 0x7d87f8
call fcn.0048db80
add esp, 0xc
mov eax, dword [0x7d87f4]
test eax, eax
jne 0x48383b
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]
test edi, edi
jle 0x483882
add esi, edi
cmp dword [ebp + 0xc], 0
jne 0x4839cc
jmp 0x4839d9
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 0x483934
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx eax, word [eax + 0x80]
test eax, eax
jne 0x483934
push 0x7d87d8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x483907
push 0xffffffffffffffff
push 0x7d87d8
push 0x7d87f8
call fcn.0048db80
add esp, 0xc
mov eax, dword [0x7d87f4]
test eax, eax
jne 0x4838f3
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, dword [ebx + 0x24]
add dword [ebp - 0xc], eax
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x4839a1
push eax
call fcn.004903d0
pop ecx
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea eax, [eax + 0x10]
push eax
call fcn.0049fc50
pop ecx
test eax, eax
je 0x48396f
mov eax, dword [ebx + 0x28]
cmp eax, 0xffffffff
je 0x48399a
cmp dword [ebp - 0xc], eax
jl 0x48399a
or dword [ebx + 0xc], 0xffffffff
lea eax, str.Timeout
mov dword [ebx + 8], eax
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push esi
lea eax, [eax + 0x10]
push eax
call fcn.004a0410
add esp, 8
jmp 0x483a5e
mov edi, 1
jmp 0x4839cc
or dword [ebx + 0xc], 0xffffffff
lea eax, str.Timeout
mov dword [ebx + 8], eax
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push esi
lea eax, [eax + 0x10]
push eax
call fcn.004a0410
add esp, 8
jmp 0x483a5e
cmp esi, dword [ebp - 4]
jge 0x4839d9
test edi, edi
jg 0x4836cd
mov dword [ebx + 0x20], esi
test edi, edi
jne 0x483a0b
mov dword [ebx + 0xc], 0xfffffffe
lea eax, str.Connection_closed
mov dword [ebx + 8], eax
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push edi
lea eax, [eax + 0x10]
push eax
call fcn.004a0410
add esp, 8
jmp 0x483a5e
test edi, edi
jge 0x483a45
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov dword [ebx + 0xc], eax
push eax
call fcn.00534900
pop ecx
mov dword [ebx + 8], eax
push 0
call dword [sym.imp.WSOCK32.dll_WSASetLastError]
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push edi
lea eax, [eax + 0x10]
push eax
call fcn.004a0410
add esp, 8
jmp 0x483a5e
mov eax, dword [0x7d8230]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push esi
lea eax, [eax + 0x10]
push eax
call fcn.004a0410
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret