Function at 0x51ec70
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
xor ebp, ebp
mov eax, dword [esi + 0xa8]
or eax, dword [esi + 0xac]
push edi
jne 0x51eca4
mov eax, dword [esi + 0xb0]
or eax, dword [esi + 0xb4]
jne 0x51eca4
push 7
push esi
call fcn.00526000
add esp, 8
mov ebx, dword [esp + 0x30]
mov edi, dword [esp + 0x2c]
or dword [ebx], 2
cmp dword [esi + 0x154], ebp
jne 0x51eebe
cmp dword [esi + 0xc70], ebp
jne 0x51ece0
push dword [esi + 0x8f8]
call dword [0x5ca750]
add esp, 4
mov dword [esi + 0xc70], eax
test eax, eax
je 0x51ee02
test byte [esi + 0x598], 4
mov eax, dword [esi + 0xc70]
mov dword [esi + 0x158], eax
jne 0x51efd9
cmp dword [esi + 0x128], 2
mov ecx, dword [esi + 0x15c]
jne 0x51ed66
cmp dword [ecx + 0x1a0], 2
jne 0x51ed66
and dword [esi + 0x148], 0xfffffffd
lea eax, [esp + 0x14]
push eax
mov dword [esi + 0x128], 1
call fcn.0051f080
movq xmm0, qword [eax]
movq qword [esi + 0x118], xmm0
movq xmm0, qword [eax + 8]
movq qword [esi + 0x120], xmm0
and dword [ebx], 0xfffffffd
mov eax, dword [esi + 0xa6c]
cdq
push 0
push edx
push eax
push esi
call fcn.00508f60
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [edi + 0x2c8]
test dword [eax + 0x40], 0x40003
je 0x51ed87
xor eax, eax
cmp dword [ecx + 0x1a0], 1
sete al
mov dword [esp + 0x28], eax
mov ebp, eax
lea eax, [esp + 0x28]
push eax
push dword [esi + 0x8f8]
push edi
call fcn.0051d2c0
add esp, 0xc
test eax, eax
jne 0x51f06f
mov ebx, dword [esp + 0x28]
test ebx, ebx
je 0x51efd9
jle 0x51efe6
mov dword [esi + 0x154], ebx
test ebp, ebp
jne 0x51ee9d
test byte [esi + 0xa9c], 0x40
je 0x51ee9d
cmp dword [esi + 0xcb8], ebp
jne 0x51ee0f
mov eax, dword [esi + 0x8f8]
add eax, eax
push eax
call dword [0x5ca750]
add esp, 4
mov dword [esi + 0xcb8], eax
test eax, eax
jne 0x51ee0f
push str.Failed_to_alloc_scratch_buffer_
push esi
call fcn.00517c40
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0x1b
pop ebx
add esp, 0x14
ret
xor edx, edx
xor ecx, ecx
test ebx, ebx
jle 0x51ee85
mov edi, dword [esp + 0x28]
jmp 0x51ee20
mov eax, dword [esi + 0x158]
mov bl, byte [edx + eax]
mov eax, dword [esi + 0xcb8]
cmp bl, 0xa
jne 0x51ee74
mov byte [ecx + eax], 0xd
mov eax, dword [esi + 0xcb8]
inc ecx
mov byte [ecx + eax], bl
test byte [esi + 0xa9c], 0x40
jne 0x51ee77
mov ebx, dword [esi + 0xf38]
mov ebp, dword [esi + 0xf3c]
mov eax, ebx
and eax, ebp
cmp eax, 0xffffffff
je 0x51ee77
add ebx, 1
adc ebp, 0
mov dword [esi + 0xf38], ebx
mov dword [esi + 0xf3c], ebp
jmp 0x51ee77
mov byte [ecx + eax], bl
inc edx
inc ecx
cmp edx, edi
jl 0x51ee20
mov edi, dword [esp + 0x2c]
mov ebx, dword [esp + 0x28]
cmp ecx, ebx
je 0x51ee9d
mov eax, dword [esi + 0xcb8]
mov ebx, ecx
mov dword [esi + 0x158], eax
mov dword [esi + 0x154], ecx
mov eax, dword [edi + 0x2c8]
test dword [eax + 0x40], 0x30000
je 0x51eebe
push ebx
push edi
call fcn.00533970
add esp, 8
test eax, eax
jne 0x51f06f
lea eax, [esp + 0x10]
push eax
push dword [esi + 0x154]
push dword [esi + 0x158]
push dword [edi + 0x2f0]
push edi
call fcn.005181b0
add esp, 0x14
test eax, eax
jne 0x51f06f
mov ebx, dword [edi + 0x2f0]
push eax
push eax
lea eax, [esp + 0x38]
push eax
push 4
lea eax, [esp + 0x38]
push eax
push 0
push 0
push 0x4004747b
push ebx
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x51ef26
push 4
lea eax, [esp + 0x2c]
push eax
push 0x1001
push 0xffff
push ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
test dword [esi + 0xa9c], 0x40000000
je 0x51ef47
push dword [esp + 0x10]
push dword [esi + 0x158]
push 4
push esi
call fcn.00517bb0
add esp, 0x10
mov eax, dword [esp + 0x10]
cdq
add dword [esi + 0xb0], eax
adc dword [esi + 0xb4], edx
push dword [esi + 0xb4]
push dword [esi + 0xb0]
push esi
call fcn.00525ee0
mov ecx, dword [esi + 0x598]
add esp, 0xc
test cl, 0x40
je 0x51ef80
test ecx, 0x100
je 0x51efb3
mov eax, dword [esi + 0xb0]
cmp eax, dword [esi + 0xf38]
jne 0x51efb3
mov eax, dword [esi + 0xb4]
cmp eax, dword [esi + 0xf3c]
jne 0x51efb3
or ecx, 4
push str.We_are_completely_uploaded_and_fine_n
push esi
mov dword [esi + 0x598], ecx
call fcn.00517d30
add esp, 8
mov eax, dword [esi + 0x154]
mov ecx, dword [esp + 0x10]
cmp eax, ecx
je 0x51f00b
add dword [esi + 0x158], ecx
sub eax, ecx
pop edi
mov dword [esi + 0x154], eax
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret
test byte [esi + 0x148], 0x20
jne 0x51f06d
and dword [esi + 0x148], 0xfffffffd
test byte [edi + 0x2a6], 1
je 0x51f06d
push edi
call fcn.0051dc30
add esp, 4
test eax, eax
je 0x51f06d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
cmp dword [esi + 0xc70], 0
jne 0x51f031
push dword [esi + 0x8f8]
call dword [0x5ca750]
add esp, 4
mov dword [esi + 0xc70], eax
test eax, eax
je 0x51ee02
test byte [esi + 0x598], 4
mov eax, dword [esi + 0xc70]
mov dword [esi + 0x158], eax
mov dword [esi + 0x154], 0
je 0x51f06d
and dword [esi + 0x148], 0xfffffffd
test byte [edi + 0x2a6], 1
je 0x51f06d
push edi
call fcn.0051dc30
add esp, 4
test eax, eax
jne 0x51f06f
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret