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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x596dbd
mov eax, dword fs:[0]
push eax
sub esp, 0x180
mov eax, dword [0x610490]
xor eax, esp
mov dword [esp + 0x178], eax
push ebx
push esi
push edi
mov eax, dword [0x610490]
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.00407888
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 0x40ca71
mov edx, dword [ebp + 0xc]
lea eax, [esp + 0xa4]
push eax
mov ecx, edi
call fcn.0042bd5d
pop ecx
jmp 0x40cac0
mov dword [esp + 0x98], edx
mov dword [esp + 0x9c], edx
mov dword [esp + 0xa0], edx
test edi, edi
jle 0x40cacb
mov esi, edi
mov ebx, ecx
mov edx, dword [ebp + 0xc]
lea eax, [esp + 0x98]
push eax
mov ecx, ebx
call fcn.0042bbf4
pop ecx
test al, al
je 0x40cab9
lea eax, [esp + 0x98]
push eax
lea ecx, [esp + 0xa8]
call fcn.0042ca44
dec esi
jne 0x40ca8e
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 0x40cb4b
mov edx, 0x7df098
mov dword [esp + 0x104], 1
lea ecx, [esp + 0x3c]
mov byte [esp + 0xcc], al
call fcn.00429ee5
add eax, 8
lea ecx, [esp + 0xd0]
push eax
call fcn.00407163
lea ecx, [esp + 0x3c]
call fcn.0040bbff
lea eax, [esp + 0xcc]
mov ecx, ebx
push eax
call fcn.0040d019
test esi, esi
je 0x40cb38
push esi
call fcn.00431ca0
pop ecx
lea ecx, [esp + 0xcc]
call fcn.00405438
mov eax, ebx
jmp 0x40cf63
cmp ecx, 0xffffffff
je 0x40cc50
cmp edi, 1
jne 0x40cc50
mov edx, dword [esi + 4]
lea ecx, [esp + 0xb4]
call fcn.00421f69
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.00403e6e
mov ecx, edi
call fcn.0040fc0d
mov eax, dword [esp + 0xb4]
add esp, 0x18
sub eax, dword [esp + 0x98]
sar eax, 2
test eax, eax
je 0x40cc2c
mov edi, 0x5e268d
mov dword [esp + 0x104], 1
push edi
mov byte [esp + 0xd0], 0
call fcn.004035ea
pop ecx
push eax
push edi
lea ecx, [esp + 0xd8]
call fcn.004042b9
lea eax, [esp + 0xcc]
mov ecx, ebx
push eax
call fcn.0040d019
lea ecx, [esp + 0x98]
call fcn.00405fa3
push 0
push 1
lea ecx, [esp + 0xbc]
call fcn.0040412f
jmp 0x40cb31
lea ecx, [esp + 0x98]
call fcn.00405fa3
push 0
push 1
lea ecx, [esp + 0xbc]
mov byte [esp + 0x1a0], 1
call fcn.0040412f
mov ebx, esi
cmp esi, dword [esp + 0xa8]
je 0x40cf37
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 0x40cf8c
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.00421f69
push 0x1c8
mov byte [esp + 0x19c], 5
call fcn.00431c6a
mov esi, eax
pop ecx
mov dword [esp + 0x1c], esi
mov byte [esp + 0x198], 6
test esi, esi
je 0x40cd13
push 0x1c8
push 0
push esi
call fcn.0055dec0
pop ecx
pop ecx
mov ecx, esi
call fcn.0040efd5
mov esi, eax
jmp 0x40cd15
xor esi, esi
mov byte [esp + 0x198], 5
xor ecx, ecx
mov eax, dword [0x611718]
mov dword [esi + 4], 0x40d8ad
mov dword [esi + 8], 0x40d94a
mov dword [esi + 0xc], fcn.00404abb
mov dword [esi + 0x10], fcn.0040d961
mov dword [esi + 0x14], 0x40db18
mov dword [esi + 0x30], edi
mov byte [esi + 0x4e], 1
mov dword [esi + 0x58], eax
mov eax, dword [0x611714]
mov dword [esi + 0x5c], eax
mov eax, dword [0x62033c]
cmp eax, 0x64
mov dword [esp + 0x1c], esi
cmovge eax, ecx
lea ecx, [esp + 0x24]
inc eax
mov dword [0x62033c], eax
mov dword [esi + 0x11c], eax
call fcn.0041764b
push eax
lea ecx, [esi + 0x18]
call fcn.00407163
push 0
push 1
lea ecx, [esp + 0x2c]
call fcn.0040412f
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 0x40cdc2
push 0xffffffffffffffff
push 0
push eax
call fcn.0040409b
mov eax, dword [esp + 0xbc]
mov dword [esi + 0x144], eax
call fcn.004174d7
mov dword [esi + 0x148], eax
mov byte [esi + 0x150], 1
call fcn.0042f6b2
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 0x40ce18
cmp ecx, 0x257
mov edx, 0x1b58
cmovle eax, edx
mov edx, 0x604282
mov word [esi + 0x13c], ax
lea ecx, [esp + 0x12c]
call fcn.00429ee5
mov byte [esp + 0x198], 7
lea ecx, [esp + 0x24]
mov edx, dword [esi + 0x11c]
call fcn.00404abc
mov esi, eax
mov edi, 0x5e5460
mov byte [esp + 0x198], 8
push edi
call fcn.004035ea
pop ecx
push eax
push 0
push edi
lea ecx, [esp + 0x140]
call fcn.0040e39b
push 0xffffffffffffffff
push 0
push esi
push 3
push eax
lea ecx, [esp + 0x148]
call fcn.00407395
lea ecx, [esp + 0x134]
cmp ecx, eax
je 0x40ce96
push 0xffffffffffffffff
push 0
push eax
call fcn.0040409b
push 0
push 1
lea ecx, [esp + 0x2c]
mov byte [esp + 0x1a0], 7
call fcn.0040412f
lea ecx, [esp + 0x12c]
call fcn.00429ffe
lea eax, [esp + 0x1c]
push eax
push ecx
lea ecx, [esp + 0xa0]
call fcn.0040ebc6
lea ecx, [esp + 0x98]
mov byte [esp + 0x198], 9
call fcn.00405042
mov byte [esp + 0x198], 7
cmp dword [esp + 0x9c], 0
mov byte [esp + 0xcc], 1
jne 0x40cf87
lea ecx, [esp + 0x12c]
call fcn.0040bbff
push 0
push 1
lea ecx, [esp + 0x11c]
mov byte [esp + 0x1a0], 1
call fcn.0040412f
add ebx, dword [esp + 0x14]
cmp ebx, dword [esp + 0xa8]
jne 0x40cc5f
mov esi, dword [esp + 0xa4]
mov edi, dword [esp + 0x18]
lea eax, [esp + 0xcc]
push eax
mov ecx, edi
call fcn.0040d019
test esi, esi
je 0x40cf55
push esi
call fcn.00431ca0
pop ecx
lea ecx, [esp + 0xcc]
call fcn.00405438
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.00559b09
mov esp, ebp
pop ebp
ret
call fcn.0055a610
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.00404abc
push eax
mov edx, str.create_socket_error:
mov byte [esp + 0x19c], 4
lea ecx, [esp + 0x28]
call fcn.00404c2b
pop ecx
push eax
lea ecx, [esp + 0xd4]
call fcn.00407163
push ebx
push 1
lea ecx, [esp + 0x2c]
call fcn.0040412f
push ebx
push 1
lea ecx, [esp + 0xbc]
mov byte [esp + 0x1a0], 1
call fcn.0040412f
mov edi, dword [esp + 0x18]
lea eax, [esp + 0xcc]
push eax
mov ecx, edi
call fcn.0040d019
mov eax, dword [esp + 0xa4]
test eax, eax
je 0x40cf55
push eax
jmp 0x40cf4f