Function at 0x49fb00
Capabilities:
Get socket status
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x535b70]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
mov edi, dword [ebp + 8]
test edi, edi
je 0x49fe22
cmp dword [edi + 0x2c], 0xffffffff
je 0x49fe22
push esi
push dword [edi + 0x30]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [edi + 0x2c]
lea ecx, [ebp - 0x21c]
push ecx
lea ecx, [ebp - 0x108]
mov dword [ebp - 0x208], eax
push ecx
push 0
lea ecx, [ebp - 0x20c]
mov dword [ebp - 0x104], eax
push ecx
inc eax
mov dword [edi + 0x30], 0xffffffff
push eax
mov dword [ebp - 0x21c], 0xf
mov dword [ebp - 0x218], 0
mov dword [ebp - 0x20c], 1
mov dword [ebp - 0x108], 1
call dword [sym.imp.WS2_32.dll_select]
mov ecx, dword [edi + 0x2c]
test eax, eax
jns 0x49fbba
mov esi, dword [sym.imp.WS2_32.dll_closesocket]
push ecx
call esi
pop esi
mov dword [edi + 0x2c], 0xffffffff
or eax, 0xffffffff
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a55ed
mov esp, ebp
pop ebp
ret
push ebx
test eax, eax
jne 0x49fbe2
mov esi, dword [sym.imp.WS2_32.dll_closesocket]
push ecx
call esi
pop ebx
pop esi
mov dword [edi + 0x2c], 0xffffffff
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a55ed
mov esp, ebp
pop ebp
ret
cmp ecx, 0xffffffff
je 0x49fdfc
nop dword [eax + eax]
cmp dword [edi + 0x2c], 0xffffffff
je 0x49fdfc
mov ecx, dword [edi + 0x440]
cmp ecx, 0x400
ja 0x49fdfc
mov eax, dword [edi + 0x444]
cmp eax, 0x400
ja 0x49fdfc
cmp ecx, eax
jg 0x49fdfc
mov ebx, eax
mov dword [ebp - 0x214], ebx
test ecx, ecx
jle 0x49fc6c
sub eax, ecx
push eax
lea eax, [edi + 0x3c]
add eax, ecx
push eax
lea eax, [edi + 0x3c]
push eax
call fcn.004bd670
mov eax, dword [edi + 0x440]
add esp, 0xc
sub dword [edi + 0x444], eax
xor ecx, ecx
mov eax, dword [edi + 0x444]
mov ebx, eax
mov dword [edi + 0x440], 0
mov dword [ebp - 0x214], eax
mov edx, 0x400
sub edx, eax
jne 0x49fc79
xor eax, eax
jmp 0x49fcb0
push 0
push edx
lea eax, [edi + 0x3c]
add eax, ecx
push eax
push dword [edi + 0x2c]
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
js 0x49fdb9
add dword [edi + 0x444], eax
mov ecx, dword [edi + 0x444]
mov byte [ecx + edi + 0x3c], 0
mov ebx, dword [edi + 0x444]
mov dword [ebp - 0x214], ebx
test ebx, ebx
jne 0x49fcbc
test eax, eax
je 0x49fdfc
mov eax, dword [edi + 0x440]
lea esi, [edi + 0x3c]
add eax, 0x3c
add esi, ebx
add eax, edi
cmp eax, esi
jae 0x49fbf0
mov ecx, esi
sub ecx, eax
cmp ecx, 3
jl 0x49fd35
mov dl, byte [eax]
mov cl, dl
sub cl, 0x30
cmp cl, 9
ja 0x49fd35
mov ch, byte [eax + 1]
mov cl, ch
movsx edx, dl
sub cl, 0x30
cmp cl, 9
ja 0x49fd35
mov cl, byte [eax + 2]
mov byte [ebp - 0x20d], cl
sub cl, 0x30
cmp cl, 9
ja 0x49fd35
movsx ecx, ch
lea edx, [edx + edx*4]
lea ecx, [ecx + edx*2]
lea edx, [ecx + ecx*4]
movsx ecx, byte [ebp - 0x20d]
lea ecx, [ecx + edx*2]
add ecx, 0xffffeb30
mov edx, ecx
neg edx
cmp byte [eax + 3], 0x2d
cmovne edx, ecx
test edx, edx
jg 0x49fd5e
cmp byte [eax], 0xa
je 0x49fd50
inc eax
cmp eax, esi
jb 0x49fd35
mov eax, dword [ebp - 0x214]
mov dword [edi + 0x440], eax
jmp 0x49fbf0
inc eax
cmp eax, esi
jb 0x49fcd4
jmp 0x49fbf0
add eax, 3
mov ecx, eax
sub ecx, edi
sub ecx, 0x3c
mov dword [edi + 0x448], ecx
cmp eax, esi
jae 0x49fd7c
cmp byte [eax], 0xa
je 0x49fd7c
inc eax
cmp eax, esi
jb 0x49fd72
mov bl, byte [eax]
cmp bl, 0xa
jne 0x49fd87
mov bl, byte [eax + 1]
inc eax
cmp bl, 0xd
lea ecx, [eax + 1]
cmovne ecx, eax
lea eax, [edx - 0xc8]
sub ecx, edi
sub ecx, 0x3c
mov dword [edi + 0x440], ecx
cmp eax, 0x64
jae 0x49fdfc
pop ebx
pop esi
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a55ed
mov esp, ebp
pop ebp
ret
push str.recv_failed
push 0
push 9
call fcn.0048b8c0
mov esi, dword [sym.imp.WS2_32.dll_closesocket]
add esp, 0xc
push dword [edi + 0x2c]
call esi
mov dword [edi + 0x2c], 0xffffffff
push dword [edi + 0x2c]
call esi
pop ebx
pop esi
mov dword [edi + 0x2c], 0xffffffff
or eax, 0xffffffff
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a55ed
mov esp, ebp
pop ebp
ret
push dword [edi + 0x2c]
mov esi, dword [sym.imp.WS2_32.dll_closesocket]
call esi
pop ebx
pop esi
mov dword [edi + 0x2c], 0xffffffff
or eax, 0xffffffff
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a55ed
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
or eax, 0xffffffff
xor ecx, ebp
pop edi
call fcn.004a55ed
mov esp, ebp
pop ebp
ret