Function at 0x402e20
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x56a72e
mov eax, dword fs:[0]
push eax
sub esp, 0x28
mov eax, dword [0x5c9e64]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x2c], edi
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x34], 0
push eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov esi, eax
mov dword [ebp - 0x18], 0
lea ecx, [ebp - 0x18]
push dword [esi + 4]
call fcn.004048b0
mov dword [ebp - 4], 0
or ebx, 0xffffffff
cmp dword [ebp - 0x1c], 3
jne 0x402f62
push dword [esi + 8]
lea ecx, [ebp - 0x30]
call fcn.004048b0
mov byte [ebp - 4], 1
lea edx, [edi + 0xd0]
mov eax, dword [eax]
mov edi, dword [edx]
sub edi, 0x10
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x14], eax
lea esi, [eax - 0x10]
cmp esi, edi
je 0x402f41
cmp dword [edi + 0xc], 0
jl 0x402f36
mov ecx, dword [esi]
cmp ecx, dword [edi]
jne 0x402f36
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi + 0xc], 0
mov ecx, eax
lea eax, [esi + 0xc]
jl 0x402ee2
cmp ecx, dword [esi]
jne 0x402ee2
lock inc dword [eax]
jmp 0x402f16
mov eax, dword [ecx]
lea edx, [esi + 4]
push 1
push dword [edx]
mov dword [ebp - 0x28], edx
call dword [eax]
mov esi, eax
test esi, esi
je 0x403172
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx]
mov dword [esi + 4], eax
mov eax, dword [ecx]
inc eax
push eax
push dword [ebp - 0x14]
push eax
lea eax, [esi + 0x10]
push eax
call fcn.004026e0
add esp, 0x10
mov eax, ebx
lea ecx, [edi + 0xc]
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x402f2c
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0x24]
lea eax, [esi + 0x10]
mov dword [ecx], eax
jmp 0x402f41
push dword [eax - 0xc]
mov ecx, edx
push eax
call fcn.00402500
mov byte [ebp - 4], 0
mov eax, ebx
mov edx, dword [ebp - 0x30]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x402f5f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x2c]
push 0xa
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x18]
call fcn.0055442f
mov esi, eax
add esp, 0xc
mov dword [ebp - 0x30], esi
lea ecx, [esi - 1]
cmp ecx, 0x18
ja 0x4030e4
mov ecx, dword [ebp - 0x20]
cmp byte [ecx], 0
jne 0x4030e4
call fcn.00418f83
mov ecx, eax
test ecx, ecx
je 0x40318b
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
push esi
lea eax, [ebp - 0x14]
mov byte [ebp - 4], 2
push 0x5abadc
push eax
call fcn.00402ae0
add esp, 0xc
mov byte [ebp - 4], 3
mov edi, dword [ebp - 0x14]
mov dword [ebp - 0x24], 0
mov ecx, dword [edi - 0x10]
test ecx, ecx
je 0x402fe0
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x402ff6
call fcn.00418f83
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
test ecx, ecx
je 0x403177
mov eax, dword [ecx]
call dword [eax + 0xc]
mov dword [ebp - 0x34], 1
lea esi, [eax + 0x10]
mov eax, dword [edi - 0xc]
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x28], eax
lea edx, [eax + 0xa]
test edx, edx
js 0x403181
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x403036
push edx
lea ecx, [ebp - 0x24]
call fcn.00402830
mov esi, dword [ebp - 0x24]
push 0xa
push str.Use_of_COM
push 0xa
push esi
call fcn.004026e0
mov eax, dword [ebp - 0x28]
push eax
push edi
push eax
lea eax, [esi + 0xa]
push eax
call fcn.004026e0
mov ecx, dword [ebp - 0x28]
add esp, 0x20
lea eax, [ecx + 0xa]
cmp eax, dword [esi - 8]
jg 0x403181
push ecx
mov dword [esi - 0xc], eax
lea ecx, [ebp - 0x24]
mov byte [eax + esi], 0
mov eax, esp
push str._port_detected_from_previous_software
push ecx
push eax
call fcn.00404560
mov ecx, dword [ebp - 0x2c]
add esp, 0xc
call fcn.00403d60
mov byte [ebp - 4], 2
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4030a5
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x30]
mov esi, dword [ebp - 0x2c]
dec eax
push 0
push eax
push 0x14e
push dword [esi + 0x178]
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, esi
call fcn.00403e30
mov byte [ebp - 4], 0
lea edx, [edi - 0x10]
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x403137
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x403137
push ecx
mov esi, esp
mov dword [ebp - 0x34], esi
call fcn.00418f83
mov ecx, eax
test ecx, ecx
je 0x40318b
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [esi], eax
mov eax, str.Please_select_the_COM_port_where_motor_is_connected
mov byte [ebp - 4], 4
mov ecx, esi
test eax, 0xffff0000
jne 0x403120
movzx eax, ax
push eax
call fcn.00402380
jmp 0x40312c
push 0x33
push str.Please_select_the_COM_port_where_motor_is_connected
call fcn.00402500
mov ecx, edi
mov byte [ebp - 4], 0
call fcn.00403d60
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x403156
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0054c436
mov esp, ebp
pop ebp
ret
call fcn.004027e0
push 0x80004005
call fcn.00402910
push 0x80070057
call fcn.00402910
push 0x80004005
call fcn.00402910
int3