Function at 0x401150
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb4
push str.CM44_CPU__Versione__C_p6.6
push str.COMELZ_spa._Upgrade__s_n_n
call fcn.00402297
add esp, 8
push 0x41ac84
push 0x41abbc
call fcn.004024f0
add esp, 8
test eax, eax
jne 0x401194
mov dword [ebp - 8], 1
mov dword [ebp - 0xc], 0x1c200
jmp 0x4012d2
push str.Serial_port__1_4__ESCCancel__:
call fcn.00402297
add esp, 4
mov dword [ebp - 8], 0
cmp dword [ebp - 8], 0
jne 0x4012d2
call fcn.004071a5
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x4011ca
call fcn.004071a5
neg eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x8c], eax
cmp dword [ebp - 0x8c], 0x1b
je 0x40120c
cmp dword [ebp - 0x8c], 0x30
jle 0x401220
cmp dword [ebp - 0x8c], 0x34
jle 0x4011f0
jmp 0x401220
mov ecx, dword [ebp - 0x1c]
sub ecx, 0x30
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 8]
push edx
push str._i_n_n
call fcn.00402297
add esp, 8
jmp 0x401220
push str._n_nUpgrade_aborted_n
call fcn.00402297
add esp, 4
push 1
call fcn.00402257
push str.CM44
push 0x41abc4
call fcn.004024f0
add esp, 8
test eax, eax
jne 0x401242
mov dword [ebp - 0xc], 0x4b00
jmp 0x4012cd
push str.Speed__19600__219200__3115200__ESCCancel__:
call fcn.00402297
add esp, 4
mov dword [ebp - 0xc], 0
cmp dword [ebp - 0xc], 0
jne 0x4012cd
call fcn.004071a5
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x401274
call fcn.004071a5
neg eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x90], eax
mov ecx, dword [ebp - 0x90]
sub ecx, 0x1b
mov dword [ebp - 0x90], ecx
cmp dword [ebp - 0x90], 0x18
ja case.0x4012a2.1
mov edx, dword [ebp - 0x90]
movzx eax, byte [edx + 0x401d84]
jmp dword [eax*4 + 0x401d70]
mov dword [ebp - 0xc], 0x2580
jmp case.0x4012a2.1
mov dword [ebp - 0xc], 0x4b00
jmp case.0x4012a2.1
mov dword [ebp - 0xc], 0x1c200
jmp case.0x4012a2.1
push 1
call fcn.00402257
jmp 0x401256
jmp 0x4011a8
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 8]
push edx
call fcn.00401dc0
add esp, 8
push str._nAttesa_accensione_CM44cn
call fcn.00402297
add esp, 4
call fcn.004020a0
call fcn.004020c0
push 8
push 0x41ad24
call fcn.004010c0
add esp, 8
push 0x41ad28
call fcn.00402297
add esp, 4
push 0x41ad2c
call fcn.00401090
add esp, 4
call fcn.004020e0
push str._nInitializing...
call fcn.00402297
add esp, 4
push 0x41ad44
call fcn.00401090
add esp, 4
push 0x41ad48
call fcn.00401090
add esp, 4
push 0x41ad4c
call fcn.00401090
add esp, 4
call fcn.00401da0
mov dword [ebp - 0x38], eax
call fcn.00401da0
sub eax, dword [ebp - 0x38]
cmp eax, 0x12
jge 0x401372
jmp 0x401363
call fcn.00401f80
push 0x41ad50
call fcn.00402297
add esp, 4
push str._nProgram_upload...
call fcn.00402297
add esp, 4
push str.LA8800_r
call fcn.00401090
add esp, 4
push 1
push 0x41ad74
call fcn.004010c0
add esp, 8
mov dword [ebp - 0x28], 0x40a040
mov eax, dword [ebp - 0x28]
mov cx, word [eax]
mov word [ebp - 0x2c], cx
mov edx, dword [ebp - 0x28]
add edx, 2
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x34], 0
movzx eax, word [ebp - 0x2c]
test eax, eax
je 0x4014d7
cmp dword [ebp - 0x20], 0
jne 0x4013f4
push 0x41ad78
call fcn.00401090
add esp, 4
mov ecx, dword [ebp - 0x28]
movzx edx, word [ecx]
mov dword [ebp - 0x94], edx
mov eax, dword [ebp - 0x94]
push eax
push str._04X
lea ecx, [ebp - 0x18]
push ecx
call fcn.00402498
add esp, 0xc
mov edx, dword [ebp - 0x28]
add edx, 2
mov dword [ebp - 0x28], edx
lea eax, [ebp - 0x18]
push eax
call fcn.00401090
add esp, 4
mov ecx, dword [ebp - 0x20]
add ecx, 1
mov dword [ebp - 0x20], ecx
cmp dword [ebp - 0x20], 8
jne 0x4014c6
push 0x41ad84
call fcn.00401090
add esp, 4
push 1
push 0x41ad88
call fcn.004010c0
add esp, 8
mov edx, dword [ebp - 0x34]
add edx, 1
mov dword [ebp - 0x34], edx
cmp dword [ebp - 0x34], 4
jne 0x4014bf
mov eax, dword [0x41afbc]
sub eax, 1
mov dword [0x41afbc], eax
js 0x4014a3
mov ecx, dword [0x41afb8]
mov byte [ecx], 0x2e
mov edx, 0x2e
and edx, 0xff
mov dword [ebp - 0x98], edx
mov eax, dword [0x41afb8]
add eax, 1
mov dword [0x41afb8], eax
jmp 0x4014b8
push 0x41afb8
push 0x2e
call fcn.004022c8
add esp, 8
mov dword [ebp - 0x98], eax
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x20], 0
mov cx, word [ebp - 0x2c]
sub cx, 1
mov word [ebp - 0x2c], cx
jmp 0x4013d5
cmp dword [ebp - 0x20], 0
jle 0x4014f9
push 0x41ad8c
call fcn.00401090
add esp, 4
push 1
push 0x41ad90
call fcn.004010c0
add esp, 8
push 0x41ad94
call fcn.00402297
add esp, 4
push str.Data_upload...
call fcn.00402297
add esp, 4
push str.D0000_r
call fcn.00401090
add esp, 4
push 0xa
push str.______
call fcn.004010c0
add esp, 8
mov dword [0x41b860], 0
mov dword [ebp - 0x3c], 0x40a930
mov edx, dword [ebp - 0x3c]
mov ax, word [edx]
mov word [ebp - 0x40], ax
mov ecx, dword [ebp - 0x3c]
add ecx, 2
mov dword [ebp - 0x3c], ecx
movzx edx, word [ebp - 0x40]
and edx, 0xff
push edx
call fcn.00401fa0
add esp, 4
movzx eax, word [ebp - 0x40]
sar eax, 8
push eax
call fcn.00401fa0
add esp, 4
movzx ecx, word [ebp - 0x40]
test ecx, ecx
je 0x4015cd
mov edx, dword [ebp - 0x3c]
movzx eax, word [edx]
and eax, 0xff
push eax
call fcn.00401fa0
add esp, 4
mov ecx, dword [ebp - 0x3c]
movzx edx, word [ecx]
sar edx, 8
push edx
call fcn.00401fa0
add esp, 4
mov eax, dword [ebp - 0x3c]
movzx ecx, word [eax]
add ecx, dword [0x41b860]
mov dword [0x41b860], ecx
mov edx, dword [ebp - 0x3c]
add edx, 2
mov dword [ebp - 0x3c], edx
mov ax, word [ebp - 0x40]
sub ax, 1
mov word [ebp - 0x40], ax
jmp 0x401576
mov ecx, dword [0x41b860]
and ecx, 0xff
push ecx
call fcn.00401fa0
add esp, 4
mov edx, dword [0x41b860]
shr edx, 8
push edx
call fcn.00401fa0
add esp, 4
push str.cCeEpP_.
push 0x41adbc
call section..text
add esp, 8
test eax, eax
je 0x40160c
jmp 0x401611
jmp 0x40152f
mov dword [0x41b860], 0
mov dword [ebp - 0x44], 0x40aab0
mov eax, dword [ebp - 0x44]
mov cx, word [eax]
mov word [ebp - 0x48], cx
mov edx, dword [ebp - 0x44]
add edx, 2
mov dword [ebp - 0x44], edx
movzx eax, word [ebp - 0x48]
and eax, 0xff
push eax
call fcn.00401fa0
add esp, 4
movzx ecx, word [ebp - 0x48]
sar ecx, 8
push ecx
call fcn.00401fa0
add esp, 4
movzx edx, word [ebp - 0x48]
test edx, edx
je 0x4016af
mov eax, dword [ebp - 0x44]
movzx ecx, word [eax]
and ecx, 0xff
push ecx
call fcn.00401fa0
add esp, 4
mov edx, dword [ebp - 0x44]
movzx eax, word [edx]
sar eax, 8
push eax
call fcn.00401fa0
add esp, 4
mov ecx, dword [ebp - 0x44]
movzx edx, word [ecx]
add edx, dword [0x41b860]
mov dword [0x41b860], edx
mov eax, dword [ebp - 0x44]
add eax, 2
mov dword [ebp - 0x44], eax
mov cx, word [ebp - 0x48]
sub cx, 1
mov word [ebp - 0x48], cx
jmp 0x401657
mov edx, dword [0x41b860]
and edx, 0xff
push edx
call fcn.00401fa0
add esp, 4
mov eax, dword [0x41b860]
shr eax, 8
push eax
call fcn.00401fa0
add esp, 4
push 0x41adc0
push 0x41adc4
call section..text
add esp, 8
test eax, eax
je 0x4016ed
jmp 0x4016f2
jmp 0x401611
mov dword [0x41b860], 0
mov dword [ebp - 0x4c], 0x40ac98
mov ecx, dword [ebp - 0x4c]
mov dx, word [ecx]
mov word [ebp - 0x50], dx
mov eax, dword [ebp - 0x4c]
add eax, 2
mov dword [ebp - 0x4c], eax
movzx ecx, word [ebp - 0x50]
and ecx, 0xff
push ecx
call fcn.00401fa0
add esp, 4
movzx edx, word [ebp - 0x50]
sar edx, 8
push edx
call fcn.00401fa0
add esp, 4
movzx eax, word [ebp - 0x50]
test eax, eax
je 0x401790
mov ecx, dword [ebp - 0x4c]
movzx edx, word [ecx]
and edx, 0xff
push edx
call fcn.00401fa0
add esp, 4
mov eax, dword [ebp - 0x4c]
movzx ecx, word [eax]
sar ecx, 8
push ecx
call fcn.00401fa0
add esp, 4
mov edx, dword [ebp - 0x4c]
movzx eax, word [edx]
add eax, dword [0x41b860]
mov dword [0x41b860], eax
mov ecx, dword [ebp - 0x4c]
add ecx, 2
mov dword [ebp - 0x4c], ecx
mov dx, word [ebp - 0x50]
sub dx, 1
mov word [ebp - 0x50], dx
jmp 0x401739
mov eax, dword [0x41b860]
and eax, 0xff
push eax
call fcn.00401fa0
add esp, 4
mov ecx, dword [0x41b860]
shr ecx, 8
push ecx
call fcn.00401fa0
add esp, 4
push 0x41adc8
push 0x41adcc
call section..text
add esp, 8
test eax, eax
je 0x4017cd
jmp 0x4017d2
jmp 0x4016f2
mov dword [0x41b860], 0
mov dword [ebp - 0x54], 0x40ae20
mov edx, dword [ebp - 0x54]
mov ax, word [edx]
mov word [ebp - 0x58], ax
mov ecx, dword [ebp - 0x54]
add ecx, 2
mov dword [ebp - 0x54], ecx
movzx edx, word [ebp - 0x58]
and edx, 0xff
push edx
call fcn.00401fa0
add esp, 4
movzx eax, word [ebp - 0x58]
sar eax, 8
push eax
call fcn.00401fa0
add esp, 4
mov word [ebp - 0x60], 0
mov byte [ebp - 0x5c], 0
mov byte [ebp - 0x5b], 0
movzx ecx, word [ebp - 0x58]
test ecx, ecx
je 0x4018fb
mov edx, dword [ebp - 0x54]
movzx eax, word [edx]
and eax, 0xff
push eax
call fcn.00401fa0
add esp, 4
mov ecx, dword [ebp - 0x54]
movzx edx, word [ecx]
sar edx, 8
push edx
call fcn.00401fa0
add esp, 4
mov eax, dword [ebp - 0x54]
movzx ecx, word [eax]
add ecx, dword [0x41b860]
mov dword [0x41b860], ecx
mov edx, dword [ebp - 0x54]
add edx, 2
mov dword [ebp - 0x54], edx
mov ax, word [ebp - 0x58]
sub ax, 1
mov word [ebp - 0x58], ax
mov cx, word [ebp - 0x60]
add cx, 1
mov word [ebp - 0x60], cx
movzx edx, word [ebp - 0x60]
cmp edx, 0x100
jne 0x4018f6
mov al, byte [ebp - 0x5c]
add al, 1
mov byte [ebp - 0x5c], al
mov word [ebp - 0x60], 0
mov ecx, dword [0x41afbc]
sub ecx, 1
mov dword [0x41afbc], ecx
js 0x4018e1
mov edx, dword [0x41afb8]
mov byte [edx], 0x2e
mov eax, 0x2e
and eax, 0xff
mov dword [ebp - 0x9c], eax
mov ecx, dword [0x41afb8]
add ecx, 1
mov dword [0x41afb8], ecx
jmp 0x4018f6
push 0x41afb8
push 0x2e
call fcn.004022c8
add esp, 8
mov dword [ebp - 0x9c], eax
jmp 0x401827
movzx edx, word [ebp - 0x60]
test edx, edx
je 0x401961
mov al, byte [ebp - 0x5c]
add al, 1
mov byte [ebp - 0x5c], al
mov word [ebp - 0x60], 0
mov ecx, dword [0x41afbc]
sub ecx, 1
mov dword [0x41afbc], ecx
js 0x40194c
mov edx, dword [0x41afb8]
mov byte [edx], 0x2e
mov eax, 0x2e
and eax, 0xff
mov dword [ebp - 0xa0], eax
mov ecx, dword [0x41afb8]
add ecx, 1
mov dword [0x41afb8], ecx
jmp 0x401961
push 0x41afb8
push 0x2e
call fcn.004022c8
add esp, 8
mov dword [ebp - 0xa0], eax
mov edx, dword [0x41b860]
and edx, 0xff
push edx
call fcn.00401fa0
add esp, 4
mov eax, dword [0x41b860]
shr eax, 8
push eax
call fcn.00401fa0
add esp, 4
push 0x41add0
push 0x41add4
call section..text
add esp, 8
test eax, eax
je 0x4019ac
push 0x41add8
call fcn.00402297
add esp, 4
jmp 0x4019b1
jmp 0x4017d2
push str.Clearing...
call fcn.00402297
add esp, 4
push 0x1e
push 0x41ade8
call fcn.004010c0
add esp, 8
push 0x41adec
call fcn.00402297
add esp, 4
push str.Erasing...
call fcn.00402297
add esp, 4
push 0x1e
push 0x41adfc
call fcn.004010c0
add esp, 8
push 0x41ae00
call fcn.00402297
add esp, 4
push str.Reprogramming__n...
call fcn.00402297
add esp, 4
mov dword [ebp - 0x68], 0
mov word [ebp - 0x6c], 0
mov cx, word [ebp - 0x6c]
mov word [ebp - 0x64], cx
call fcn.00402030
mov dword [ebp - 0x84], eax
cmp dword [ebp - 0x84], 0xffffffff
je 0x401d47
cmp dword [ebp - 0x84], 0xd
jne 0x401a60
mov dword [ebp - 0x68], 0
mov word [ebp - 0x6c], 0
mov dx, word [ebp - 0x6c]
mov word [ebp - 0x64], dx
jmp 0x401ae5
cmp dword [ebp - 0x84], 0x30
jl 0x401a93
cmp dword [ebp - 0x84], 0x39
jg 0x401a93
movzx eax, word [ebp - 0x6c]
shl eax, 4
mov ecx, dword [ebp - 0x84]
lea edx, [eax + ecx - 0x30]
mov word [ebp - 0x6c], dx
mov dword [ebp - 0x84], 0x58
jmp 0x401ae5
cmp dword [ebp - 0x84], 0x41
jl 0x401ac6
cmp dword [ebp - 0x84], 0x46
jg 0x401ac6
movzx eax, word [ebp - 0x6c]
shl eax, 4
mov ecx, dword [ebp - 0x84]
lea edx, [eax + ecx - 0x37]
mov word [ebp - 0x6c], dx
mov dword [ebp - 0x84], 0x58
jmp 0x401ae5
cmp dword [ebp - 0x84], 0x28
jne 0x401ae5
mov ax, word [ebp - 0x6c]
mov word [ebp - 0x64], ax
mov word [ebp - 0x6c], 0
mov cx, word [ebp - 0x64]
mov word [ebp - 0x64], cx
mov edx, dword [ebp - 0x68]
mov al, byte [ebp - 0x84]
mov byte [ebp + edx - 0x80], al
mov ecx, dword [ebp - 0x68]
mov byte [ebp + ecx - 0x7f], 0
cmp dword [ebp - 0x68], 0x12
jge 0x401b09
mov edx, dword [ebp - 0x68]
add edx, 1
mov dword [ebp - 0x68], edx
push 0x41ae18
lea eax, [ebp - 0x80]
push eax
call fcn.004024f0
add esp, 8
test eax, eax
jne 0x401cc2
call fcn.00401da0
mov dword [ebp - 0x88], eax
call fcn.00401da0
sub eax, dword [ebp - 0x88]
cmp eax, 0x12
jge 0x401b53
call fcn.00402030
mov dword [ebp - 0x84], eax
cmp dword [ebp - 0x84], 0xffffffff
jne 0x401b53
jmp 0x401b2d
cmp dword [ebp - 0x84], 0xffffffff
jne 0x401b70
push 0x41ae1c
call fcn.00402297
add esp, 4
push 1
call fcn.00402257
cmp dword [ebp - 0x84], 0x41
jne 0x401b8b
push str._r_nError_during_reprogramming_of_CPU_n
call fcn.00402297
add esp, 4
jmp 0x401c44
mov ecx, dword [ebp - 0x84]
sub ecx, 0x41
and ecx, 8
je 0x401ba5
mov dword [ebp - 0xa4], str._P2
jmp 0x401baf
mov dword [ebp - 0xa4], 0x41b640
mov edx, dword [ebp - 0x84]
sub edx, 0x41
and edx, 4
je 0x401bc9
mov dword [ebp - 0xa8], str._P1
jmp 0x401bd3
mov dword [ebp - 0xa8], 0x41b641
mov eax, dword [ebp - 0x84]
sub eax, 0x41
and eax, 2
je 0x401bed
mov dword [ebp - 0xac], str._AY
jmp 0x401bf7
mov dword [ebp - 0xac], 0x41b642
mov ecx, dword [ebp - 0x84]
sub ecx, 0x41
and ecx, 1
je 0x401c11
mov dword [ebp - 0xb0], str._AX
jmp 0x401c1b
mov dword [ebp - 0xb0], 0x41b643
mov edx, dword [ebp - 0xa4]
push edx
mov eax, dword [ebp - 0xa8]
push eax
mov ecx, dword [ebp - 0xac]
push ecx
mov edx, dword [ebp - 0xb0]
push edx
push str._r_nError_during_reprogramming_of__s_s_s_s_n
call fcn.00402297
add esp, 0x14
call fcn.00401da0
mov dword [ebp - 0x88], eax
call fcn.00401da0
sub eax, dword [ebp - 0x88]
cmp eax, 0x12
jge 0x401c75
call fcn.00402030
mov dword [ebp - 0x84], eax
cmp dword [ebp - 0x84], 0xffffffff
jne 0x401c75
jmp 0x401c4f
cmp dword [ebp - 0x84], 0xffffffff
jne 0x401c92
push str._n_nCommunication_error_nProgram_aborted_n
call fcn.00402297
add esp, 4
push 1
call fcn.00402257
cmp dword [ebp - 0x84], 0x2d
jne 0x401cb5
push str._n_nProgram_aborted_n
call fcn.00402297
add esp, 4
push str.Please_contact_COMELZ_reporting_the_problem_n
call fcn.00402297
add esp, 4
push str.Reprogramming..._n
call fcn.00402297
add esp, 4
push str._r_nXINX
lea eax, [ebp - 0x80]
push eax
call fcn.004024f0
add esp, 8
test eax, eax
jne 0x401ce5
movzx ecx, word [ebp - 0x6c]
cmp ecx, 0xfe
jne 0x401ce5
jmp 0x401d4c
push str._r_nXXXX_XXXX_
lea edx, [ebp - 0x80]
push edx
call fcn.004024f0
add esp, 8
test eax, eax
jne 0x401d47
mov eax, dword [0x41afbc]
sub eax, 1
mov dword [0x41afbc], eax
js 0x401d32
mov ecx, dword [0x41afb8]
mov byte [ecx], 0x2e
mov edx, 0x2e
and edx, 0xff
mov dword [ebp - 0xb4], edx
mov eax, dword [0x41afb8]
add eax, 1
mov dword [0x41afb8], eax
jmp 0x401d47
push 0x41afb8
push 0x2e
call fcn.004022c8
add esp, 8
mov dword [ebp - 0xb4], eax
jmp 0x401a25
push str.Ok_n_n
call fcn.00402297
add esp, 4
push str.Reprogramming_completed_succesfully._n
call fcn.00402297
add esp, 4
jmp 0x401d6a
xor eax, eax
mov esp, ebp
pop ebp
ret