Function at 0x10002080
Capabilities:
Receive data
Receive data on socket
Set socket configuration

Disassembly:
sub esp, 0x1c
cmp byte [esp + 0x20], 0
push ebx
push ebp
push esi
mov esi, eax
je 0x10002103
lea ebp, [esi + 8]
push ebp
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
or ebx, 0xffffffff
add dword [esi + 4], ebx
push ebp
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [esi + 4]
mov ecx, dword [edi + 0x1c]
push eax
push 0
push 0
push 3
push ecx
push esi
call dword [0x10005034]
mov esi, dword [edi + 0x1c]
cmp esi, ebx
je 0x100020fb
push 4
lea ecx, [esp + 0x30]
push ecx
push 0x80
push 0xffff
mov edx, 1
xor eax, eax
push esi
mov word [esp + 0x40], dx
mov word [esp + 0x42], ax
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi + 0x1c], ebx
jmp 0x10002381
mov eax, dword [edi + 0x28]
xor ebp, ebp
cmp dword [esi + 0x20], ebp
je 0x100022c6
add dword [edi + 0x30], eax
mov edx, dword [edi + 0x30]
mov eax, dword [edi + 0x2c]
cmp edx, eax
jae 0x100021d9
mov dword [edi + 0x18], 2
cmp dword [esi + 0x20], ebp
je 0x1000213b
mov ecx, dword [edi + 0x20]
add ecx, edx
mov dword [esp + 0x1c], ecx
sub eax, edx
jmp 0x10002147
mov edx, dword [edi + 0x20]
mov eax, dword [0x10005010]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
push ebp
push edi
lea ecx, [esp + 0x34]
push ecx
mov ecx, dword [edi + 0x1c]
lea edx, [esp + 0x18]
push edx
push 1
lea eax, [esp + 0x2c]
push eax
push ecx
mov dword [esp + 0x28], ebp
mov dword [esp + 0x48], ebp
call dword [sym.imp.WS2_32.dll_WSARecv]
test eax, eax
je 0x1000239a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x271e
je 0x1000239a
cmp eax, 0x3e5
je 0x1000239a
lea ebx, [esi + 8]
push ebx
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
dec dword [esi + 4]
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov edx, dword [esi + 4]
mov eax, dword [edi + 0x1c]
push edx
push ebp
push ebp
push 3
push eax
push esi
call dword [0x10005034]
mov ecx, dword [edi + 0x20]
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push edi
mov dword [edi + 0x20], ebp
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 8
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 4
mov ecx, dword [edi + 0x20]
mov ebx, dword [ecx]
cmp ebx, 0x3e80000
jbe 0x10002226
lea ebx, [esi + 8]
push ebx
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
or ebp, 0xffffffff
add dword [esi + 4], ebp
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov edx, dword [esi + 4]
mov eax, dword [edi + 0x1c]
push edx
push 0
push 0
push 3
push eax
push esi
call dword [0x10005034]
mov esi, dword [edi + 0x1c]
call fcn.100016d0
mov ecx, dword [edi + 0x20]
mov dword [edi + 0x1c], ebp
push ecx
jmp 0x10002385
lea ebp, [ebx + 4]
cmp edx, ebp
jae 0x10002285
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push ebp
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov dword [edi + 0x20], eax
mov dword [edi + 0x2c], ebp
mov dword [edi + 0x30], 4
mov dword [eax], ebx
mov edx, dword [edi + 0x20]
xor ebp, ebp
add esp, 8
mov dword [edi + 0x18], 2
cmp dword [esi + 0x20], ebp
je 0x10002273
mov eax, dword [edi + 0x30]
mov ecx, dword [edi + 0x2c]
add edx, eax
sub ecx, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
jmp 0x1000214b
mov eax, dword [0x10005010]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
jmp 0x1000214b
lea edx, [eax - 4]
test edx, edx
jbe 0x100022a5
mov edx, dword [esi + 4]
push edx
add eax, 0xfffffffc
push eax
mov eax, dword [edi + 0x1c]
add ecx, 4
push ecx
push 2
push eax
push esi
call dword [0x10005034]
mov ecx, dword [edi + 0x20]
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push 4
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 8
mov dword [edi + 0x20], eax
mov dword [edi + 0x2c], 4
xor ebp, ebp
jmp 0x100022dc
mov edx, dword [esi + 4]
mov ecx, dword [edi + 0x20]
push edx
mov edx, dword [edi + 0x1c]
push eax
push ecx
push 2
push edx
push esi
call dword [0x10005034]
mov dword [edi + 0x30], ebp
mov dword [edi + 0x18], 2
cmp dword [esi + 0x20], ebp
je 0x100022fb
mov eax, dword [edi + 0x20]
mov ecx, dword [edi + 0x2c]
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], ecx
jmp 0x1000230b
mov edx, dword [edi + 0x20]
mov eax, dword [0x10005010]
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], eax
push ebp
push edi
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [edi + 0x1c]
lea edx, [esp + 0x20]
push edx
push 1
lea eax, [esp + 0x34]
push eax
push ecx
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], ebp
call dword [sym.imp.WS2_32.dll_WSARecv]
test eax, eax
je 0x1000239a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x271e
je 0x1000239a
cmp eax, 0x3e5
je 0x1000239a
lea ebx, [esi + 8]
push ebx
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
or ebp, 0xffffffff
add dword [esi + 4], ebp
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov edx, dword [esi + 4]
mov eax, dword [edi + 0x1c]
push edx
push 0
push 0
push 3
push eax
push esi
call dword [0x10005034]
mov ecx, dword [edi + 0x1c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi + 0x1c], ebp
mov edx, dword [edi + 0x20]
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push edi
mov dword [edi + 0x20], 0
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 8
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 4