Function at 0x51f750
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov byte [ebp - 1], 0
mov eax, dword [esi + 0x90]
or eax, dword [esi + 0x94]
jne 0x51f78b
mov eax, dword [esi + 0x98]
or eax, dword [esi + 0x9c]
jne 0x51f78b
push 7
lea eax, [ebp - 0x1c]
push esi
push eax
call fcn.00520000
add esp, 0xc
mov eax, dword [ebp + 0x10]
xor ebx, ebx
mov dword [ebp - 8], ebx
or dword [eax], 2
mov edi, dword [esi + 0x11c]
test edi, edi
je 0x51f803
mov eax, dword [esi + 0x4b4]
shr eax, 5
cmp edi, eax
jge 0x51f7f7
cmp byte [esi + 0x149], bl
jne 0x51f7f7
cmp byte [esi + 0x144], bl
jne 0x51f7f7
mov ecx, dword [esi + 0x98]
sub ecx, dword [esi + 0xb0]
mov eax, dword [esi + 0x9c]
sbb eax, dword [esi + 0xb4]
mov dword [ebp - 0xc], eax
mov eax, edi
cdq
add ecx, eax
mov eax, dword [ebp - 0xc]
adc eax, edx
cmp ecx, dword [esi + 0xc78]
jne 0x51f7f2
cmp eax, dword [esi + 0xc7c]
je 0x51f7f7
mov ebx, edi
mov dword [ebp - 8], edi
test edi, edi
je 0x51f803
test ebx, ebx
je 0x51fa44
cmp dword [esi + 0x8b8], 0
jne 0x51f829
push dword [esi + 0x4b4]
call dword [0x63f144]
add esp, 4
mov dword [esi + 0x8b8], eax
test eax, eax
je 0x51f970
test ebx, ebx
je 0x51f84b
mov eax, dword [esi + 0x8b8]
cmp dword [esi + 0x120], eax
je 0x51f84b
push ebx
push dword [esi + 0x120]
push eax
call fcn.005787c0
add esp, 0xc
cmp byte [esi + 0x144], 0
mov edx, dword [esi + 0x8b8]
mov dword [esi + 0x120], edx
jne 0x51fc56
cmp dword [esi + 0xf8], 2
mov ecx, dword [esi + 0x124]
jne 0x51f8c3
cmp dword [ecx + 0x1a8], 2
jne 0x51f8c3
and dword [esi + 0xe4], 0xfffffffd
lea eax, [ebp - 0x1c]
push eax
mov dword [esi + 0xf8], 1
call fcn.00506340
push 0
movups xmm0, xmmword [eax]
mov eax, dword [ebp + 0x10]
movups xmmword [esi + 0xe8], xmm0
and dword [eax], 0xfffffffd
mov eax, dword [esi + 0x684]
cdq
push edx
push eax
push esi
call fcn.00500600
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0xc]
mov eax, dword [edi + 0x1e0]
test dword [eax + 0x44], 0x40003
je 0x51f8e0
cmp dword [ecx + 0x1a8], 1
sete byte [ebp - 1]
lea eax, [edx + ebx]
mov dword [esi + 0x120], eax
lea eax, [ebp + 0x10]
push eax
mov eax, dword [esi + 0x4b4]
sub eax, ebx
push eax
push esi
call fcn.0051dc70
sub dword [esi + 0x120], ebx
add esp, 0xc
test eax, eax
jne 0x51fc71
mov edx, dword [ebp + 0x10]
add edx, ebx
mov dword [ebp + 0x10], edx
je 0x51fc56
test edx, edx
jle 0x51fc5f
mov dword [esi + 0x11c], edx
cmp byte [ebp - 1], al
jne 0x51fa1f
cmp byte [esi + 0x6b7], al
je 0x51fa1f
cmp dword [esi + 0x924], eax
jne 0x51f97c
mov eax, dword [esi + 0x4b4]
add eax, eax
push eax
call dword [0x63f144]
add esp, 4
mov dword [esi + 0x924], eax
test eax, eax
jne 0x51f97c
push str.Failed_to_alloc_scratch_buffer
push esi
call fcn.00511d20
add esp, 8
mov eax, 0x1b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test ebx, ebx
je 0x51f995
push ebx
push dword [esi + 0x120]
push dword [esi + 0x924]
call fcn.0057a2f0
add esp, 0xc
mov edx, ebx
mov ecx, ebx
cmp ebx, dword [ebp + 0x10]
jge 0x51fa04
nop
mov eax, dword [esi + 0x120]
mov bl, byte [edx + eax]
mov eax, dword [esi + 0x924]
cmp bl, 0xa
jne 0x51f9f4
mov byte [ecx + eax], 0xd
inc ecx
mov eax, dword [esi + 0x924]
mov byte [ecx + eax], bl
cmp byte [esi + 0x6b7], 0
jne 0x51f9f7
mov edi, dword [esi + 0xc78]
mov eax, edi
mov ebx, dword [esi + 0xc7c]
and eax, ebx
cmp eax, 0xffffffff
je 0x51f9f7
add edi, 1
mov dword [esi + 0xc78], edi
adc ebx, 0
mov dword [esi + 0xc7c], ebx
jmp 0x51f9f7
mov byte [ecx + eax], bl
inc edx
inc ecx
cmp edx, dword [ebp + 0x10]
jl 0x51f9a0
mov ebx, dword [ebp - 8]
mov edi, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
cmp ecx, edx
je 0x51fa1f
mov eax, dword [esi + 0x924]
mov edx, ecx
mov dword [esi + 0x120], eax
mov dword [esi + 0x11c], ecx
mov eax, dword [edi + 0x1e0]
test dword [eax + 0x44], 0x30000
je 0x51fa47
push ebx
push edx
push esi
call fcn.005341b0
add esp, 0xc
test eax, eax
je 0x51fa47
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0xc]
lea eax, [ebp + 8]
push eax
push dword [esi + 0x11c]
push dword [esi + 0x120]
push dword [edi + 0x1fc]
push esi
call fcn.00511ee0
add esp, 0x14
test eax, eax
jne 0x51fc71
lea eax, [ebp - 0x2c]
push eax
call fcn.00506340
sub esp, 0xc
mov ecx, esp
sub esp, 0x10
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x1c], xmm0
movups xmm0, xmmword [esi + 0x130]
movups xmmword [ecx], xmm0
mov ecx, esp
movups xmm0, xmmword [eax]
movups xmmword [ecx], xmm0
call fcn.005063e0
add esp, 0x20
test edx, edx
jl 0x51faf7
jg 0x51faad
cmp eax, 0x3e8
jbe 0x51faf7
mov edi, dword [edi + 0x1fc]
lea eax, [ebp - 0xc]
push 0
push 0
push eax
push 4
lea eax, [ebp + 0x10]
push eax
push 0
push 0
push 0x4004747b
push edi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x51faec
push 4
lea eax, [ebp + 0x10]
push eax
push 0x1001
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
movups xmm0, xmmword [ebp - 0x1c]
movups xmmword [esi + 0x130], xmm0
mov ebx, dword [esi + 0xb0]
mov eax, ebx
mov edi, dword [esi + 0xb4]
or eax, edi
mov dword [ebp + 0x10], ebx
mov dword [ebp - 8], edi
je 0x51fb5a
mov eax, dword [ebp + 8]
cdq
cmp edi, edx
jg 0x51fb1d
jl 0x51fb27
cmp ebx, eax
jb 0x51fb27
mov ebx, eax
mov dword [ebp + 0x10], eax
mov edi, edx
mov dword [ebp - 8], edx
push ebx
push dword [esi + 0x120]
push 2
push esi
call fcn.00511c90
add esp, 0x10
sub dword [esi + 0xb0], ebx
sbb dword [esi + 0xb4], edi
mov edi, dword [ebp + 8]
mov eax, edi
cdq
mov ebx, eax
mov eax, edx
sub ebx, dword [ebp + 0x10]
sbb eax, dword [ebp - 8]
mov dword [ebp + 0x10], eax
jmp 0x51fb67
mov edi, dword [ebp + 8]
mov eax, edi
cdq
mov ebx, eax
mov dword [ebp + 0x10], edx
mov eax, edx
mov ecx, ebx
or ecx, eax
je 0x51fba8
mov eax, dword [esi + 0x120]
sub eax, ebx
push ebx
add eax, edi
push eax
push 4
push esi
call fcn.00511c90
add dword [esi + 0x98], ebx
mov eax, dword [ebp + 0x10]
adc dword [esi + 0x9c], eax
push dword [esi + 0x9c]
push dword [esi + 0x98]
push esi
call fcn.0051fec0
mov edi, dword [ebp + 8]
add esp, 0x1c
cmp byte [esi + 0x149], 0
je 0x51fbba
cmp byte [esi + 0x14b], 0
je 0x51fbee
mov eax, dword [esi + 0x98]
cmp eax, dword [esi + 0xc78]
jne 0x51fbee
mov eax, dword [esi + 0x9c]
cmp eax, dword [esi + 0xc7c]
jne 0x51fbee
push str.We_are_completely_uploaded_and_fine
push esi
mov byte [esi + 0x144], 1
call fcn.00511de0
mov edi, dword [ebp + 8]
add esp, 8
mov eax, dword [esi + 0x11c]
cmp eax, edi
je 0x51fc0f
add dword [esi + 0x120], edi
sub eax, edi
mov dword [esi + 0x11c], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x8b8], 0
jne 0x51fc35
push dword [esi + 0x4b4]
call dword [0x63f144]
add esp, 4
mov dword [esi + 0x8b8], eax
test eax, eax
je 0x51f970
cmp byte [esi + 0x144], 0
mov eax, dword [esi + 0x8b8]
mov dword [esi + 0x120], eax
mov dword [esi + 0x11c], 0
je 0x51fc6f
jmp 0x51fc5f
test byte [esi + 0xe4], 0x20
jne 0x51fc6f
and dword [esi + 0xe4], 0xfffffffd
push esi
call fcn.005116f0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret