Function at 0x40d420
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x417014]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [ebp + 8], 0
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov ebx, ecx
jne 0x40d5e9
cmp dword [ebx + 0x20], 0
je 0x40d56d
mov eax, dword [edi + 0x28]
add dword [edi + 0x30], eax
mov edx, dword [edi + 0x30]
mov ecx, dword [edi + 0x2c]
mov eax, dword [edi + 0x20]
cmp edx, ecx
jae 0x40d4a4
mov dword [edi + 0x18], 2
cmp dword [ebx + 0x20], 0
je 0x40d478
add eax, edx
sub ecx, edx
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], ecx
jmp 0x40d483
mov dword [ebp - 0x18], eax
mov eax, dword [0x41761c]
mov dword [ebp - 0x1c], eax
push 0
push edi
lea eax, [ebp - 8]
mov dword [ebp - 0xc], 0
push eax
lea eax, [ebp - 0xc]
mov dword [ebp - 8], 0
push eax
lea eax, [ebp - 0x1c]
jmp 0x40d5c5
mov esi, dword [eax]
cmp esi, 0x3e80000
ja 0x40d5e9
lea eax, [esi + 4]
cmp edx, eax
jae 0x40d52c
mov eax, dword [edi + 0x20]
push eax
call dword [sym.imp.mfc140u.dll_operator_2]
lea eax, [esi + 4]
push eax
call dword [sym.imp.mfc140u.dll_operator_1]
mov dword [edi + 0x20], eax
lea ecx, [esi + 4]
mov dword [edi + 0x2c], ecx
add esp, 8
mov dword [edi + 0x30], 4
mov dword [eax], esi
mov eax, dword [edi + 0x20]
mov dword [edi + 0x18], 2
cmp dword [ebx + 0x20], 0
je 0x40d500
add eax, dword [edi + 0x30]
mov dword [ebp - 0x18], eax
mov eax, dword [edi + 0x2c]
sub eax, dword [edi + 0x30]
jmp 0x40d508
mov dword [ebp - 0x18], eax
mov eax, dword [0x41761c]
push 0
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0xc]
push edi
push eax
lea eax, [ebp - 8]
mov dword [ebp - 8], 0
push eax
mov dword [ebp - 0xc], 0
lea eax, [ebp - 0x1c]
jmp 0x40d5c5
lea eax, [ecx - 4]
test eax, eax
je 0x40d54d
push dword [ebx + 4]
lea eax, [ecx - 4]
push eax
mov eax, dword [edi + 0x20]
add eax, 4
push eax
push 2
push dword [edi + 0x1c]
push ebx
call dword [0x4192c8]
push dword [edi + 0x20]
call dword [sym.imp.mfc140u.dll_operator_2]
push 4
call dword [sym.imp.mfc140u.dll_operator_1]
add esp, 8
mov dword [edi + 0x20], eax
mov dword [edi + 0x2c], 4
jmp 0x40d582
push dword [ebx + 4]
push dword [edi + 0x28]
push dword [edi + 0x20]
push 2
push dword [edi + 0x1c]
push ebx
call dword [0x4192c8]
mov eax, dword [edi + 0x20]
mov dword [edi + 0x30], 0
mov dword [edi + 0x18], 2
cmp dword [ebx + 0x20], 0
mov dword [ebp - 0x20], eax
je 0x40d5a1
mov eax, dword [edi + 0x2c]
jmp 0x40d5a6
mov eax, dword [0x41761c]
push 0
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x10]
push edi
push eax
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
mov dword [ebp - 0x10], 0
lea eax, [ebp - 0x24]
push 1
push eax
push dword [edi + 0x1c]
call dword [sym.imp.WS2_32.dll_WSARecv]
test eax, eax
je 0x40d62b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x271e
je 0x40d62b
cmp eax, 0x3e5
je 0x40d62b
lea esi, [ebx + 8]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
dec dword [ebx + 4]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push dword [ebx + 4]
push 0
push 0
push 3
push dword [edi + 0x1c]
push ebx
call dword [0x4192c8]
push dword [edi + 0x20]
call dword [sym.imp.mfc140u.dll_operator_2]
push 0x34
push edi
mov dword [edi + 0x20], 0
call fcn.0040ee7c
add esp, 0xc
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040e8e5
mov esp, ebp
pop ebp
ret 8