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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd0
mov eax, dword [0x6b306c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0xc0], eax
mov eax, dword [ebp + 0x10]
push esi
mov dword [ebp - 0xc8], eax
lea esi, [ebp - 0xa8]
mov eax, dword [ebp + 0x18]
push edi
mov dword [ebp - 0xd0], eax
xor edi, edi
xor eax, eax
mov dword [ebp - 0xc4], ebx
mov dword [ebp - 0xb8], edi
mov dword [ebp - 0xb0], esi
mov byte [ebp - 0xa9], al
test ebx, ebx
je 0x509baa
cmp dword [ebx], 0xbab1e
jne 0x509baa
cmp byte [ebx + 0xe6], al
je 0x5097a6
lea eax, [edi + 8]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040c879
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x14], eax
jge 0x5097c1
pop edi
pop esi
mov eax, 0xa
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040c879
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 4]
mov dword [ebp - 0xb4], eax
test eax, eax
je 0x509832
nop
lea ecx, [ebp - 0x58]
push ecx
push eax
call fcn.00508770
add esp, 8
mov ebx, eax
xor edx, edx
mov eax, 1
or esi, 0xffffffff
test ebx, eax
je 0x5097f2
mov esi, dword [ebp + edx*4 - 0x58]
inc edi
mov ecx, eax
rol ecx, 0x10
test ebx, ecx
je 0x509800
mov esi, dword [ebp + edx*4 - 0x58]
inc edi
cmp esi, 0xffffffff
je 0x50980d
inc edx
rol eax, 1
cmp edx, 5
jb 0x5097e6
mov eax, dword [ebp - 0xb4]
mov dword [ebp - 0xb8], edi
mov eax, dword [eax + 4]
mov dword [ebp - 0xb4], eax
test eax, eax
jne 0x5097d0
mov ebx, dword [ebp - 0xc4]
lea esi, [ebp - 0xa8]
lea eax, [ebp - 0xbc]
push eax
push ebx
call fcn.00509620
mov eax, dword [ebp - 0xbc]
add esp, 8
test eax, eax
js 0x509857
mov ecx, dword [ebp + 0x14]
cmp eax, ecx
cmovl ecx, eax
mov dword [ebp + 0x14], ecx
mov eax, dword [ebp - 0xc8]
add eax, edi
cmp byte [ebp + 0x20], 0
mov dword [ebp - 0xcc], eax
je 0x509875
cmp dword [ebx + 0xdc], 0xffffffff
je 0x509875
inc eax
cmp eax, 0xa
jbe 0x5098ae
shl eax, 3
push eax
call dword [0x6b3dfc]
mov esi, eax
add esp, 4
mov dword [ebp - 0xb0], esi
test esi, esi
jne 0x5098a7
pop edi
lea eax, [esi + 3]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040c879
mov esp, ebp
pop ebp
ret
mov byte [ebp - 0xa9], 1
xor ebx, ebx
mov dword [ebp - 0xb4], ebx
test edi, edi
je 0x50996e
mov eax, dword [ebp - 0xc4]
mov eax, dword [eax + 4]
mov dword [ebp - 0xbc], eax
test eax, eax
je 0x50996e
lea ecx, [ebp - 0x58]
push ecx
push eax
call fcn.00508770
add esp, 8
mov edi, eax
xor edx, edx
mov ecx, 1
nop dword [eax + eax]
or esi, 0xffffffff
test edi, ecx
je 0x509913
mov esi, dword [ebp - 0xb0]
mov eax, dword [ebp + edx*4 - 0x58]
mov dword [esi + ebx*8], eax
mov eax, 1
mov word [esi + ebx*8 + 4], ax
inc ebx
mov esi, dword [ebp + edx*4 - 0x58]
mov eax, ecx
rol eax, 0x10
test edi, eax
je 0x509938
mov esi, dword [ebp - 0xb0]
mov eax, dword [ebp + edx*4 - 0x58]
mov dword [esi + ebx*8], eax
mov eax, 4
mov word [esi + ebx*8 + 4], ax
inc ebx
mov esi, dword [ebp + edx*4 - 0x58]
cmp esi, 0xffffffff
je 0x509945
inc edx
rol ecx, 1
cmp edx, 5
jb 0x5098f0
mov eax, dword [ebp - 0xbc]
mov dword [ebp - 0xb4], ebx
mov eax, dword [eax + 4]
mov dword [ebp - 0xbc], eax
test eax, eax
jne 0x5098d5
mov edi, dword [ebp - 0xb8]
mov esi, dword [ebp - 0xb0]
mov eax, dword [ebp - 0xc8]
test eax, eax
je 0x509a00
lea ecx, [esi + 4]
mov edi, eax
mov esi, dword [ebp - 0xc0]
lea ecx, [ecx + ebx*8]
add esi, 4
add ebx, eax
mov dword [ebp - 0xb4], ebx
mov eax, dword [esi - 4]
xor edx, edx
mov dword [ecx - 4], eax
xor eax, eax
mov word [ecx], ax
movzx eax, word [esi]
mov ebx, eax
test al, 1
je 0x5099b8
mov eax, 1
mov word [ecx], ax
mov edx, eax
movzx ebx, word [esi]
movzx eax, bx
movzx ebx, dx
mov dword [ebp - 0xbc], ebx
mov ebx, eax
test al, 2
je 0x5099d8
or edx, 2
mov word [ecx], dx
movzx ebx, word [esi]
movzx eax, dx
jmp 0x5099de
mov eax, dword [ebp - 0xbc]
test bl, 4
je 0x5099e9
or eax, 4
mov word [ecx], ax
add ecx, 8
add esi, 8
sub edi, 1
jne 0x509995
mov edi, dword [ebp - 0xb8]
mov ebx, dword [ebp - 0xb4]
cmp byte [ebp + 0x20], 0
mov esi, dword [ebp - 0xb0]
je 0x509a31
mov eax, dword [ebp - 0xc4]
mov eax, dword [eax + 0xdc]
cmp eax, 0xffffffff
je 0x509a31
mov dword [esi + ebx*8], eax
mov eax, 1
mov word [esi + ebx*8 + 4], ax
inc ebx
mov dword [ebp - 0xb4], ebx
test ebx, ebx
je 0x509b1d
mov eax, dword [ebp + 0x14]
cdq
push edx
push eax
push ebx
push esi
call fcn.00524b80
add esp, 0x10
mov dword [ebp - 0xbc], eax
test eax, eax
jle 0x509b1d
cmp dword [ebp - 0xc8], 0
mov dword [ebp - 0xb8], eax
je 0x509ad7
mov ecx, dword [ebp - 0xc0]
lea edi, [edi*8 + 6]
add ecx, 6
add edi, esi
mov dword [ebp - 0xc0], ecx
nop
movsx ebx, word [edi]
lea edi, [edi + 8]
mov esi, ebx
mov edx, ebx
and esi, 1
mov eax, esi
or eax, 4
and dl, 4
movzx ecx, ax
mov eax, esi
cmove ecx, eax
movzx edx, cx
mov eax, edx
or eax, 2
and bl, 2
movzx ecx, ax
mov eax, edx
cmove ecx, eax
mov eax, dword [ebp - 0xc0]
mov word [eax], cx
add eax, 8
sub dword [ebp - 0xc8], 1
mov dword [ebp - 0xc0], eax
jne 0x509a80
mov ebx, dword [ebp - 0xb4]
mov esi, dword [ebp - 0xb0]
cmp byte [ebp + 0x20], 0
mov edi, dword [ebp - 0xc4]
je 0x509b27
cmp dword [edi + 0xdc], 0xffffffff
je 0x509b27
mov eax, dword [ebp - 0xcc]
test byte [esi + eax*8 + 6], 1
je 0x509b27
mov esi, dword [sym.imp.WS2_32.dll_recv]
nop
push 0
push 0x40
lea eax, [ebp - 0x44]
push eax
push dword [edi + 0xdc]
call esi
test eax, eax
jg 0x509b00
mov esi, dword [ebp - 0xbc]
dec esi
jmp 0x509b2d
mov edi, dword [ebp - 0xc4]
xor esi, esi
jmp 0x509b2d
mov esi, dword [ebp - 0xb8]
cmp byte [ebp - 0xa9], 0
je 0x509b45
push dword [ebp - 0xb0]
call dword [0x6b3e00]
add esp, 4
mov eax, dword [ebp - 0xd0]
test eax, eax
je 0x509b51
mov dword [eax], esi
cmp byte [ebp + 0x1c], 0
je 0x509b97
test ebx, ebx
jne 0x509b97
lea eax, [ebp - 0xc0]
mov dword [ebp - 0xc0], ebx
push eax
push edi
call fcn.00508220
add esp, 8
test eax, eax
jne 0x509b97
mov eax, dword [ebp - 0xc0]
test eax, eax
je 0x509b97
mov ecx, dword [ebp + 0x14]
cmp eax, ecx
jg 0x509b8a
test eax, eax
jns 0x509b8c
mov eax, ecx
cdq
push edx
push eax
call fcn.00524f20
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040c879
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040c879
mov esp, ebp
pop ebp
ret