Function at 0x404670
Capabilities:
Connect socket
Initialize winsock library

Disassembly:
sub esp, 0xa04
push ebx
push ebp
push esi
mov esi, dword [esp + 0xa14]
push edi
mov edi, 0x46f304
lea ebp, [esi + 0xf4]
xor ebx, ebx
mov eax, ebp
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [edi]
jne 0x4046b4
test cl, cl
je 0x4046b0
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [edi + 1]
jne 0x4046b4
add eax, 2
add edi, 2
test cl, cl
jne 0x404690
xor eax, eax
jmp 0x4046b9
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x404cb2
mov edi, 0x46f2cc
mov eax, ebp
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [edi]
jne 0x4046ec
test cl, cl
je 0x4046e8
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [edi + 1]
jne 0x4046ec
add eax, 2
add edi, 2
test cl, cl
jne 0x4046c8
xor eax, eax
jmp 0x4046f1
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x40470d
mov eax, dword [esi + 0x114]
cmp eax, 2
je 0x404cb2
cmp eax, 3
je 0x404cb2
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventA]
push ebx
push ebx
push 1
push ebx
mov dword [esi], ebx
mov dword [esi + 0x14], ebx
mov dword [esi + 0x28], ebx
call edi
cmp eax, ebx
mov dword [esi + 0x28], eax
jne 0x40474a
lea edi, [esi + 0x11b38]
mov ecx, 6
mov esi, str.Error:_CreateEvent_failed
xor eax, eax
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret
push ebx
push ebx
push 1
push ebx
call edi
cmp eax, ebx
mov dword [esi + 0x14], eax
jne 0x404783
mov eax, dword [esi + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esi + 0x11b38]
mov ecx, 6
mov esi, str.Error:_CreateEvent_failed
xor eax, eax
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret
push ebx
push 0x40000080
push 3
push ebx
lea edi, [esi + 0xf9]
push ebx
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x4047e3
mov ecx, dword [esi + 0x14]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
mov dword [esi], ebx
call ebp
mov edx, dword [esi + 0x28]
mov dword [esi + 0x14], ebx
push edx
call ebp
mov dword [esi + 0x28], ebx
push edi
add esi, 0x11b38
push str.Porta_seriale__s_non_presente_o_gi
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
mov eax, dword [esi]
push 0x100
push 0x100
push eax
call dword [sym.imp.KERNEL32.dll_SetupComm]
mov edx, dword [esi]
lea ecx, [esp + 0x58]
mov eax, 0x1388
push ecx
push edx
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x70], eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
mov ecx, dword [esi]
lea eax, [esp + 0x18]
push eax
push ecx
mov dword [esp + 0x20], 0x1c
call dword [sym.imp.KERNEL32.dll_GetCommState]
mov al, byte [esi + 0x30]
mov cl, byte [esi + 0x31]
mov byte [esp + 0x2b], al
mov eax, dword [esp + 0x20]
mov edx, dword [esi + 0x2c]
and eax, 0xfffffc93
or eax, 0x3010
mov byte [esp + 0x2a], cl
or al, 3
mov ecx, 0x64
mov dword [esp + 0x20], eax
mov word [esp + 0x26], cx
mov word [esp + 0x28], cx
mov ecx, dword [esi]
lea eax, [esp + 0x18]
mov dword [esp + 0x1c], edx
mov dl, byte [esi + 0x32]
push eax
push ecx
mov byte [esp + 0x34], dl
mov byte [esp + 0x35], 0x11
mov byte [esp + 0x36], 0x13
mov byte [esp + 0x39], 0xd
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
jne 0x4048dc
mov edx, dword [esi]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
mov eax, dword [esi + 0x14]
mov dword [esi], ebx
push eax
call edi
mov ecx, dword [esi + 0x28]
mov dword [esi + 0x14], ebx
push ecx
call edi
mov dword [esi + 0x28], ebx
add esi, 0x11b38
push str.Error:_SetCommState_failed
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret
mov edi, 0x46f2cc
mov eax, ebp
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [edi]
jne 0x404907
test cl, cl
je 0x404903
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [edi + 1]
jne 0x404907
add eax, 2
add edi, 2
test cl, cl
jne 0x4048e3
xor eax, eax
jmp 0x40490c
sbb eax, eax
sbb eax, 0xffffffff
mov ebp, dword [esp + 0xa1c]
cmp eax, ebx
jne 0x404942
push ebp
push esi
call fcn.0043fb90
add esp, 8
cmp eax, ebx
mov dword [esi + 0x134], eax
jne 0x404942
push ebp
push esi
call fcn.00405180
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret
lea edi, [esi + 0x11014]
mov dword [esp + 0x14], ebx
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
mov dword [esp + 0x10], edi
jmp 0x40495f
mov ebp, dword [esp + 0xa1c]
mov eax, dword [edi + 0x80]
test eax, eax
je 0x404c67
mov eax, dword [edi + 0x208a8]
test eax, eax
je 0x404c67
mov eax, dword [edi + 0x20928]
test eax, eax
jne 0x404c67
mov eax, dword [0x46f618]
mov ecx, dword [0x46f61c]
mov edx, dword [0x46f620]
mov dword [0x60b8a00], eax
mov eax, dword [0x46f624]
push 0x60b8a40
push 0x60b8a00
mov dword [0x60b8a04], ecx
mov dword [0x60b8a08], edx
mov dword [0x60b8a0c], eax
call fcn.00407a40
mov dword [esi + 0x318b8], 0
mov ecx, dword [edi]
push 3
push 2
push ecx
push 1
lea edx, [esp + 0x498]
push str._c_02X_cFA_c__r
push edx
call ebx
mov edx, dword [ebp + 8]
push 0x19
push 0xc8
lea eax, [esp + 0xa4]
push 0x80
push eax
lea ecx, [esp + 0x4b0]
push 9
push ecx
push esi
push edx
call fcn.004031c0
add esp, 0x40
test eax, eax
je 0x404c59
xor edi, edi
lea ebp, [esp + 0x82]
push ebp
call fcn.00406090
add esp, 4
mov byte [edi + 0x60b8a20], al
inc edi
add ebp, 2
cmp edi, 8
jl 0x404a22
push 0x10000051
push 0x60b8a40
push 0x60b8a00
push 0x60b8a30
push 0x60b8a20
push 0x60b8a18
call fcn.00407fc0
call fcn.004079e0
mov dword [0x60b8a10], eax
call fcn.004079e0
mov ecx, dword [0x60b8a10]
push 0x10000051
push 0x60b8a40
push 0x60b8a00
push 0x60b8a30
push 0x60b8a20
push 0x60b8a28
mov dword [0x60b8a14], eax
mov dword [0x60b8a20], ecx
mov dword [0x60b8a24], eax
call fcn.00407fc0
add esp, 0x30
xor edi, edi
lea ebp, [esp + 0x34]
xor edx, edx
mov dl, byte [edi + 0x60b8a28]
push edx
push str._02X
push ebp
call ebx
add esp, 0xc
inc edi
add ebp, 2
cmp edi, 8
jl 0x404aae
mov eax, dword [0x60b8a19]
mov cx, word [0x60b8a1d]
mov dl, byte [0x60b8a1f]
push 0x51
push 0x60b8a40
push 0x60b8a00
mov dword [0x60b8a20], eax
mov al, byte [0x60b8a18]
push 0x60b8a30
push 0x60b8a20
push 0x60b8a28
mov word [0x60b8a24], cx
mov byte [0x60b8a26], dl
mov byte [0x60b8a27], al
call fcn.00407fc0
add esp, 0x18
xor edi, edi
lea ebp, [esp + 0x44]
xor ecx, ecx
mov cl, byte [edi + 0x60b8a28]
push ecx
push str._02X
push ebp
call ebx
add esp, 0xc
inc edi
add ebp, 2
cmp edi, 8
jl 0x404b22
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x34]
mov dword [esi + 0x318b8], 0
push 3
mov ecx, dword [eax]
push edx
push 2
push ecx
push 1
lea edx, [esp + 0x494]
push str._c_02X_cFB_s_c__r
push edx
mov byte [esp + 0x70], 0
call ebx
mov edx, dword [esp + 0xa38]
push 0x19
push 0xc8
lea eax, [esp + 0xa0]
push 0x80
push eax
mov eax, dword [edx + 8]
lea ecx, [esp + 0x4ac]
push 0x29
push ecx
push esi
push eax
call fcn.004031c0
add esp, 0x3c
test eax, eax
je 0x404c59
xor edi, edi
lea ebp, [esp + 0x82]
push ebp
call fcn.00406090
add esp, 4
mov byte [edi + 0x60b8a20], al
inc edi
add ebp, 2
cmp edi, 8
jl 0x404bb2
push 0x10000051
push 0x60b8a40
push 0x60b8a00
push 0x60b8a30
lea ecx, [esp + 0x44]
push 0x60b8a20
push ecx
call fcn.00407fc0
lea edx, [esp + 0x4c]
push 7
push edx
push 0x60b8a11
call fcn.0045f690
add esp, 0x24
test eax, eax
jne 0x404c59
mov eax, dword [0x60b8a10]
mov cl, byte [esp + 0x3b]
cmp cl, al
jne 0x404c59
mov ecx, dword [0x60b8a14]
mov edx, dword [0x60b8a1c]
mov dword [0x60b8a00], eax
mov eax, dword [0x60b8a18]
push 0x60b8a40
push 0x60b8a00
mov dword [0x60b8a04], eax
mov dword [0x60b8a08], ecx
mov dword [0x60b8a0c], edx
call fcn.00407a40
mov eax, dword [esp + 0x18]
add esp, 8
mov dword [eax + 0x20928], 1
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 0x20928]
test eax, eax
je 0x404c94
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
inc eax
add edi, 4
cmp eax, 0x20
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edi
jl 0x404958
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xa04
ret
mov edx, dword [esp + 0xa1c]
push edx
push esi
call fcn.00405180
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret
lea eax, [esp + 0x884]
push eax
push 0x101
call sub.WSOCK32.dll_WSAStartup
test eax, eax
je 0x404ced
lea edi, [esi + 0x11b38]
mov ecx, 6
mov esi, str.Error:_WSAStartup_failed
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
call sub.WSOCK32.dll_WSACleanup
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xa04
ret
push ebx
push 1
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi + 0x38], eax
jne 0x404d24
lea edi, [esi + 0x11b38]
mov ecx, 5
mov esi, str.Error:_socket_failed
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
call sub.WSOCK32.dll_WSACleanup
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xa04
ret
lea ecx, [esi + 0xff]
mov word [esp + 0x6c], 2
push ecx
call fcn.004029c0
mov cx, word [esi + 0x110]
add esp, 4
mov dword [esp + 0x70], eax
push ecx
call sub.WSOCK32.dll_htons
mov word [esp + 0x6e], ax
mov eax, dword [esi + 0x38]
lea edx, [esp + 0x6c]
push 0x10
push edx
push eax
call sub.WSOCK32.dll_connect
test eax, eax
jge 0x404d9a
mov ecx, dword [esi + 0x38]
push ecx
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x38], 0xffffffff
lea edi, [esi + 0x11b38]
mov ecx, 5
mov esi, str.Error:_connect_failed
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
call sub.WSOCK32.dll_WSACleanup
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xa04
ret
mov edi, 0x46f2cc
mov eax, ebp
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [edi]
jne 0x404dc5
test cl, cl
je 0x404dc1
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [edi + 1]
jne 0x404dc5
add eax, 2
add edi, 2
test cl, cl
jne 0x404da1
xor eax, eax
jmp 0x404dca
sbb eax, eax
sbb eax, 0xffffffff
mov edi, dword [esp + 0xa1c]
cmp eax, ebx
jne 0x404e00
push edi
push esi
call fcn.0043fb90
add esp, 8
cmp eax, ebx
mov dword [esi + 0x134], eax
jne 0x404e00
push edi
push esi
call fcn.00405180
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret
lea eax, [esi + 0x11014]
mov dword [esp + 0x14], ebx
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
mov dword [esp + 0x10], eax
mov edi, eax
mov eax, dword [edi + 0x80]
test eax, eax
je 0x405129
mov eax, dword [edi + 0x208a8]
test eax, eax
je 0x405129
mov eax, dword [edi + 0x20928]
test eax, eax
jne 0x405129
mov ecx, dword [0x46f618]
mov edx, dword [0x46f61c]
mov eax, dword [0x46f620]
mov dword [0x60b8a00], ecx
mov ecx, dword [0x46f624]
push 0x60b8a40
push 0x60b8a00
mov dword [0x60b8a04], edx
mov dword [0x60b8a08], eax
mov dword [0x60b8a0c], ecx
call fcn.00407a40
mov dword [esi + 0x318b8], 0
mov edx, dword [edi]
push 3
push 2
push edx
push 1
lea eax, [esp + 0x498]
push str._c_02X_cFA_c__r
push eax
call ebx
mov eax, dword [esp + 0xa3c]
push 0x19
push 0xc8
lea ecx, [esp + 0xa4]
push 0x80
push ecx
mov ecx, dword [eax + 8]
lea edx, [esp + 0x4b0]
push 9
push edx
push esi
push ecx
call fcn.004031c0
add esp, 0x40
test eax, eax
je 0x40511b
xor edi, edi
lea ebp, [esp + 0x82]
push ebp
call fcn.00406090
add esp, 4
mov byte [edi + 0x60b8a20], al
inc edi
add ebp, 2
cmp edi, 8
jl 0x404ee2
push 0x10000051
push 0x60b8a40
push 0x60b8a00
push 0x60b8a30
push 0x60b8a20
push 0x60b8a18
call fcn.00407fc0
call fcn.004079e0
mov dword [0x60b8a10], eax
call fcn.004079e0
mov edx, dword [0x60b8a10]
push 0x10000051
push 0x60b8a40
push 0x60b8a00
push 0x60b8a30
push 0x60b8a20
push 0x60b8a28
mov dword [0x60b8a14], eax
mov dword [0x60b8a20], edx
mov dword [0x60b8a24], eax
call fcn.00407fc0
add esp, 0x30
xor edi, edi
lea ebp, [esp + 0x34]
xor eax, eax
mov al, byte [edi + 0x60b8a28]
push eax
push str._02X
push ebp
call ebx
add esp, 0xc
inc edi
add ebp, 2
cmp edi, 8
jl 0x404f6e
mov ecx, dword [0x60b8a19]
mov dx, word [0x60b8a1d]
mov al, byte [0x60b8a1f]
push 0x51
push 0x60b8a40
push 0x60b8a00
mov dword [0x60b8a20], ecx
mov cl, byte [0x60b8a18]
push 0x60b8a30
push 0x60b8a20
push 0x60b8a28
mov word [0x60b8a24], dx
mov byte [0x60b8a26], al
mov byte [0x60b8a27], cl
call fcn.00407fc0
add esp, 0x18
xor edi, edi
lea ebp, [esp + 0x44]
xor edx, edx
mov dl, byte [edi + 0x60b8a28]
push edx
push str._02X
push ebp
call ebx
add esp, 0xc
inc edi
add ebp, 2
cmp edi, 8
jl 0x404fe4
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x34]
mov dword [esi + 0x318b8], 0
push 3
mov edx, dword [ecx]
push eax
push 2
push edx
push 1
lea eax, [esp + 0x494]
push str._c_02X_cFB_s_c__r
push eax
mov byte [esp + 0x70], 0
call ebx
mov eax, dword [esp + 0xa38]
push 0x19
push 0xc8
lea ecx, [esp + 0xa0]
push 0x80
push ecx
mov ecx, dword [eax + 8]
lea edx, [esp + 0x4ac]
push 0x29
push edx
push esi
push ecx
call fcn.004031c0
add esp, 0x3c
test eax, eax
je 0x40511b
xor edi, edi
lea ebp, [esp + 0x82]
push ebp
call fcn.00406090
add esp, 4
mov byte [edi + 0x60b8a20], al
inc edi
add ebp, 2
cmp edi, 8
jl 0x405074
push 0x10000051
push 0x60b8a40
push 0x60b8a00
push 0x60b8a30
lea edx, [esp + 0x44]
push 0x60b8a20
push edx
call fcn.00407fc0
lea eax, [esp + 0x4c]
push 7
push eax
push 0x60b8a11
call fcn.0045f690
add esp, 0x24
test eax, eax
jne 0x40511b
mov eax, dword [0x60b8a10]
mov cl, byte [esp + 0x3b]
cmp cl, al
jne 0x40511b
mov ecx, dword [0x60b8a18]
mov edx, dword [0x60b8a14]
mov dword [0x60b8a00], eax
mov eax, dword [0x60b8a1c]
push 0x60b8a40
push 0x60b8a00
mov dword [0x60b8a04], ecx
mov dword [0x60b8a08], edx
mov dword [0x60b8a0c], eax
call fcn.00407a40
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [ecx + 0x20928], 1
mov edx, dword [esp + 0x10]
mov eax, dword [edx + 0x20928]
test eax, eax
je 0x405156
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
inc eax
add edi, 4
cmp eax, 0x20
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edi
jl 0x404e16
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xa04
ret
mov eax, dword [esp + 0xa1c]
push eax
push esi
call fcn.00405180
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa04
ret