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

Disassembly:
sub esp, 0x11c
push ebx
push ebp
mov ebp, ecx
mov eax, dword [ebp + 0x5c]
xor ebx, ebx
cmp eax, ebx
push esi
push edi
je 0x10031232
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x11c
ret
cmp dword [0x1012b7e8], ebx
je 0x10031253
mov ecx, dword [0x1012acb0]
call sub.WINMM.dll_timeGetTime
mov edi, eax
add edi, dword [0x1012b7e8]
mov dword [esp + 0x18], edi
jmp 0x10031257
mov edi, dword [esp + 0x18]
mov eax, dword [0x1012b7e8]
xor esi, esi
cmp eax, ebx
je 0x10031275
mov ecx, dword [0x1012acb0]
call sub.WINMM.dll_timeGetTime
mov esi, edi
sub esi, eax
jns 0x10031275
xor esi, esi
mov eax, dword [ebp + 4]
mov dword [esp + 0x2c], eax
xor eax, eax
mov dword [esp + 0x28], 1
mov ecx, 0x3f
lea edi, [esp + 0x30]
rep stosd dword es:[edi], eax
mov eax, 0x10624dd3
imul esi
sar edx, 6
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
mov dword [esp + 0x20], edx
mov eax, esi
cdq
mov ecx, 0x3e8
idiv ecx
lea ecx, [esp + 0x28]
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
lea eax, [esp + 0x20]
push eax
push ebx
push ebx
push ecx
shl edx, 3
push ebx
mov dword [esp + 0x38], edx
call sub.WSOCK32.dll_select
cmp eax, ebx
je 0x100313be
cmp eax, 1
jne 0x100313a7
mov eax, dword [ebp + 4]
lea edx, [esp + 0x14]
push edx
push 0x4004667f
or esi, 0xffffffff
push eax
mov dword [esp + 0x20], esi
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
jne 0x100313bb
mov eax, dword [ebp + 0xc]
cmp eax, ebx
lea edi, [ebp + 8]
mov byte [esp + 0x13], bl
jne 0x10031317
xor edx, edx
jmp 0x1003131c
mov edx, dword [edi + 8]
sub edx, eax
mov ecx, dword [esp + 0x14]
cmp edx, ecx
jae 0x1003134a
cmp eax, ebx
jne 0x1003132c
xor edx, edx
jmp 0x10031331
mov edx, dword [edi + 8]
sub edx, eax
lea eax, [esp + 0x13]
sub ecx, edx
push eax
push ecx
mov ecx, dword [edi + 8]
push ecx
mov ecx, edi
call fcn.10033c40
mov ecx, dword [esp + 0x14]
jmp 0x1003137a
cmp eax, ebx
je 0x1003137a
mov edx, dword [edi + 8]
mov esi, edx
sub esi, eax
cmp ecx, esi
jae 0x1003137a
lea esi, [eax + ecx]
mov eax, edx
cmp eax, edx
je 0x10031370
mov cl, byte [eax]
mov byte [esi], cl
inc esi
inc eax
cmp eax, edx
jne 0x10031362
mov ecx, dword [esp + 0x14]
mov edx, dword [edi + 8]
mov dword [esp + 0x1c], edx
mov dword [edi + 8], esi
lea edx, [esp + 0x1c]
push edx
lea edx, [ebp + 0x38]
push edx
push ebx
mov dword [ebp + 0x58], ebx
mov eax, dword [ebp + 0xc]
push ecx
push eax
mov eax, dword [ebp + 4]
push eax
mov dword [esp + 0x34], 0x10
call sub.WSOCK32.dll_recvfrom
cmp eax, 0xffffffff
jne 0x100313cb
jmp 0x10031253
pop edi
pop esi
mov dword [ebp + 0x5c], 0xffffffff
pop ebp
xor eax, eax
pop ebx
add esp, 0x11c
ret
mov dword [ebp + 0x5c], esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x11c
ret
mov edx, dword [ebp + 0xc]
cmp edx, ebx
lea edi, [ebp + 8]
mov byte [esp + 0x13], bl
jne 0x100313dd
xor ecx, ecx
jmp 0x100313e2
mov ecx, dword [edi + 8]
sub ecx, edx
cmp ecx, eax
jae 0x1003141a
cmp edx, ebx
jne 0x100313ee
xor ecx, ecx
jmp 0x100313f3
mov ecx, dword [edi + 8]
sub ecx, edx
lea edx, [esp + 0x13]
sub eax, ecx
push edx
push eax
mov eax, dword [edi + 8]
push eax
mov ecx, edi
call fcn.10033c40
mov ecx, dword [ebp + 0x3c]
push ecx
call sub.WSOCK32.dll_ntohl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
cmp edx, ebx
je 0x10031445
mov esi, dword [edi + 8]
mov ecx, esi
sub ecx, edx
cmp eax, ecx
jae 0x10031445
add edx, eax
mov eax, esi
cmp eax, esi
je 0x1003143b
mov cl, byte [eax]
mov byte [edx], cl
inc edx
inc eax
cmp eax, esi
jne 0x10031431
mov eax, dword [edi + 8]
mov dword [esp + 0x18], eax
mov dword [edi + 8], edx
mov ecx, dword [ebp + 0x3c]
push ecx
call sub.WSOCK32.dll_ntohl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret