Function at 0x402300
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c4
mov dword [ebp - 4], 0
mov dword [ebp - 8], 1
mov eax, 1
test eax, eax
je 0x402e34
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0xffffffff
jne 0x40234a
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x4c], eax
mov eax, 2
mov word [ebp - 0x50], ax
push 0x170c
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x4e], ax
push 0x10
lea ecx, [ebp - 0x50]
push ecx
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x402399
mov eax, dword [ebp - 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
push 0xc
lea ecx, [ebp - 0x34]
push ecx
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00401c60
add esp, 0xc
test eax, eax
jne 0x4023c0
mov eax, dword [ebp - 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
mov byte [ebp - 0x28], 0
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x14]
push edx
push 0x4046dc
lea eax, [ebp - 0x34]
push eax
call sub.MSVCR90.dll_sscanf
add esp, 0x10
cmp eax, 2
je 0x4023f3
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
cmp dword [ebp - 0x14], 3
jne 0x402410
cmp dword [ebp - 0x10], 3
jge 0x402410
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
cmp dword [ebp - 0x14], 3
jne 0x402439
cmp dword [ebp - 0x10], 8
jne 0x402439
cmp dword [ebp - 8], 0
je 0x402439
push 8
push 3
push 0x4046ec
lea eax, [ebp - 0x34]
push eax
call sub.MSVCR90.dll_sprintf
add esp, 0x10
jmp 0x402455
push 5
push 3
push str.RFB__03d._03d_n
lea ecx, [ebp - 0x34]
push ecx
call sub.MSVCR90.dll_sprintf
add esp, 0x10
mov dword [ebp - 8], 0
push 0xc
lea edx, [ebp - 0x34]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00401cc0
add esp, 0xc
test eax, eax
jne 0x40247c
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
cmp dword [ebp - 8], 0
je 0x402739
mov dword [ebp - 8], 0
mov dx, word [0x40470c]
mov word [ebp - 0x54], dx
push 2
lea eax, [ebp - 0x40]
push eax
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00401c60
add esp, 0xc
test eax, eax
jne 0x4024bf
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
push 1
lea eax, [ebp - 0x54]
push eax
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00401cc0
add esp, 0xc
test eax, eax
jne 0x4024e6
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
push 4
lea eax, [ebp - 0x38]
push eax
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00401c60
add esp, 0xc
test eax, eax
je 0x40271f
mov edx, dword [ebp - 0x38]
and edx, 0xff000000
shr edx, 0x18
mov eax, dword [ebp - 0x38]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov ecx, dword [ebp - 0x38]
and ecx, 0xff00
shl ecx, 8
or edx, ecx
mov eax, dword [ebp - 0x38]
and eax, 0xff
shl eax, 0x18
or edx, eax
mov dword [ebp - 0x38], edx
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x2bc], ecx
cmp dword [ebp - 0x2bc], 0
je 0x40254e
jmp 0x402713
push 1
push 0x404710
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00401cc0
add esp, 0xc
test eax, eax
je 0x4026ff
push 0x18
lea eax, [ebp - 0x6c]
push eax
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00401c60
add esp, 0xc
test eax, eax
je 0x4026ff
movzx edx, word [ebp - 0x6c]
and edx, 0xff
shl edx, 8
movzx eax, word [ebp - 0x6c]
sar eax, 8
and eax, 0xff
or edx, eax
mov word [ebp - 0x6c], dx
movzx ecx, word [ebp - 0x6a]
and ecx, 0xff
shl ecx, 8
movzx edx, word [ebp - 0x6a]
sar edx, 8
and edx, 0xff
or ecx, edx
mov word [ebp - 0x6a], cx
movzx eax, word [ebp - 0x64]
and eax, 0xff
shl eax, 8
movzx ecx, word [ebp - 0x64]
sar ecx, 8
and ecx, 0xff
or eax, ecx
mov word [ebp - 0x64], ax
movzx edx, word [ebp - 0x62]
and edx, 0xff
shl edx, 8
movzx eax, word [ebp - 0x62]
sar eax, 8
and eax, 0xff
or edx, eax
mov word [ebp - 0x62], dx
movzx ecx, word [ebp - 0x60]
and ecx, 0xff
shl ecx, 8
movzx edx, word [ebp - 0x60]
sar edx, 8
and edx, 0xff
or ecx, edx
mov word [ebp - 0x60], cx
mov eax, dword [ebp - 0x58]
and eax, 0xff000000
shr eax, 0x18
mov ecx, dword [ebp - 0x58]
and ecx, 0xff0000
shr ecx, 8
or eax, ecx
mov edx, dword [ebp - 0x58]
and edx, 0xff00
shl edx, 8
or eax, edx
mov ecx, dword [ebp - 0x58]
and ecx, 0xff
shl ecx, 0x18
or eax, ecx
mov dword [ebp - 0x58], eax
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
push 1
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00402140
add esp, 0x10
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 1
push 0
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00402140
add esp, 0x10
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 1
push 0
push 0
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00402140
add esp, 0x10
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, 1
jmp 0x402e34
mov eax, dword [ebp - 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x402729
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x402e04
push 4
lea edx, [ebp - 0x40]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00401c60
add esp, 0xc
test eax, eax
jne 0x402760
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
mov edx, dword [ebp - 0x40]
and edx, 0xff000000
shr edx, 0x18
mov eax, dword [ebp - 0x40]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov ecx, dword [ebp - 0x40]
and ecx, 0xff00
shl ecx, 8
or edx, ecx
mov eax, dword [ebp - 0x40]
and eax, 0xff
shl eax, 0x18
or edx, eax
mov dword [ebp - 0x40], edx
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x2c0], ecx
cmp dword [ebp - 0x2c0], 0
je 0x4027c4
cmp dword [ebp - 0x2c0], 1
je 0x4027f4
cmp dword [ebp - 0x2c0], 2
je 0x4029cd
jmp 0x402df6
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 4]
add eax, 1
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 2
jne 0x4027e4
xor eax, eax
jmp 0x402e34
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x402e04
push 1
push 0x404714
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00401cc0
add esp, 0xc
test eax, eax
je 0x4029b9
push 0x18
lea edx, [ebp - 0x84]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00401c60
add esp, 0xc
test eax, eax
je 0x4029b9
movzx ecx, word [ebp - 0x84]
and ecx, 0xff
shl ecx, 8
movzx edx, word [ebp - 0x84]
sar edx, 8
and edx, 0xff
or ecx, edx
mov word [ebp - 0x84], cx
movzx eax, word [ebp - 0x82]
and eax, 0xff
shl eax, 8
movzx ecx, word [ebp - 0x82]
sar ecx, 8
and ecx, 0xff
or eax, ecx
mov word [ebp - 0x82], ax
movzx edx, word [ebp - 0x7c]
and edx, 0xff
shl edx, 8
movzx eax, word [ebp - 0x7c]
sar eax, 8
and eax, 0xff
or edx, eax
mov word [ebp - 0x7c], dx
movzx ecx, word [ebp - 0x7a]
and ecx, 0xff
shl ecx, 8
movzx edx, word [ebp - 0x7a]
sar edx, 8
and edx, 0xff
or ecx, edx
mov word [ebp - 0x7a], cx
movzx eax, word [ebp - 0x78]
and eax, 0xff
shl eax, 8
movzx ecx, word [ebp - 0x78]
sar ecx, 8
and ecx, 0xff
or eax, ecx
mov word [ebp - 0x78], ax
mov edx, dword [ebp - 0x70]
and edx, 0xff000000
shr edx, 0x18
mov eax, dword [ebp - 0x70]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov ecx, dword [ebp - 0x70]
and ecx, 0xff00
shl ecx, 8
or edx, ecx
mov eax, dword [ebp - 0x70]
and eax, 0xff
shl eax, 0x18
or edx, eax
mov dword [ebp - 0x70], edx
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
push 1
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00402140
add esp, 0x10
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 1
push 0
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00402140
add esp, 0x10
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 1
push 0
push 0
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00402140
add esp, 0x10
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, 1
jmp 0x402e34
push 0x10
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00401c60
add esp, 0xc
test eax, eax
jne 0x4029f4
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
push 0x100
push 0
lea edx, [ebp - 0x188]
push edx
call sub.MSVCR90.dll_memset
add esp, 0xc
push 8
push 0
lea eax, [ebp - 0x190]
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
push 0xff
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x188]
push edx
call sub.MSVCR90.dll_strncpy
add esp, 0xc
lea eax, [ebp - 0x188]
push eax
call sub.MSVCR90.dll_strlen
add esp, 4
mov byte [ebp + eax - 0x188], 0
lea ecx, [ebp - 0x188]
push ecx
lea edx, [ebp - 0x190]
push edx
call fcn.00401bf0
add esp, 8
lea eax, [ebp - 0x188]
push eax
lea ecx, [ebp - 0x24]
push ecx
call fcn.00401b60
add esp, 8
push 0x10
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00401cc0
add esp, 0xc
test eax, eax
jne 0x402a9c
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
push 4
lea edx, [ebp - 0x38]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00401c60
add esp, 0xc
test eax, eax
jne 0x402ac3
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
mov edx, dword [ebp - 0x38]
and edx, 0xff000000
shr edx, 0x18
mov eax, dword [ebp - 0x38]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov ecx, dword [ebp - 0x38]
and ecx, 0xff00
shl ecx, 8
or edx, ecx
mov eax, dword [ebp - 0x38]
and eax, 0xff
shl eax, 0x18
or edx, eax
mov dword [ebp - 0x38], edx
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x2c4], ecx
cmp dword [ebp - 0x2c4], 0
je 0x402b1e
cmp dword [ebp - 0x2c4], 1
je 0x402dc8
jmp 0x402de6
push 1
push 0x404718
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00401cc0
add esp, 0xc
test eax, eax
je 0x402db7
push 0x18
lea eax, [ebp - 0x1a8]
push eax
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00401c60
add esp, 0xc
test eax, eax
je 0x402db7
movzx edx, word [ebp - 0x1a8]
and edx, 0xff
shl edx, 8
movzx eax, word [ebp - 0x1a8]
sar eax, 8
and eax, 0xff
or edx, eax
mov word [ebp - 0x1a8], dx
movzx ecx, word [ebp - 0x1a6]
and ecx, 0xff
shl ecx, 8
movzx edx, word [ebp - 0x1a6]
sar edx, 8
and edx, 0xff
or ecx, edx
mov word [ebp - 0x1a6], cx
movzx eax, word [ebp - 0x1a0]
and eax, 0xff
shl eax, 8
movzx ecx, word [ebp - 0x1a0]
sar ecx, 8
and ecx, 0xff
or eax, ecx
mov word [ebp - 0x1a0], ax
movzx edx, word [ebp - 0x19e]
and edx, 0xff
shl edx, 8
movzx eax, word [ebp - 0x19e]
sar eax, 8
and eax, 0xff
or edx, eax
mov word [ebp - 0x19e], dx
movzx ecx, word [ebp - 0x19c]
and ecx, 0xff
shl ecx, 8
movzx edx, word [ebp - 0x19c]
sar edx, 8
and edx, 0xff
or ecx, edx
mov word [ebp - 0x19c], cx
mov eax, dword [ebp - 0x194]
and eax, 0xff000000
shr eax, 0x18
mov ecx, dword [ebp - 0x194]
and ecx, 0xff0000
shr ecx, 8
or eax, ecx
mov edx, dword [ebp - 0x194]
and edx, 0xff00
shl edx, 8
or eax, edx
mov ecx, dword [ebp - 0x194]
and ecx, 0xff
shl ecx, 0x18
or eax, ecx
mov dword [ebp - 0x194], eax
mov edx, dword [ebp - 0x194]
add edx, 2
push edx
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [ebp - 0x2b8], eax
mov eax, dword [ebp - 0x2b8]
mov dword [ebp - 0x2b4], eax
mov ecx, dword [ebp - 0x194]
push ecx
mov edx, dword [ebp - 0x2b4]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00402e60
add esp, 0xc
mov ecx, dword [ebp - 0x2b4]
push ecx
push 0x40471c
lea edx, [ebp - 0x2b0]
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push str.HMI_Web
lea eax, [ebp - 0x2b0]
push eax
call fcn.00402e40
add esp, 8
test eax, eax
jne 0x402db7
push str.NSFOCUS_S
lea ecx, [ebp - 0x2b0]
push ecx
call fcn.00402e40
add esp, 8
test eax, eax
jne 0x402db7
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x2b4]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00401a50
add esp, 0xc
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
push 1
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00402140
add esp, 0x10
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 1
push 0
mov edx, dword [ebp - 0x3c]
push edx
call fcn.00402140
add esp, 0x10
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x3c]
push eax
call fcn.00402070
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 1
push 0
push 0
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.00402140
add esp, 0x10
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, 1
jmp 0x402e34
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x402df4
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
jmp 0x402e04
mov edx, dword [ebp - 0x3c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x402e34
cmp dword [ebp - 0x3c], 0xffffffff
je 0x402e27
push 2
mov eax, dword [ebp - 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebp - 0x3c], 0xffffffff
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x402317
mov esp, ebp
pop ebp
ret