Function at 0x666e40
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
mov esi, dword [esp + 0x28]
push edi
mov byte [esp + 0x13], 0
mov eax, dword [esi + 0x90]
or eax, dword [esi + 0x94]
jne 0x666e7c
mov eax, dword [esi + 0x98]
or eax, dword [esi + 0x9c]
jne 0x666e7c
push 7
lea eax, [esp + 0x1c]
push esi
push eax
call fcn.0066e250
add esp, 0xc
mov ebp, dword [esp + 0x34]
xor edi, edi
mov dword [esp + 0x14], edi
or dword [ebp], 2
mov ebx, dword [esi + 0x12c]
test ebx, ebx
je 0x666ef8
mov eax, dword [esi + 0x4c0]
shr eax, 5
cmp ebx, eax
jge 0x666eec
cmp byte [esi + 0x144], 0
jne 0x666eec
cmp byte [esi + 0x13f], 0
jne 0x666eec
mov ecx, dword [esi + 0x98]
mov eax, ebx
sub ecx, dword [esi + 0xb0]
mov ebp, dword [esi + 0x9c]
sbb ebp, dword [esi + 0xb4]
cdq
add ecx, eax
adc ebp, edx
cmp ecx, dword [esi + 0xc50]
jne 0x666ee2
cmp ebp, dword [esi + 0xc54]
je 0x666ee8
mov edi, ebx
mov dword [esp + 0x14], ebx
mov ebp, dword [esp + 0x34]
test ebx, ebx
je 0x666ef8
test edi, edi
je 0x667147
cmp dword [esi + 0x8d0], 0
jne 0x666f1e
push dword [esi + 0x4c0]
call dword [0x75ae1c]
add esp, 4
mov dword [esi + 0x8d0], eax
test eax, eax
je 0x66706a
test edi, edi
je 0x666f3d
mov eax, dword [esi + 0x130]
mov ecx, dword [esi + 0x8d0]
cmp eax, ecx
je 0x666f3d
push edi
push eax
push ecx
call fcn.00622580
add esp, 0xc
cmp byte [esi + 0x13f], 0
mov edx, dword [esi + 0x8d0]
mov dword [esi + 0x130], edx
jne 0x66733d
cmp dword [esi + 0x108], 2
mov ecx, dword [esi + 0x134]
jne 0x666fb7
cmp dword [ecx + 0x1a0], 2
jne 0x666fb7
and dword [esi + 0xf4], 0xfffffffd
lea eax, [esp + 0x18]
push eax
mov dword [esi + 0x108], 1
call fcn.006673d0
push 0
movdqu xmm0, xmmword [eax]
movdqu xmmword [esi + 0xf8], xmm0
and dword [ebp], 0xfffffffd
mov eax, dword [esi + 0x69c]
cdq
push edx
push eax
push esi
call fcn.00650540
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov ebp, dword [esp + 0x30]
mov eax, dword [ebp + 0x288]
test dword [eax + 0x44], 0x40003
je 0x666fd6
cmp dword [ecx + 0x1a0], 1
sete byte [esp + 0x13]
lea eax, [edx + edi]
mov dword [esi + 0x130], eax
lea eax, [esp + 0x34]
push eax
mov eax, dword [esi + 0x4c0]
sub eax, edi
push eax
push esi
call fcn.006652e0
sub dword [esi + 0x130], edi
add esp, 0xc
test eax, eax
jne 0x667368
mov ebx, dword [esp + 0x34]
add ebx, edi
mov dword [esp + 0x34], ebx
je 0x66733d
test ebx, ebx
jle 0x667346
mov dword [esi + 0x12c], ebx
cmp byte [esp + 0x13], al
jne 0x667121
cmp byte [esi + 0x6cd], al
je 0x667121
cmp dword [esi + 0x93c], eax
jne 0x667077
mov eax, dword [esi + 0x4c0]
add eax, eax
push eax
call dword [0x75ae1c]
add esp, 4
mov dword [esi + 0x93c], eax
test eax, eax
jne 0x667077
push str.Failed_to_alloc_scratch_buffer
push esi
call fcn.0065f880
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0x1b
pop ebx
add esp, 0x18
ret
test edi, edi
je 0x667090
push edi
push dword [esi + 0x130]
push dword [esi + 0x93c]
call fcn.00620420
add esp, 0xc
mov edx, edi
mov ecx, edi
cmp edi, ebx
jge 0x667109
mov edi, dword [esp + 0x34]
lea esp, [esp]
mov eax, dword [esi + 0x130]
mov bl, byte [edx + eax]
mov eax, dword [esi + 0x93c]
cmp bl, 0xa
jne 0x6670f4
mov byte [ecx + eax], 0xd
inc ecx
mov eax, dword [esi + 0x93c]
mov byte [ecx + eax], bl
cmp byte [esi + 0x6cd], 0
jne 0x6670f7
mov ebx, dword [esi + 0xc50]
mov eax, ebx
mov ebp, dword [esi + 0xc54]
and eax, ebp
cmp eax, 0xffffffff
je 0x6670f7
add ebx, 1
mov dword [esi + 0xc50], ebx
adc ebp, 0
mov dword [esi + 0xc54], ebp
jmp 0x6670f7
mov byte [ecx + eax], bl
inc edx
inc ecx
cmp edx, edi
jl 0x6670a0
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x34]
mov ebp, dword [esp + 0x30]
cmp ecx, ebx
je 0x667121
mov eax, dword [esi + 0x93c]
mov ebx, ecx
mov dword [esi + 0x130], eax
mov dword [esi + 0x12c], ecx
mov eax, dword [ebp + 0x288]
test dword [eax + 0x44], 0x30000
je 0x66714b
push edi
push ebx
push esi
call fcn.0067bb50
add esp, 0xc
test eax, eax
je 0x66714b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov ebp, dword [esp + 0x30]
lea eax, [esp + 0x2c]
push eax
push dword [esi + 0x12c]
push dword [esi + 0x130]
push dword [ebp + 0x2a4]
push esi
call fcn.0065fcb0
add esp, 0x14
test eax, eax
jne 0x667368
mov edi, dword [ebp + 0x2a4]
push eax
push eax
lea eax, [esp + 0x1c]
push eax
push 4
lea eax, [esp + 0x44]
push eax
push 0
push 0
push 0x4004747b
push edi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x6671b3
push 4
lea eax, [esp + 0x38]
push eax
push 0x1001
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
mov ebp, dword [esi + 0xb0]
mov eax, ebp
mov ebx, dword [esi + 0xb4]
or eax, ebx
mov dword [esp + 0x34], ebx
je 0x667215
mov eax, dword [esp + 0x2c]
cdq
cmp ebx, edx
jg 0x6671d8
jl 0x6671e0
cmp ebp, eax
jb 0x6671e0
mov ebp, eax
mov dword [esp + 0x34], edx
mov ebx, edx
push ebp
push dword [esi + 0x130]
push 2
push esi
call fcn.0065f7f0
mov edi, dword [esp + 0x3c]
add esp, 0x10
sub dword [esi + 0xb0], ebp
mov eax, edi
cdq
sbb dword [esi + 0xb4], ebx
mov ebx, eax
sub ebx, ebp
mov eax, edx
sbb eax, dword [esp + 0x34]
mov dword [esp + 0x34], eax
jmp 0x667224
mov edi, dword [esp + 0x2c]
mov eax, edi
cdq
mov ebx, eax
mov dword [esp + 0x34], edx
mov eax, edx
mov ecx, ebx
or ecx, eax
je 0x667267
mov eax, dword [esi + 0x130]
sub eax, ebx
push ebx
add eax, edi
push eax
push 4
push esi
call fcn.0065f7f0
add dword [esi + 0x98], ebx
mov eax, dword [esp + 0x44]
adc dword [esi + 0x9c], eax
push dword [esi + 0x9c]
push dword [esi + 0x98]
push esi
call fcn.0066e110
mov edi, dword [esp + 0x48]
add esp, 0x1c
cmp byte [esi + 0x144], 0
je 0x667279
cmp byte [esi + 0x146], 0
je 0x6672ae
mov eax, dword [esi + 0x98]
cmp eax, dword [esi + 0xc50]
jne 0x6672ae
mov eax, dword [esi + 0x9c]
cmp eax, dword [esi + 0xc54]
jne 0x6672ae
push str.We_are_completely_uploaded_and_fine
push esi
mov byte [esi + 0x13f], 1
call fcn.0065f950
mov edi, dword [esp + 0x34]
add esp, 8
mov eax, dword [esi + 0x12c]
cmp eax, edi
je 0x6672d0
add dword [esi + 0x130], edi
sub eax, edi
pop edi
mov dword [esi + 0x12c], eax
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
cmp dword [esi + 0x8d0], 0
jne 0x6672f6
push dword [esi + 0x4c0]
call dword [0x75ae1c]
add esp, 4
mov dword [esi + 0x8d0], eax
test eax, eax
je 0x66706a
cmp byte [esi + 0x13f], 0
mov eax, dword [esi + 0x8d0]
mov dword [esi + 0x130], eax
mov dword [esi + 0x12c], 0
je 0x667366
mov eax, dword [esi + 0xc]
and dword [esi + 0xf4], 0xfffffffd
cmp byte [eax + 0x251], 0
je 0x667366
push esi
call fcn.00665f90
add esp, 4
test eax, eax
je 0x667366
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
test byte [esi + 0xf4], 0x20
jne 0x667366
mov eax, dword [esi + 0xc]
and dword [esi + 0xf4], 0xfffffffd
cmp byte [eax + 0x251], 0
je 0x667366
push esi
call fcn.00665f90
add esp, 4
test eax, eax
jne 0x667368
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret