Function at 0x51c270
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 0x51c2ab
mov eax, dword [esi + 0x98]
or eax, dword [esi + 0x9c]
jne 0x51c2ab
push 7
lea eax, [ebp - 0x1c]
push esi
push eax
call fcn.0051cb20
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 0x51c323
mov eax, dword [esi + 0x4b4]
shr eax, 5
cmp edi, eax
jge 0x51c317
cmp byte [esi + 0x149], bl
jne 0x51c317
cmp byte [esi + 0x144], bl
jne 0x51c317
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 0x51c312
cmp eax, dword [esi + 0xc7c]
je 0x51c317
mov ebx, edi
mov dword [ebp - 8], edi
test edi, edi
je 0x51c323
test ebx, ebx
je 0x51c564
cmp dword [esi + 0x8b8], 0
jne 0x51c349
push dword [esi + 0x4b4]
call dword [0x63b144]
add esp, 4
mov dword [esi + 0x8b8], eax
test eax, eax
je 0x51c490
test ebx, ebx
je 0x51c36b
mov eax, dword [esi + 0x8b8]
cmp dword [esi + 0x120], eax
je 0x51c36b
push ebx
push dword [esi + 0x120]
push eax
call fcn.005752c0
add esp, 0xc
cmp byte [esi + 0x144], 0
mov edx, dword [esi + 0x8b8]
mov dword [esi + 0x120], edx
jne 0x51c776
cmp dword [esi + 0xf8], 2
mov ecx, dword [esi + 0x124]
jne 0x51c3e3
cmp dword [ecx + 0x1a8], 2
jne 0x51c3e3
and dword [esi + 0xe4], 0xfffffffd
lea eax, [ebp - 0x1c]
push eax
mov dword [esi + 0xf8], 1
call fcn.00502e60
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.004fd100
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 0x51c400
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.0051a790
sub dword [esi + 0x120], ebx
add esp, 0xc
test eax, eax
jne 0x51c791
mov edx, dword [ebp + 0x10]
add edx, ebx
mov dword [ebp + 0x10], edx
je 0x51c776
test edx, edx
jle 0x51c77f
mov dword [esi + 0x11c], edx
cmp byte [ebp - 1], al
jne 0x51c53f
cmp byte [esi + 0x6b7], al
je 0x51c53f
cmp dword [esi + 0x924], eax
jne 0x51c49c
mov eax, dword [esi + 0x4b4]
add eax, eax
push eax
call dword [0x63b144]
add esp, 4
mov dword [esi + 0x924], eax
test eax, eax
jne 0x51c49c
push str.Failed_to_alloc_scratch_buffer
push esi
call fcn.0050e830
add esp, 8
mov eax, 0x1b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test ebx, ebx
je 0x51c4b5
push ebx
push dword [esi + 0x120]
push dword [esi + 0x924]
call fcn.00576de0
add esp, 0xc
mov edx, ebx
mov ecx, ebx
cmp ebx, dword [ebp + 0x10]
jge 0x51c524
nop
mov eax, dword [esi + 0x120]
mov bl, byte [edx + eax]
mov eax, dword [esi + 0x924]
cmp bl, 0xa
jne 0x51c514
mov byte [ecx + eax], 0xd
inc ecx
mov eax, dword [esi + 0x924]
mov byte [ecx + eax], bl
cmp byte [esi + 0x6b7], 0
jne 0x51c517
mov edi, dword [esi + 0xc78]
mov eax, edi
mov ebx, dword [esi + 0xc7c]
and eax, ebx
cmp eax, 0xffffffff
je 0x51c517
add edi, 1
mov dword [esi + 0xc78], edi
adc ebx, 0
mov dword [esi + 0xc7c], ebx
jmp 0x51c517
mov byte [ecx + eax], bl
inc edx
inc ecx
cmp edx, dword [ebp + 0x10]
jl 0x51c4c0
mov ebx, dword [ebp - 8]
mov edi, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
cmp ecx, edx
je 0x51c53f
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 0x51c567
push ebx
push edx
push esi
call fcn.00530c90
add esp, 0xc
test eax, eax
je 0x51c567
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.0050e9f0
add esp, 0x14
test eax, eax
jne 0x51c791
lea eax, [ebp - 0x2c]
push eax
call fcn.00502e60
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.00502f00
add esp, 0x20
test edx, edx
jl 0x51c617
jg 0x51c5cd
cmp eax, 0x3e8
jbe 0x51c617
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 0x51c60c
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 0x51c67a
mov eax, dword [ebp + 8]
cdq
cmp edi, edx
jg 0x51c63d
jl 0x51c647
cmp ebx, eax
jb 0x51c647
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.0050e7a0
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 0x51c687
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 0x51c6c8
mov eax, dword [esi + 0x120]
sub eax, ebx
push ebx
add eax, edi
push eax
push 4
push esi
call fcn.0050e7a0
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.0051c9e0
mov edi, dword [ebp + 8]
add esp, 0x1c
cmp byte [esi + 0x149], 0
je 0x51c6da
cmp byte [esi + 0x14b], 0
je 0x51c70e
mov eax, dword [esi + 0x98]
cmp eax, dword [esi + 0xc78]
jne 0x51c70e
mov eax, dword [esi + 0x9c]
cmp eax, dword [esi + 0xc7c]
jne 0x51c70e
push str.We_are_completely_uploaded_and_fine
push esi
mov byte [esi + 0x144], 1
call fcn.0050e8f0
mov edi, dword [ebp + 8]
add esp, 8
mov eax, dword [esi + 0x11c]
cmp eax, edi
je 0x51c72f
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 0x51c755
push dword [esi + 0x4b4]
call dword [0x63b144]
add esp, 4
mov dword [esi + 0x8b8], eax
test eax, eax
je 0x51c490
cmp byte [esi + 0x144], 0
mov eax, dword [esi + 0x8b8]
mov dword [esi + 0x120], eax
mov dword [esi + 0x11c], 0
je 0x51c78f
jmp 0x51c77f
test byte [esi + 0xe4], 0x20
jne 0x51c78f
and dword [esi + 0xe4], 0xfffffffd
push esi
call fcn.0050e200
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret