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

Disassembly:
sub esp, 0x594
mov eax, dword [esp + 0x5a4]
push ebx
push ebp
xor ebx, ebx
push esi
cmp eax, 2
push edi
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x28], ebx
jne 0x1004b9cd
mov ebp, dword [esp + 0x5a8]
mov esi, dword [sym.imp.WS2_32.dll_getsockopt]
lea eax, [esp + 0x10]
lea ecx, [esp + 0x20]
push eax
push ecx
push 0xa
push ebx
mov dword [esp + 0x20], 4
push ebp
jmp 0x1004ba07
mov ebp, dword [esp + 0x5a8]
mov esi, dword [sym.imp.WS2_32.dll_getsockopt]
lea edx, [esp + 0x10]
lea eax, [esp + 0x18]
push edx
push eax
push 0xa
mov edi, 4
push 0x29
push ebp
mov dword [esp + 0x24], edi
call esi
lea ecx, [esp + 0x10]
lea edx, [esp + 0x28]
push ecx
push edx
push 0x1b
push 0x29
mov dword [esp + 0x20], edi
push ebp
call esi
lea eax, [esp + 0x10]
lea ecx, [esp + 0x17]
mov edi, 1
push eax
push ecx
push edi
push 6
push ebp
mov byte [esp + 0x2b], bl
mov dword [esp + 0x24], edi
call esi
lea edx, [esp + 0x10]
lea eax, [esp + 0x24]
push edx
push eax
push 0x1001
push 0xffff
push ebp
mov dword [esp + 0x38], ebx
mov dword [esp + 0x24], 4
call esi
mov eax, dword [esp + 0x5b4]
mov byte [esp + 0x15], bl
cmp eax, 2
jne 0x1004ba71
lea ecx, [esp + 0x10]
lea edx, [esp + 0x15]
push ecx
push edx
push 0x20
push 0xffff
push ebp
mov dword [esp + 0x24], edi
call esi
lea eax, [esp + 0x10]
lea ecx, [esp + 0x16]
push eax
push ecx
push 4
push 0xffff
push ebp
mov byte [esp + 0x2a], bl
mov dword [esp + 0x24], edi
call esi
mov ecx, 0x5c
xor eax, eax
lea edi, [esp + 0x34]
mov dword [esp + 0x30], ebx
rep stosd dword es:[edi], eax
lea edx, [esp + 0x10]
lea eax, [esp + 0x30]
push edx
push eax
push 0x2004
push 0xffff
push ebp
mov dword [esp + 0x24], 0x174
call esi
lea ecx, [esp + 0x10]
lea edx, [esp + 0x1c]
push ecx
push edx
push 0x1002
mov edi, 4
push 0xffff
push ebp
mov dword [esp + 0x30], ebx
mov dword [esp + 0x24], edi
call esi
cmp byte [esp + 0x5b0], bl
je 0x1004bb42
cmp dword [esp + 0x88], 1
je 0x1004bafd
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x1004bb42
mov edi, dword [sym.imp.WS2_32.dll_shutdown]
push 1
push ebp
call edi
test eax, eax
je 0x1004bb12
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, dword [sym.imp.WS2_32.dll_recv]
push ebx
lea eax, [esp + 0x1a8]
push 0x400
push eax
push ebp
call esi
cmp eax, ebx
je 0x1004bb32
cmp eax, 0xffffffff
jne 0x1004bb18
push ebx
push ebp
call edi
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
mov edi, 4
cmp dword [esp + 0x5ac], ebx
je 0x1004bc76
mov ecx, dword [esp + 0x88]
xor eax, eax
cmp ecx, 3
jne 0x1004bb6f
mov eax, dword [esp + 0x5b4]
sub eax, 2
neg eax
sbb eax, eax
and eax, 0x39
inc eax
push eax
push ecx
mov ecx, dword [esp + 0x84]
push ecx
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x1004bb99
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x594
ret 0x10
mov eax, dword [esp + 0x5b4]
mov dword [esp + 0x10], edi
cmp eax, 2
push edi
jne 0x1004bbbb
mov edi, dword [sym.imp.WS2_32.dll_setsockopt]
lea edx, [esp + 0x24]
push edx
push 0xa
push ebx
push esi
jmp 0x1004bbe1
mov edi, dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [esp + 0x1c]
push eax
push 0xa
push 0x29
push esi
call edi
lea ecx, [esp + 0x28]
push 4
push ecx
push 0x1b
push 0x29
mov dword [esp + 0x20], 4
push esi
call edi
mov ebx, 1
lea edx, [esp + 0x17]
push ebx
push edx
push ebx
push 6
push esi
mov dword [esp + 0x24], ebx
call edi
lea eax, [esp + 0x24]
push 4
push eax
push 0x1001
push 0xffff
push esi
mov dword [esp + 0x24], 4
call edi
cmp dword [esp + 0x5b4], 2
jne 0x1004bc32
lea ecx, [esp + 0x15]
push ebx
push ecx
push 0x20
push 0xffff
push esi
mov dword [esp + 0x24], ebx
call edi
lea edx, [esp + 0x16]
push ebx
push edx
push 4
push 0xffff
push esi
mov dword [esp + 0x24], ebx
call edi
lea eax, [esp + 0x1c]
push 4
push eax
push 0x1002
push 0xffff
push esi
mov dword [esp + 0x24], 4
call edi
mov ecx, dword [esp + 0x2c]
push esi
push ebp
call fcn.10049fa0
mov ecx, dword [esp + 0x5ac]
mov dword [ecx], esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x594
ret 0x10