Function at 0x40c520
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov ecx, dword [edi]
mov eax, dword [edi + 0x18]
push ebx
mov ebx, dword [edi + 8]
sub ebx, ecx
cmp eax, ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 4], 0
jl 0x40c550
mov eax, dword [ebp - 4]
or eax, 4
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x18]
lea ecx, [ecx]
mov eax, dword [edi + 0x18]
mov ecx, dword [edi + 0x14]
lea edx, [ecx + eax]
mov eax, dword [edi + 0xc]
cmp edx, eax
jle 0x40c562
sub edx, eax
cmp ecx, edx
jg 0x40c57b
sub eax, edx
test ecx, ecx
je 0x40c575
dec ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], ecx
jmp 0x40c588
dec eax
mov dword [ebp - 8], eax
jmp 0x40c581
sub ecx, edx
dec ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], 0
mov ecx, dword [edi + 0x18]
mov eax, dword [ebp - 8]
sub ebx, ecx
cmp eax, ebx
mov dword [ebp - 0x14], ebx
jle 0x40c59a
mov dword [ebp - 8], ebx
mov eax, dword [edi + 0x1c]
mov ecx, dword [ebp - 8]
add eax, edx
test ecx, ecx
mov dword [ebp - 0x10], eax
je 0x40c654
jmp 0x40c5b2
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 8]
lea ecx, [ebp - 0x1c]
push ecx
push edx
push eax
push esi
call dword [esi + 0x13c]
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x40c7a6
mov eax, dword [ebp - 4]
mov ecx, dword [esi + 0xbc]
mov edx, dword [esi + 0xb8]
or eax, ebx
mov dword [edx + 4], ecx
mov dword [ebp - 4], eax
lea eax, [esi + 0xb8]
mov dword [ecx], edx
mov dword [eax + 4], eax
mov dword [eax], eax
mov ecx, dword [0x420b5c]
mov dword [esi + 0xc8], ecx
mov edx, dword [0x420b58]
add edx, 0x1e
push eax
mov dword [esi + 0xc4], edx
call fcn.00409810
add esp, 4
test bl, 2
jne 0x40c78d
test bl, 0x10
jne 0x40c79f
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [edi + 0x18]
mov edx, dword [ebp - 0x14]
add ecx, eax
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebp - 8]
add ebx, eax
sub edx, eax
sub ecx, eax
mov dword [edi + 0x18], ebx
mov dword [ebp - 0x14], edx
mov dword [ebp - 8], ecx
jne 0x40c5af
mov ebx, edx
cmp dword [ebp - 0xc], ebx
jle 0x40c65c
mov dword [ebp - 0xc], ebx
mov eax, dword [edi + 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x40c715
lea ecx, [ecx]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
lea ecx, [ebp - 0x20]
push ecx
push edx
push eax
push esi
call dword [esi + 0x13c]
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x40c7a6
mov eax, dword [ebp - 4]
mov ecx, dword [esi + 0xbc]
mov edx, dword [esi + 0xb8]
or eax, ebx
mov dword [edx + 4], ecx
mov dword [ebp - 4], eax
lea eax, [esi + 0xb8]
mov dword [ecx], edx
mov dword [eax + 4], eax
mov dword [eax], eax
mov ecx, dword [0x420b5c]
mov dword [esi + 0xc8], ecx
mov edx, dword [0x420b58]
add edx, 0x1e
push eax
mov dword [esi + 0xc4], edx
call fcn.00409810
add esp, 4
test bl, 2
jne 0x40c78d
test bl, 0x10
jne 0x40c79f
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [edi + 0x18]
mov edx, dword [ebp - 0x14]
add ecx, eax
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebp - 0xc]
add ebx, eax
sub edx, eax
sub ecx, eax
mov dword [edi + 0x18], ebx
mov dword [ebp - 0x14], edx
mov dword [ebp - 0xc], ecx
jne 0x40c670
mov ebx, edx
mov eax, dword [ebp + 8]
test eax, eax
je 0x40c73b
mov ecx, dword [esi + 0x20]
lea eax, [ebp - 0x24]
push eax
push 0x4004667f
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
je 0x40c73b
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x40c7ae
test ebx, ebx
je 0x40c53f
mov eax, dword [edi + 0xc]
cmp eax, dword [edi + 0x10]
jge 0x40c53f
test eax, eax
je 0x40c757
add eax, eax
jmp 0x40c75c
mov eax, 0x400
push eax
mov ebx, edi
call fcn.0040c340
add esp, 4
test eax, eax
mov eax, dword [ebp - 4]
jne 0x40c7c7
test al, 2
jne 0x40c545
mov edx, dword [ebp - 0x18]
cmp dword [edi + 0x18], edx
jl 0x40c54a
mov eax, dword [ebp - 4]
or eax, 4
pop ebx
mov esp, ebp
pop ebp
ret
inc dword [edi + 0x18]
mov eax, dword [ebp - 4]
mov dword [edi + 0x24], 1
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x28], 1
mov eax, dword [ebp - 4]
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 0x18]
mov eax, dword [ebp - 4]
inc edx
mov dword [edi + 0x24], 1
mov dword [edi + 0x18], edx
or eax, 2
pop ebx
mov esp, ebp
pop ebp
ret
or eax, 8
pop ebx
mov esp, ebp
pop ebp
ret