Function at 0x4149a0
Capabilities:
Check for time delay via gettickcount

Disassembly:
sub esp, 0x124
push esi
mov esi, ecx
push 0x4312
push 0x5354
mov dword [esi + 0x190], 1
mov byte [esi + 0x17], 1
mov eax, dword [esi + 0xbc]
push eax
call fcn.00413400
cmp eax, 0xffffffff
mov dword [esi + 0x10], eax
jne 0x414a9c
mov al, byte [esi + 0x20]
test al, al
jne 0x4149e8
push 0x10
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x4932d0
jne 0x4149fc
mov eax, str.Open_port_failed___r_n
push eax
push esi
call fcn.00406ea0
mov eax, dword [esi + 0xb4]
add esp, 8
test eax, eax
je 0x414a66
call sub.MFC42.DLL_AfxGetThread
test eax, eax
je 0x414a42
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
push 0x30
push 0x4932b0
push 0x493280
mov ecx, eax
call sub.MFC42.DLL_CWnd::MessageBoxA
mov byte [esi + 0x17], 0
or eax, 0xffffffff
pop esi
add esp, 0x124
ret
xor eax, eax
push 0x30
push 0x4932b0
push 0x493280
mov ecx, eax
call sub.MFC42.DLL_CWnd::MessageBoxA
mov byte [esi + 0x17], 0
or eax, 0xffffffff
pop esi
add esp, 0x124
ret
call sub.MFC42.DLL_AfxGetThread
test eax, eax
je 0x414a78
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
jmp 0x414a7a
xor eax, eax
push 0x30
push str.ERROR
push str.Device_open_fail___r_nPlease_check_the_device_.
mov ecx, eax
call sub.MFC42.DLL_CWnd::MessageBoxA
mov byte [esi + 0x17], 0
or eax, 0xffffffff
pop esi
add esp, 0x124
ret
push 0
push esi
call fcn.00406ea0
mov eax, dword [esi + 0xb4]
add esp, 8
test eax, eax
mov eax, 0x490830
jne 0x414abb
mov eax, str.Checking_target_MCU_...__r_n
push ebx
push ebp
push edi
push eax
push esi
call fcn.00406ea0
add esp, 8
lea eax, [esi + 0x244]
mov ecx, esi
push 0xffffffffffffffff
push 0
push 0
push eax
push 0x80
push 0
call fcn.00413500
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ebp, eax
test ebp, ebp
jne 0x415378
mov ecx, esi
call fcn.004080e0
mov ebp, eax
test ebp, ebp
jne 0x415378
mov eax, dword [esi + 0xf8]
shl eax, 5
mov ecx, dword [eax + 0x46cc88]
and ecx, 0x7f800
cmp ecx, 0x16800
jb 0x414b6d
mov dl, byte [esi + 0x249]
mov byte [esi + 0x242], dl
mov al, byte [esi + 0x24b]
mov cl, byte [esi + 0x24a]
xor edx, edx
shl al, 2
add al, cl
xor ecx, ecx
mov byte [esi + 0x243], al
mov ch, byte [esi + 0x245]
mov cl, byte [esi + 0x246]
mov dh, byte [esi + 0x247]
mov dl, byte [esi + 0x248]
shl ecx, 0x10
or ecx, edx
mov dword [esi + 0xf4], ecx
jmp 0x414bac
mov al, byte [esi + 0x26a]
xor edx, edx
mov byte [esi + 0x242], al
mov cl, byte [esi + 0x26b]
mov byte [esi + 0x243], cl
mov dh, byte [esi + 0x24c]
mov dl, byte [esi + 0x24d]
xor eax, eax
mov ah, byte [esi + 0x24e]
mov al, byte [esi + 0x24f]
shl edx, 0x10
or edx, eax
mov dword [esi + 0xf4], edx
mov ecx, dword [esi + 0xf8]
lea edi, [esi + 0x644]
shl ecx, 5
mov edx, dword [ecx + 0x46cc88]
and edx, 0x7f800
cmp edx, 0x1a800
jb 0x414bd4
mov byte [edi], 0x18
jmp 0x414bd7
mov byte [edi], 3
push 0xffffffffffffffff
push 0
push 0
push edi
push 1
push 1
mov ecx, esi
call fcn.00413660
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
push 0xa
call ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x490c54
jne 0x414c26
mov eax, str.Erasing_MCU_flash_...
push eax
push esi
call fcn.00406ea0
mov eax, dword [esi + 0xa98]
add esp, 8
cmp eax, 1
jge 0x414c40
mov eax, 1
push 0xffffffffffffffff
push 0xa55a
lea ecx, [esi + 0xaa0]
push 0
push ecx
push eax
push 5
mov ecx, esi
call fcn.00413660
push 0x32
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
mov al, byte [esi + 0x244]
cmp al, 0xe
jne 0x414cb5
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x490c28
jne 0x414ca1
mov eax, str._r_nUser_password_error___r_n
push eax
push esi
call fcn.00406ea0
add esp, 8
mov ebp, 1
jmp 0x415378
cmp al, 0xf
jne 0x414ce1
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x490be0
jne 0x414ccd
mov eax, str._r_nMCU_is_locked___r_n
push eax
push esi
call fcn.00406ea0
add esp, 8
mov ebp, 1
jmp 0x415378
push 0xa
call ebx
push 1
push 0
mov ecx, esi
mov byte [edi], 0
call fcn.00411f30
mov edx, dword [esi + 0xf8]
shl edx, 5
mov ecx, dword [edx + 0x46cc94]
cmp eax, ecx
jle 0x414d12
sub eax, ecx
add eax, 0x1ff
shr eax, 9
mov byte [edi], al
push 0xffffffffffffffff
push 0xa55a
push 0
push edi
push 1
push 3
mov ecx, esi
call fcn.00413660
push 0xc8
call ebx
test byte [esi + 0x1cc], 2
je 0x414d50
mov eax, dword [esi + 0xf8]
shl eax, 5
mov eax, dword [eax + 0x46cca0]
add eax, 0x1ff
shr eax, 9
jmp 0x414d6d
mov ecx, dword [esi + 0xf8]
xor edx, edx
mov dl, byte [edi]
shl ecx, 5
mov eax, dword [ecx + 0x46cc94]
add eax, 0x1ff
shr eax, 9
add eax, edx
lea eax, [eax + eax*4]
push 0
push 0
mov ecx, esi
lea edi, [eax + eax*4]
call fcn.00406f60
xor ebp, ebp
test edi, edi
jle 0x414da3
push 0x64
call ebx
push edi
push ebp
mov ecx, esi
call fcn.00406f60
mov al, byte [esi + 0x17]
test al, al
je 0x4150a5
add ebp, 0x64
cmp ebp, edi
jl 0x414d84
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
lea eax, [esi + 0x245]
lea ecx, [esi + 0xa44]
mov edi, 0x490bb8
mov edx, dword [eax]
mov dword [ecx], edx
mov dx, word [eax + 4]
mov word [ecx + 4], dx
mov al, byte [eax + 6]
mov byte [ecx + 6], al
mov eax, dword [esi + 0xb4]
test eax, eax
jne 0x414dfa
mov edi, str.OK___t_t__.3f___r_n
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x1c], 0
sub eax, ecx
sub esp, 8
mov dword [esp + 0x20], eax
fild qword [esp + 0x20]
fmul dword [0x47505c]
fstp qword [esp]
push edi
push esi
call fcn.00406ea0
mov al, byte [esi + 0x1f]
add esp, 0x10
test al, al
je 0x414ea5
xor edi, edi
mov byte [esp + 0x10], 0x26
mov ecx, dword [esi + 0x214]
mov edx, dword [esp + 0x10]
push 0xffffffffffffffff
push 0xa55a
add ecx, edi
push edi
push ecx
push 0x40
push edx
mov ecx, esi
call fcn.00413660
push 0x32
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
cmp byte [esi + 0x245], 0x54
jne 0x4151d6
mov cl, byte [esp + 0x10]
add edi, 0x40
and cl, 0xdf
cmp edi, 0x100
mov byte [esp + 0x10], cl
jl 0x414e3a
push 0
push 1
mov ecx, esi
call fcn.00411f30
push 0xa
call ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x490cd0
jne 0x414ed2
mov eax, str.Programming_user_code_...
push eax
push esi
call fcn.00406ea0
add esp, 8
mov ecx, esi
push 0
push 0
call fcn.00406f60
mov al, byte [esi + 0x19]
xor edi, edi
neg al
sbb al, al
and al, 0x80
add al, 0x22
mov byte [esp + 0x10], al
mov eax, dword [esi + 0xdc]
test eax, eax
jle 0x414fa3
sub eax, edi
cmp eax, 0x80
jle 0x414f14
mov eax, 0x80
mov ebp, dword [esi + 0x204]
mov edx, dword [esp + 0x10]
mov ecx, edi
push 0xffffffffffffffff
push 0xa55a
add ecx, ebp
push edi
push ecx
push eax
push edx
mov ecx, esi
call fcn.00413660
push 0x23
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
cmp byte [esi + 0x245], 0x54
jne 0x4151d6
mov eax, dword [esi + 0xdc]
mov ecx, esi
push eax
push edi
call fcn.00406f60
mov cl, byte [esp + 0x10]
mov al, byte [esi + 0x17]
add edi, 0x80
and cl, 0xdf
test al, al
mov byte [esp + 0x10], cl
je 0x4150a5
mov eax, dword [esi + 0xdc]
cmp edi, eax
jl 0x414f06
push 0
push 0
mov ecx, esi
call fcn.00406f60
mov eax, dword [esi + 0xb4]
mov edi, 0x490bb8
test eax, eax
jne 0x414fc2
mov edi, str.OK___t_t__.3f___r_n
mov ebp, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebp
mov edx, dword [esp + 0x14]
mov dword [esp + 0x1c], 0
sub eax, edx
sub esp, 8
mov dword [esp + 0x20], eax
fild qword [esp + 0x20]
fmul dword [0x47505c]
fstp qword [esp]
push edi
push esi
call fcn.00406ea0
add esp, 0x10
push 0xa
call ebx
call ebp
mov edi, eax
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x490d04
jne 0x415012
mov eax, str.Programming_OPTIONS_...
push eax
push esi
call fcn.00406ea0
mov eax, dword [esi + 0x14c]
add esp, 8
cmp eax, 0x73
jne 0x415111
cmp dword [esi + 0x150], 2
jge 0x415111
mov eax, dword [esi + 0xa9c]
mov byte [esi + 0x644], 0
cmp eax, 1
jge 0x41504f
mov eax, 1
push 0xffffffffffffffff
push 0xa55a
lea ecx, [esi + 0xba0]
push 0
push ecx
push eax
push 7
mov ecx, esi
call fcn.00413660
push 0x64
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
cmp byte [esi + 0x245], 0x54
je 0x4150af
mov ebp, 1
jmp 0x415378
mov ebp, 3
jmp 0x415378
push 0xffffffffffffffff
lea eax, [esi + 0x649]
push 0xa55a
push 0
push eax
push eax
mov ecx, esi
call fcn.00412b50
push eax
push 4
mov ecx, esi
call fcn.00413660
push 0x32
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
cmp byte [esi + 0x245], 0x54
je 0x4151e0
mov ebp, 1
jmp 0x415378
push 0xffffffffffffffff
lea eax, [esi + 0x649]
push 0xa55a
push 0
push eax
push eax
mov ecx, esi
call fcn.00412b50
push eax
push 4
mov ecx, esi
call fcn.00413660
push 0x64
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
cmp byte [esi + 0x245], 0x54
je 0x41516f
mov ebp, 1
jmp 0x415378
mov eax, dword [esi + 0xa9c]
test eax, eax
je 0x4151e0
cmp eax, 1
mov byte [esi + 0x644], 0
jge 0x41518a
mov eax, 1
push 0xffffffffffffffff
push 0xa55a
lea edx, [esi + 0xba0]
push 0
push edx
push eax
push 7
mov ecx, esi
call fcn.00413660
push 0x64
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x244]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.00413500
mov ebp, eax
test ebp, ebp
jne 0x415378
cmp byte [esi + 0x245], 0x54
je 0x4151e0
mov ebp, 1
jmp 0x415378
mov eax, dword [esi + 0xb4]
mov ebp, 0x490bb8
test eax, eax
jne 0x4151f4
mov ebp, str.OK___t_t__.3f___r_n
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, edi
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], eax
sub esp, 8
fild qword [esp + 0x20]
fmul dword [0x47505c]
fstp qword [esp]
push ebp
push esi
call fcn.00406ea0
mov eax, dword [esi + 0xb4]
add esp, 0x10
test eax, eax
mov eax, 0x4931b4
jne 0x415236
mov eax, str._r_nH_W_Option_upgrade_to:_r_n
push eax
push esi
call fcn.00406ea0
mov ecx, 0x10
or eax, 0xffffffff
lea edi, [esi + 0x244]
add esp, 8
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0xf8]
shl eax, 5
mov ecx, dword [eax + 0x46cc88]
and ecx, 0x7f800
cmp ecx, 0x16800
jb 0x4152f7
mov edx, dword [esi + 0xf4]
xor eax, eax
shr edx, 0x10
mov al, dh
mov byte [esi + 0x245], al
mov ecx, dword [esi + 0xf4]
mov al, byte [esi + 0xf4]
shr ecx, 0x10
xor edx, edx
mov byte [esi + 0x246], cl
mov dl, byte [esi + 0xf5]
mov cl, byte [esi + 0x669]
mov byte [esi + 0x247], dl
mov dl, byte [esi + 0x66c]
mov byte [esi + 0x248], al
mov al, byte [esi + 0x66d]
mov byte [esi + 0x24d], cl
mov cl, byte [esi + 0x66e]
mov byte [esi + 0x250], dl
mov dl, byte [esi + 0x66f]
mov byte [esi + 0x251], al
mov al, byte [esi + 0x670]
mov byte [esi + 0x252], cl
mov byte [esi + 0x253], dl
mov byte [esi + 0x254], al
jmp 0x41536f
mov cl, byte [esi + 0x686]
mov dl, byte [esi + 0x687]
mov al, byte [esi + 0x688]
mov byte [esi + 0x249], cl
mov byte [esi + 0x24a], dl
mov byte [esi + 0x24b], al
mov ecx, dword [esi + 0xf4]
xor edx, edx
shr ecx, 0x10
mov dl, ch
mov byte [esi + 0x24c], dl
mov eax, dword [esi + 0xf4]
mov dl, byte [esi + 0xf4]
shr eax, 0x10
xor ecx, ecx
mov byte [esi + 0x24d], al
mov cl, byte [esi + 0xf5]
mov al, byte [esi + 0x668]
mov byte [esi + 0x24e], cl
mov cl, byte [esi + 0x680]
mov byte [esi + 0x24f], dl
mov byte [esi + 0x250], al
mov byte [esi + 0x269], cl
mov ecx, esi
call fcn.0040cea0
xor ebp, ebp
push 0xffffffffffffffff
lea eax, [esi + 0x644]
push 0
push 0
push eax
push 1
push 0xff
mov ecx, esi
mov byte [eax], 0
call fcn.00413660
push 0x32
call ebx
cmp ebp, 3
ja case.default.0x4153a3
jmp dword [ebp*4 + 0x4155a4]
mov al, byte [esi + 0x20]
test al, al
jne 0x4153b9
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0xb4]
mov edi, 0x4931f4
test eax, eax
jne 0x4153cd
mov edi, str.__Complete____s__r_n
lea edx, [esp + 0x14]
push str._Y__m__d__H:_M:_S
lea eax, [esp + 0x2c]
push edx
push eax
call sub.MFC42.DLL_CTime::GetTickCount
mov ecx, eax
call sub.MFC42.DLL_CTime::Format
mov ecx, dword [eax]
push ecx
push edi
push esi
call fcn.00406ea0
add esp, 0xc
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
jmp 0x41557a
mov al, byte [esi + 0x20]
test al, al
jne 0x41541c
mov edi, dword [sym.imp.USER32.dll_MessageBeep]
push 0x10
call edi
push 0x10
call edi
push 0x10
call edi
call sub.MFC42.DLL_AfxGetThread
test eax, eax
je 0x41542e
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
jmp 0x415430
xor eax, eax
lea ecx, [esp + 0x34]
push 0xff
push ecx
mov ecx, eax
call sub.MFC42.DLL_CWnd::GetWindowTextA
push 0xa
lea edx, [esp + 0x38]
push str.STC_ISP__V
push edx
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x4154ce
mov edi, dword [sym.imp.MSVCRT.dll_strchr]
lea eax, [esp + 0x34]
push 0x29
push eax
call edi
add esp, 8
test eax, eax
je 0x4154ce
lea ecx, [esp + 0x34]
push 0x29
push ecx
call edi
mov byte [eax], 0
mov eax, dword [esi + 0xb4]
add esp, 8
mov edi, 0x493174
test eax, eax
jne 0x415493
mov edi, str._r_nDownload_failed_____s___s_
lea edx, [esp + 0x10]
push str._Y__m__d__H:_M:_S
lea eax, [esp + 0x30]
push edx
push eax
call sub.MFC42.DLL_CTime::GetTickCount
mov ecx, eax
call sub.MFC42.DLL_CTime::Format
mov ecx, dword [eax]
lea edx, [esp + 0x3e]
push ecx
push edx
push edi
push esi
call fcn.00406ea0
add esp, 0x10
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
jmp 0x41557a
mov eax, dword [esi + 0xb4]
mov edi, 0x493140
test eax, eax
jne 0x4154e2
mov edi, str._r_nDownload_failed____s_
lea eax, [esp + 0x20]
push str._Y__m__d__H:_M:_S
lea ecx, [esp + 0x34]
push eax
push ecx
call sub.MFC42.DLL_CTime::GetTickCount
mov ecx, eax
call sub.MFC42.DLL_CTime::Format
mov edx, dword [eax]
push edx
push edi
push esi
call fcn.00406ea0
add esp, 0xc
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CString::CString
jmp 0x41557a
mov al, byte [esi + 0x20]
test al, al
jne 0x415524
push 0
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0xb4]
mov edi, 0x493114
test eax, eax
jne 0x415538
mov edi, str._r_nTerminated____s_
lea eax, [esp + 0x24]
push str._Y__m__d__H:_M:_S
lea ecx, [esp + 0x1c]
push eax
push ecx
call sub.MFC42.DLL_CTime::GetTickCount
mov ecx, eax
call sub.MFC42.DLL_CTime::Format
mov edx, dword [eax]
push edx
push edi
push esi
call fcn.00406ea0
add esp, 0xc
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString
jmp 0x41557a
mov al, byte [esi + 0x20]
test al, al
jne 0x41557a
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0x10]
cmp eax, 0xffffffff
je 0x415590
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x10], 0xffffffff
mov eax, ebp
pop edi
pop ebp
mov byte [esi + 0x17], 0
pop ebx
pop esi
add esp, 0x124
ret