Function at 0x40c220
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
jb 0x40c250
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
jbe 0x40c262
sub edx, eax
cmp ecx, edx
ja 0x40c27b
sub eax, edx
test ecx, ecx
je 0x40c275
dec ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], ecx
jmp 0x40c288
dec eax
mov dword [ebp - 8], eax
jmp 0x40c281
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
jbe 0x40c29a
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 0x40c354
jmp 0x40c2b2
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 0x40c4a6
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.004096e0
add esp, 4
test bl, 2
jne 0x40c48d
test bl, 0x10
jne 0x40c49f
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 0x40c2af
mov ebx, edx
cmp dword [ebp - 0xc], ebx
jbe 0x40c35c
mov dword [ebp - 0xc], ebx
mov eax, dword [edi + 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x40c415
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 0x40c4a6
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.004096e0
add esp, 4
test bl, 2
jne 0x40c48d
test bl, 0x10
jne 0x40c49f
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 0x40c370
mov ebx, edx
mov eax, dword [ebp + 8]
test eax, eax
je 0x40c43b
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 0x40c43b
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x40c4ae
test ebx, ebx
je 0x40c23f
mov eax, dword [edi + 0xc]
cmp eax, dword [edi + 0x10]
jae 0x40c23f
test eax, eax
je 0x40c457
add eax, eax
jmp 0x40c45c
mov eax, 0x400
push eax
mov ebx, edi
call fcn.0040c040
add esp, 4
test eax, eax
mov eax, dword [ebp - 4]
jne 0x40c4c7
test al, 2
jne 0x40c245
mov edx, dword [ebp - 0x18]
cmp dword [edi + 0x18], edx
jb 0x40c24a
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