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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x664
mov eax, dword [0x418a28]
xor eax, esp
mov dword [esp + 0x660], eax
push ebx
push esi
xor esi, esi
push edi
mov edi, dword [ebp + 8]
cmp dword [edi + 4], esi
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], esi
mov dword [esp + 0x20], esi
mov byte [esp + 0x160], 0
jne 0x401c81
push esi
push esi
call dword [sym.imp.pthreadVC.dll_pthread_setcancelstate]
add esp, 8
test eax, eax
jne 0x4021a5
push esi
push esi
call dword [sym.imp.pthreadVC.dll_pthread_setcanceltype]
add esp, 8
test eax, eax
jne 0x4021a5
cmp dword [edi + 4], 0
jne 0x401cca
mov eax, dword [edi]
lea ecx, [esp + 0x24]
push ecx
push 0
push 0
lea edx, [esp + 0x64]
mov dword [esp + 0x68], eax
push edx
add eax, 1
push eax
mov dword [esp + 0x38], 0x5a
mov dword [esp + 0x3c], 0
mov dword [esp + 0x6c], 1
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
je 0x401d1f
test eax, eax
je 0x401d53
mov ecx, dword [edi + 8]
mov edx, dword [edi]
lea eax, [esp + 0x160]
push eax
push ecx
push edx
call fcn.00402250
mov esi, eax
add esp, 0xc
test esi, esi
je case.0x401e44.0
cmp esi, 0xfffffffd
je 0x4021a5
mov eax, dword [edi]
push 0
push 3
push eax
lea ebx, [esp + 0x16c]
call fcn.00405420
add esp, 0xc
cmp esi, 0xfffffffe
jne 0x401d6c
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401c81
mov ebx, 0x100
lea esi, [esp + 0x160]
mov edi, str.select__:
call fcn.00406290
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx]
push 0
push 1
push edx
mov ebx, esi
call fcn.00405420
mov edi, dword [esp + 0x1c]
add esp, 0xc
jmp 0x4021a5
mov eax, dword [edi]
push 0
push 2
push eax
mov ebx, str.The_RPCAP_initial_timeout_has_expired
call fcn.00405420
add esp, 0xc
jmp 0x4021a5
cmp esi, 0xffffffff
je 0x4021a5
cmp dword [edi + 4], 0
mov byte [esp + 0x160], 0
jne 0x401ddb
mov eax, dword [esp + 0xc]
test eax, eax
je 0x401d94
cmp dword [eax + 0x22c], 0
jne 0x401ddb
mov eax, dword [edi]
lea ecx, [esp + 0x24]
push ecx
push 0
push 0
lea edx, [esp + 0x64]
mov dword [esp + 0x68], eax
push edx
add eax, 1
push eax
mov dword [esp + 0x38], 0xb4
mov dword [esp + 0x3c], 0
mov dword [esp + 0x6c], 1
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
je 0x4020dd
test eax, eax
je 0x40210e
mov ebx, dword [edi]
xor esi, esi
push 0
mov eax, 8
sub eax, esi
push eax
lea ecx, [esp + esi + 0x20]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x40209d
test eax, eax
je 0x4020b9
add esi, eax
cmp esi, 8
jne 0x401ddf
mov eax, dword [edi]
push 0
push 1
push 6
push 0xb
push 0xa
push 9
push 5
push 4
push 3
push 2
lea edx, [esp + 0x40]
push edx
push eax
lea ecx, [esp + 0x190]
call fcn.004056b0
add eax, 3
add esp, 0x30
cmp eax, 0xe
ja case.0x401e44.0
jmp dword [eax*4 + 0x402214]
mov edx, dword [edi]
lea ecx, [esp + 0x160]
push ecx
push 0x10
push edx
mov ebx, str.The_RPCAP_daemon_received_a_message_that_is_not_valid
call fcn.00405420
add esp, 0xc
mov ecx, dword [edi]
lea eax, [esp + 0x160]
push eax
push 0x11
push ecx
mov ebx, str.RPCAP_version_number_mismatch
call fcn.00405420
add esp, 0xc
jmp case.0x401e44.0
mov edx, dword [esp + 0x1c]
mov esi, dword [sym.imp.WS2_32.dll_ntohl]
push edx
call esi
test eax, eax
je 0x401eb6
mov ecx, dword [esp + 0x1c]
push 0x100
lea eax, [esp + 0x164]
push eax
push ecx
call esi
mov edx, dword [edi]
push edx
mov ecx, eax
call fcn.004067a0
add esp, 0xc
mov eax, dword [edi]
push eax
lea ecx, [esp + 0x164]
call fcn.00402670
add esp, 4
jmp case.0x401e44.0
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x160]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_ntohl]
mov edx, dword [edi]
lea ecx, [esp + 0x26c]
push ecx
mov ecx, eax
call fcn.004029e0
add esp, 8
jmp case.0x401e44.0
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.WS2_32.dll_ntohl]
mov ecx, dword [edi]
push eax
lea eax, [esp + 0x3c]
push eax
push ecx
lea eax, [esp + 0x16c]
call fcn.004035b0
add esp, 0xc
jmp case.0x401e44.0
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x160]
push edx
push eax
call dword [sym.imp.WS2_32.dll_ntohl]
mov edx, dword [edi + 4]
push eax
lea ecx, [esp + 0x40]
push ecx
mov ecx, dword [edi]
push edx
lea eax, [esp + 0x30]
push eax
push ecx
lea ecx, [esp + 0x280]
call fcn.00402bb0
add esp, 0x18
mov dword [esp + 0xc], eax
jmp case.0x401e44.0
mov esi, dword [esp + 0xc]
test esi, esi
je 0x401f7f
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.WS2_32.dll_ntohl]
push eax
call fcn.004034c0
add esp, 4
jmp case.0x401e44.0
mov ecx, dword [edi]
lea eax, [esp + 0x160]
push eax
push 7
push ecx
mov ebx, str.Device_not_opened._Cannot_update_filter
call fcn.00405420
add esp, 0xc
jmp case.0x401e44.0
mov edx, dword [esp + 0x1c]
mov esi, dword [sym.imp.WS2_32.dll_ntohl]
push edx
call esi
test eax, eax
je 0x401fd0
mov ecx, dword [esp + 0x1c]
push 0x100
lea eax, [esp + 0x164]
push eax
push ecx
call esi
mov edx, dword [edi]
push edx
mov ecx, eax
call fcn.004067a0
add esp, 0xc
mov esi, dword [esp + 0xc]
test esi, esi
je 0x401fe2
call fcn.004036e0
jmp case.0x401e44.0
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
mov edi, dword [edi]
push eax
mov eax, dword [esp + 0x18]
push ecx
push edx
push eax
lea ecx, [esp + 0x170]
call fcn.004037e0
mov edi, dword [esp + 0x20]
add esp, 0x10
jmp case.0x401e44.0
mov esi, dword [esp + 0xc]
xor ebx, ebx
cmp esi, ebx
je 0x40207e
lea ecx, [esp + 0x40]
push ecx
push esi
call sub.wpcap.dll_pcap_stats
add esp, 8
test eax, eax
je 0x402050
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x14], edx
mov edx, dword [esi + 0x9c]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edx
jmp 0x402060
mov dword [esp + 0x34], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x14], ebx
lea eax, [esp + 0x160]
push eax
push esi
lea eax, [esp + 0x28]
call fcn.00403180
add esp, 8
mov dword [esp + 0xc], ebx
jmp case.0x401e44.0
mov edx, dword [edi]
lea ecx, [esp + 0x160]
push ecx
push 0xd
push edx
mov ebx, str.Device_not_opened._Cannot_close_the_capture
call fcn.00405420
add esp, 0xc
jmp case.0x401e44.0
mov ebx, 0x100
lea esi, [esp + 0x160]
mov edi, str.recv__:
call fcn.00406290
mov edi, dword [esp + 0x10]
jmp 0x40212b
push str.The_other_host_terminated_the_connection.
lea eax, [esp + 0x164]
push 0x100
push eax
call fcn.0040722a
add esp, 0xc
mov byte [esp + 0x25f], 0
jmp 0x40212b
mov ebx, 0x100
lea esi, [esp + 0x160]
mov edi, str.select__:
call fcn.00406290
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx]
push 0
push 1
push edx
mov ebx, esi
call fcn.00405420
mov edi, dword [esp + 0x1c]
add esp, 0xc
jmp 0x40212b
mov eax, dword [edi]
push 0
push 0xe
push eax
mov ebx, str.The_RPCAP_runtime_timeout_has_expired
call fcn.00405420
add esp, 0xc
jmp 0x40212b
mov dword [edi + 0xc], 1
mov ebx, dword [esp + 0xc]
test ebx, ebx
je 0x4021a5
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40214d
push eax
call dword [sym.imp.pthreadVC.dll_pthread_cancel]
add esp, 4
mov dword [esp + 0x20], 0
mov esi, dword [ebx + 0x22c]
test esi, esi
mov dword [esp + 0x14], esi
je 0x40219c
push 1
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
test eax, eax
je 0x40218b
xor ebx, ebx
xor esi, esi
mov edi, str.shutdown__:
call fcn.00406290
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0xc]
jmp 0x402192
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebx + 0x22c], 0
push ebx
call sub.wpcap.dll_pcap_close
add esp, 4
cmp dword [edi + 4], 0
jne 0x4021fc
mov esi, dword [edi]
test esi, esi
mov dword [esp + 0x14], esi
je 0x4021e8
push 1
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
test eax, eax
je 0x4021e1
xor ebx, ebx
xor esi, esi
mov edi, str.shutdown__:
call fcn.00406290
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edi, dword [esp + 0x10]
jmp 0x4021e8
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
push edi
call fcn.004076d6
add esp, 4
push 0
call dword [sym.imp.pthreadVC.dll_pthread_exit]
add esp, 4
mov ecx, dword [esp + 0x66c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004075d7
mov esp, ebp
pop ebp
ret