Function at 0x40c930
Capabilities:
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x596b09
mov eax, dword fs:[0]
push eax
sub esp, 0x180
mov eax, dword [0x60f490]
xor eax, esp
mov dword [esp + 0x178], eax
push ebx
push esi
push edi
mov eax, dword [0x60f490]
xor eax, esp
push eax
lea eax, [esp + 0x190]
mov dword fs:[0], eax
mov dword [esp + 0x14], edx
mov ebx, ecx
mov dword [esp + 0x18], ebx
and dword [esp + 0x20], 0
lea ecx, [esp + 0xcc]
call fcn.00407826
xor edx, edx
lea edi, [esp + 0xa4]
mov dword [esp + 0x198], edx
xor eax, eax
stosd dword es:[edi], eax
mov esi, edx
mov dword [esp + 0x104], edx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov dword [esp + 0xa4], esi
mov dword [esp + 0xa8], edx
mov dword [esp + 0xac], edx
mov ecx, dword [esp + 0x14]
mov edi, dword [ebp + 8]
mov byte [esp + 0x198], 1
cmp ecx, 0xffffffff
jne 0x40c9e7
mov edx, dword [ebp + 0xc]
lea eax, [esp + 0xa4]
push eax
mov ecx, edi
call fcn.0042ba4c
pop ecx
jmp 0x40ca36
mov dword [esp + 0x98], edx
mov dword [esp + 0x9c], edx
mov dword [esp + 0xa0], edx
test edi, edi
jle 0x40ca41
mov esi, edi
mov ebx, ecx
mov edx, dword [ebp + 0xc]
lea eax, [esp + 0x98]
push eax
mov ecx, ebx
call fcn.0042b8e3
pop ecx
test al, al
je 0x40ca2f
lea eax, [esp + 0x98]
push eax
lea ecx, [esp + 0xa8]
call fcn.0042c733
dec esi
jne 0x40ca04
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0xa4]
mov eax, dword [esp + 0xa8]
sub eax, esi
mov dword [esp + 0x14], 0xc
cdq
idiv dword [esp + 0x14]
test eax, eax
jne 0x40cac1
mov edx, 0x7df098
mov dword [esp + 0x104], 1
lea ecx, [esp + 0x3c]
mov byte [esp + 0xcc], al
call fcn.00429bd5
add eax, 8
lea ecx, [esp + 0xd0]
push eax
call fcn.00407101
lea ecx, [esp + 0x3c]
call fcn.0040bb75
lea eax, [esp + 0xcc]
mov ecx, ebx
push eax
call fcn.0040cf8f
test esi, esi
je 0x40caae
push esi
call fcn.00431987
pop ecx
lea ecx, [esp + 0xcc]
call fcn.004053d8
mov eax, ebx
jmp 0x40ced9
cmp ecx, 0xffffffff
je 0x40cbc6
cmp edi, 1
jne 0x40cbc6
mov edx, dword [esi + 4]
lea ecx, [esp + 0xb4]
call fcn.00421c54
xor eax, eax
lea edi, [esp + 0x98]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
mov dword [esp + 0x98], eax
mov dword [esp + 0x9c], eax
mov dword [esp + 0xa0], eax
sub esp, 0x18
mov byte [esp + 0x1b0], 3
lea eax, [esp + 0xcc]
mov ecx, esp
lea edi, [esp + 0xb0]
push eax
call fcn.00403e0e
mov ecx, edi
call fcn.0040fb82
mov eax, dword [esp + 0xb4]
add esp, 0x18
sub eax, dword [esp + 0x98]
sar eax, 2
test eax, eax
je 0x40cba2
mov edi, 0x5e1685
mov dword [esp + 0x104], 1
push edi
mov byte [esp + 0xd0], 0
call fcn.0040358a
pop ecx
push eax
push edi
lea ecx, [esp + 0xd8]
call fcn.00404259
lea eax, [esp + 0xcc]
mov ecx, ebx
push eax
call fcn.0040cf8f
lea ecx, [esp + 0x98]
call fcn.00405f43
push 0
push 1
lea ecx, [esp + 0xbc]
call fcn.004040cf
jmp 0x40caa7
lea ecx, [esp + 0x98]
call fcn.00405f43
push 0
push 1
lea ecx, [esp + 0xbc]
mov byte [esp + 0x1a0], 1
call fcn.004040cf
mov ebx, esi
cmp esi, dword [esp + 0xa8]
je 0x40cead
mov esi, ebx
lea edi, [esp + 0xb4]
push 0
push 1
push 2
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x40cf02
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [esp + 0xb0]
push 4
push eax
push 0x1002
push 0xffff
push edi
mov dword [esp + 0xc4], 0x40000
call esi
push 4
lea eax, [esp + 0xb4]
push eax
push 0x1001
push 0xffff
push edi
call esi
mov edx, dword [esp + 0xb8]
lea ecx, [esp + 0x114]
call fcn.00421c54
push 0x1c8
mov byte [esp + 0x19c], 5
call fcn.0043195a
mov esi, eax
pop ecx
mov dword [esp + 0x1c], esi
mov byte [esp + 0x198], 6
test esi, esi
je 0x40cc89
push 0x1c8
push 0
push esi
call fcn.0055dbf0
pop ecx
pop ecx
mov ecx, esi
call fcn.0040ef4a
mov esi, eax
jmp 0x40cc8b
xor esi, esi
mov byte [esp + 0x198], 5
xor ecx, ecx
mov eax, dword [0x610718]
mov dword [esi + 4], 0x40d823
mov dword [esi + 8], 0x40d8c0
mov dword [esi + 0xc], fcn.00404a5b
mov dword [esi + 0x10], fcn.0040d8d7
mov dword [esi + 0x14], 0x40da8e
mov dword [esi + 0x30], edi
mov byte [esi + 0x4e], 1
mov dword [esi + 0x58], eax
mov eax, dword [0x610714]
mov dword [esi + 0x5c], eax
mov eax, dword [0x61f278]
cmp eax, 0x64
mov dword [esp + 0x1c], esi
cmovge eax, ecx
lea ecx, [esp + 0x24]
inc eax
mov dword [0x61f278], eax
mov dword [esi + 0x11c], eax
call fcn.00417275
push eax
lea ecx, [esi + 0x18]
call fcn.00407101
push 0
push 1
lea ecx, [esp + 0x2c]
call fcn.004040cf
mov eax, dword [esp + 0xb4]
lea ecx, [esi + 0x124]
mov byte [esi + 0x120], 0
mov dword [esi + 0x140], eax
lea eax, [esp + 0x114]
cmp ecx, eax
je 0x40cd38
push 0xffffffffffffffff
push 0
push eax
call fcn.0040403b
mov eax, dword [esp + 0xbc]
mov dword [esi + 0x144], eax
call fcn.00417101
mov dword [esi + 0x148], eax
mov byte [esi + 0x150], 1
call fcn.0042f3a2
mov dword [esi + 0x64], eax
mov edx, 0xd3d
mov ecx, dword [esi + 0x140]
mov eax, 0x12c
cmp ecx, 0xb4
cmove eax, edx
cmp ecx, 0x1f4
jl 0x40cd8e
cmp ecx, 0x257
mov edx, 0x1b58
cmovle eax, edx
mov edx, 0x604282
mov word [esi + 0x13c], ax
lea ecx, [esp + 0x12c]
call fcn.00429bd5
mov byte [esp + 0x198], 7
lea ecx, [esp + 0x24]
mov edx, dword [esi + 0x11c]
call fcn.00404a5c
mov esi, eax
mov edi, 0x5e4438
mov byte [esp + 0x198], 8
push edi
call fcn.0040358a
pop ecx
push eax
push 0
push edi
lea ecx, [esp + 0x140]
call fcn.0040e311
push 0xffffffffffffffff
push 0
push esi
push 3
push eax
lea ecx, [esp + 0x148]
call fcn.00407333
lea ecx, [esp + 0x134]
cmp ecx, eax
je 0x40ce0c
push 0xffffffffffffffff
push 0
push eax
call fcn.0040403b
push 0
push 1
lea ecx, [esp + 0x2c]
mov byte [esp + 0x1a0], 7
call fcn.004040cf
lea ecx, [esp + 0x12c]
call fcn.00429ced
lea eax, [esp + 0x1c]
push eax
push ecx
lea ecx, [esp + 0xa0]
call fcn.0040eb3c
lea ecx, [esp + 0x98]
mov byte [esp + 0x198], 9
call fcn.00404fe2
mov byte [esp + 0x198], 7
cmp dword [esp + 0x9c], 0
mov byte [esp + 0xcc], 1
jne 0x40cefd
lea ecx, [esp + 0x12c]
call fcn.0040bb75
push 0
push 1
lea ecx, [esp + 0x11c]
mov byte [esp + 0x1a0], 1
call fcn.004040cf
add ebx, dword [esp + 0x14]
cmp ebx, dword [esp + 0xa8]
jne 0x40cbd5
mov esi, dword [esp + 0xa4]
mov edi, dword [esp + 0x18]
lea eax, [esp + 0xcc]
push eax
mov ecx, edi
call fcn.0040cf8f
test esi, esi
je 0x40cecb
push esi
call fcn.00431987
pop ecx
lea ecx, [esp + 0xcc]
call fcn.004053d8
mov eax, edi
mov ecx, dword [esp + 0x190]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x178]
xor ecx, esp
call fcn.005597ea
mov esp, ebp
pop ebp
ret
call fcn.0055a2f0
xor ebx, ebx
mov byte [esp + 0xcc], bl
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
lea ecx, [esp + 0xb4]
call fcn.00404a5c
push eax
mov edx, str.create_socket_error:
mov byte [esp + 0x19c], 4
lea ecx, [esp + 0x28]
call fcn.00404bcb
pop ecx
push eax
lea ecx, [esp + 0xd4]
call fcn.00407101
push ebx
push 1
lea ecx, [esp + 0x2c]
call fcn.004040cf
push ebx
push 1
lea ecx, [esp + 0xbc]
mov byte [esp + 0x1a0], 1
call fcn.004040cf
mov edi, dword [esp + 0x18]
lea eax, [esp + 0xcc]
push eax
mov ecx, edi
call fcn.0040cf8f
mov eax, dword [esp + 0xa4]
test eax, eax
je 0x40cecb
push eax
jmp 0x40cec5