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

Disassembly:
sub esp, 0x124
push esi
mov esi, ecx
push 0x4312
push 0x5354
mov byte [esi + 0x17], 1
mov eax, dword [esi + 0xbc]
push eax
call fcn.0040b820
cmp eax, 0xffffffff
mov dword [esi + 0x10], eax
jne 0x40bce2
mov al, byte [esi + 0x20]
test al, al
jne 0x40bc2e
push 0x10
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x424d90
jne 0x40bc42
mov eax, str.Open_port_failed___r_n
push eax
push esi
call fcn.00401660
mov eax, dword [esi + 0xb4]
add esp, 8
test eax, eax
je 0x40bcac
call sub.MFC42.DLL_AfxGetThread
test eax, eax
je 0x40bc88
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
push 0x30
push 0x424d70
push 0x424d40
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 0x424d70
push 0x424d40
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 0x40bcbe
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
jmp 0x40bcc0
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.00401660
mov eax, dword [esi + 0xb4]
add esp, 8
test eax, eax
mov eax, 0x4228d8
jne 0x40bd01
mov eax, str.Checking_target_MCU_...__r_n
push ebx
push ebp
push edi
push eax
push esi
call fcn.00401660
add esp, 8
lea ebx, [esi + 0x210]
mov ecx, esi
push 0xffffffffffffffff
push 0
push 0
push ebx
push 0x80
push 0
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
mov ecx, esi
call fcn.00402820
mov ebp, eax
test ebp, ebp
jne 0x40c59a
mov eax, dword [esi + 0xf8]
shl eax, 5
mov eax, dword [eax + 0x413448]
and eax, 0x3fc000
cmp eax, 0xe8000
je 0x40bdb5
cmp eax, 0xec000
je 0x40bdb5
cmp eax, 0xf0000
je 0x40bdb5
cmp eax, 0xf4000
je 0x40bdb5
mov cl, byte [esi + 0x236]
xor eax, eax
mov byte [esi + 0x20e], cl
mov dl, byte [esi + 0x237]
mov byte [esi + 0x20f], dl
mov ah, byte [esi + 0x218]
mov al, byte [esi + 0x219]
xor ecx, ecx
mov ch, byte [esi + 0x21a]
mov cl, byte [esi + 0x21b]
shl eax, 0x10
or eax, ecx
mov dword [esi + 0xf4], eax
jmp 0x40bdff
mov dl, byte [esi + 0x215]
mov byte [esi + 0x20e], dl
mov al, byte [esi + 0x217]
mov cl, byte [esi + 0x216]
xor edx, edx
shl al, 2
add al, cl
xor ecx, ecx
mov byte [esi + 0x20f], al
mov ch, byte [esi + 0x211]
mov cl, byte [esi + 0x212]
mov dh, byte [esi + 0x213]
mov dl, byte [esi + 0x214]
shl ecx, 0x10
or ecx, edx
mov dword [esi + 0xf4], ecx
push 0xffffffffffffffff
lea edi, [esi + 0x610]
push 0
push 0
push edi
push 1
push 1
mov ecx, esi
mov byte [edi], 3
call fcn.0040ba80
push 0xffffffffffffffff
push 0
push 0
push ebx
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x422cfc
jne 0x40be55
mov eax, str.Erasing_MCU_flash_...
push eax
push esi
call fcn.00401660
mov eax, dword [esi + 0xa64]
add esp, 8
cmp eax, 1
jge 0x40be6f
mov eax, 1
push 0xffffffffffffffff
push 0xa55a
lea ecx, [esi + 0xa6c]
push 0
push ecx
push eax
push 5
mov ecx, esi
call fcn.0040ba80
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0xffffffffffffffff
push 0
push 0
push ebx
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
mov bl, byte [ebx]
cmp bl, 0xe
jne 0x40bedf
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x422cd0
jne 0x40becb
mov eax, str._r_nUser_password_error___r_n
push eax
push esi
call fcn.00401660
add esp, 8
mov ebp, 1
jmp 0x40c59a
cmp bl, 0xf
jne 0x40bf0c
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x422c88
jne 0x40bef8
mov eax, str._r_nMCU_is_locked___r_n
push eax
push esi
call fcn.00401660
add esp, 8
mov ebp, 1
jmp 0x40c59a
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
push 0xa
call ebp
push 1
push 0
mov ecx, esi
mov byte [edi], 0
call fcn.0040aa70
mov edx, dword [esi + 0xf8]
shl edx, 5
mov ecx, dword [edx + 0x413454]
cmp eax, ecx
jle 0x40bf43
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.0040ba80
push 0xc8
call ebp
test byte [esi + 0x198], 2
je 0x40bf87
mov eax, dword [esi + 0xf8]
shl eax, 5
mov eax, dword [eax + 0x413460]
add eax, 0x1ff
shr eax, 9
lea edi, [eax + eax*4]
lea edi, [edi + edi*4]
jmp 0x40bfaa
mov ecx, dword [esi + 0xf8]
xor edx, edx
mov dl, byte [edi]
shl ecx, 5
mov eax, dword [ecx + 0x413454]
add eax, 0x1ff
shr eax, 9
add eax, edx
lea eax, [eax + eax*4]
lea edi, [eax + eax*4]
push 0
push 0
mov ecx, esi
call fcn.00401720
xor ebx, ebx
test edi, edi
jle 0x40bfda
push 0x64
call ebp
push edi
push ebx
mov ecx, esi
call fcn.00401720
mov al, byte [esi + 0x17]
test al, al
je 0x40c316
add ebx, 0x64
cmp ebx, edi
jl 0x40bfbb
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x210]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
lea eax, [esi + 0x211]
lea ecx, [esi + 0xa10]
mov edi, 0x422c60
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 0x40c031
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 [0x41aa3c]
fstp qword [esp]
push edi
push esi
call fcn.00401660
mov al, byte [esi + 0x1f]
add esp, 0x10
test al, al
je 0x40c0e4
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
xor edi, edi
mov byte [esp + 0x10], 0x26
mov ecx, dword [esi + 0x1e0]
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.0040ba80
push 0x32
call ebx
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x210]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
cmp byte [esi + 0x211], 0x54
jne 0x40c3ed
mov cl, byte [esp + 0x10]
add edi, 0x40
and cl, 0xdf
cmp edi, 0x100
mov byte [esp + 0x10], cl
jl 0x40c077
jmp 0x40c0ea
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 1
mov ecx, esi
call fcn.0040aa70
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, 0x422d78
jne 0x40c117
mov eax, str.Programming_user_code_...
push eax
push esi
call fcn.00401660
add esp, 8
mov ecx, esi
push 0
push 0
call fcn.00401720
mov bl, byte [esi + 0x19]
mov eax, dword [esi + 0xdc]
xor edi, edi
neg bl
sbb bl, bl
and bl, 0x80
add bl, 0x22
test eax, eax
mov byte [esp + 0x10], bl
jle 0x40c1ea
sub eax, edi
cmp eax, 0x80
jle 0x40c15b
mov eax, 0x80
mov ebp, dword [esi + 0x1d0]
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.0040ba80
push 0x23
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x210]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
cmp byte [esi + 0x211], 0x54
jne 0x40c3ed
mov eax, dword [esi + 0xdc]
mov ecx, esi
push eax
push edi
call fcn.00401720
mov al, byte [esi + 0x17]
add edi, 0x80
and bl, 0xdf
test al, al
mov byte [esp + 0x10], bl
je 0x40c316
mov eax, dword [esi + 0xdc]
cmp edi, eax
jl 0x40c14d
push 0
push 0x64
mov ecx, esi
call fcn.00401720
mov eax, dword [esi + 0xb4]
mov edi, 0x422c60
test eax, eax
jne 0x40c209
mov edi, str.OK___t_t__.3f___r_n
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebx
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 [0x41aa3c]
fstp qword [esp]
push edi
push esi
call fcn.00401660
add esp, 0x10
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
call ebx
mov ebx, eax
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, 0x422dac
jne 0x40c25d
mov eax, str.Programming_OPTIONS_...
push eax
push esi
call fcn.00401660
mov eax, dword [esi + 0x12c]
add esp, 8
cmp eax, 0x73
jne 0x40c320
cmp dword [esi + 0x130], 2
jge 0x40c320
mov eax, dword [esi + 0xa68]
mov byte [esi + 0x610], 0
cmp eax, 1
jge 0x40c29a
mov eax, 1
push 0xffffffffffffffff
push 0xa55a
lea ecx, [esi + 0xb6c]
push 0
push ecx
push eax
push 7
mov ecx, esi
call fcn.0040ba80
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x210]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
cmp byte [esi + 0x211], 0x54
jne 0x40c3ed
push 0xffffffffffffffff
lea eax, [esi + 0x615]
push 0xa55a
push ebp
push eax
push eax
mov ecx, esi
call fcn.0040b570
push eax
push 4
mov ecx, esi
call fcn.0040ba80
push 0x32
jmp 0x40c3b9
mov ebp, 3
jmp 0x40c59a
push 0xffffffffffffffff
lea eax, [esi + 0x615]
push 0xa55a
push 0
push eax
push eax
mov ecx, esi
call fcn.0040b570
push eax
push 4
mov ecx, esi
call fcn.0040ba80
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x210]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
cmp byte [esi + 0x211], 0x54
je 0x40c382
mov ebp, 1
jmp 0x40c59a
mov eax, dword [esi + 0xa68]
test eax, eax
je 0x40c3f7
cmp eax, 1
mov byte [esi + 0x610], 0
jge 0x40c39d
mov eax, 1
push 0xffffffffffffffff
push 0xa55a
lea edx, [esi + 0xb6c]
push 0
push edx
push eax
push 7
mov ecx, esi
call fcn.0040ba80
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x210]
push 0
push eax
push 0x80
push 0
mov ecx, esi
call fcn.0040b920
mov ebp, eax
test ebp, ebp
jne 0x40c59a
cmp byte [esi + 0x211], 0x54
je 0x40c3f7
mov ebp, 1
jmp 0x40c59a
mov eax, dword [esi + 0xb4]
xor ebp, ebp
cmp eax, ebp
mov edi, 0x422c60
jne 0x40c40d
mov edi, str.OK___t_t__.3f___r_n
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, ebx
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], eax
sub esp, 8
fild qword [esp + 0x20]
fmul dword [0x41aa3c]
fstp qword [esp]
push edi
push esi
call fcn.00401660
mov eax, dword [esi + 0xb4]
add esp, 0x10
cmp eax, ebp
mov eax, 0x424cf0
jne 0x40c44b
mov eax, str._r_nH_W_Option_upgrade_to:_r_n
push eax
push esi
call fcn.00401660
mov ecx, 0x10
or eax, 0xffffffff
lea edi, [esi + 0x210]
add esp, 8
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0xf8]
shl eax, 5
mov eax, dword [eax + 0x413448]
and eax, 0x3fc000
cmp eax, 0xe8000
je 0x40c51b
cmp eax, 0xec000
je 0x40c51b
cmp eax, 0xf0000
je 0x40c51b
cmp eax, 0xf4000
je 0x40c51b
mov cl, byte [esi + 0x652]
mov dl, byte [esi + 0x653]
mov al, byte [esi + 0x654]
mov byte [esi + 0x215], cl
mov byte [esi + 0x216], dl
mov byte [esi + 0x217], al
mov ecx, dword [esi + 0xf4]
xor edx, edx
shr ecx, 0x10
mov dl, ch
mov byte [esi + 0x218], dl
mov eax, dword [esi + 0xf4]
mov dl, byte [esi + 0xf4]
shr eax, 0x10
xor ecx, ecx
mov byte [esi + 0x219], al
mov cl, byte [esi + 0xf5]
mov al, byte [esi + 0x634]
mov byte [esi + 0x21a], cl
mov cl, byte [esi + 0x64c]
mov byte [esi + 0x21b], dl
mov byte [esi + 0x21c], al
mov byte [esi + 0x235], cl
jmp 0x40c593
mov edx, dword [esi + 0xf4]
xor eax, eax
shr edx, 0x10
mov al, dh
mov byte [esi + 0x211], al
mov ecx, dword [esi + 0xf4]
mov al, byte [esi + 0xf4]
shr ecx, 0x10
xor edx, edx
mov byte [esi + 0x212], cl
mov dl, byte [esi + 0xf5]
mov cl, byte [esi + 0x635]
mov byte [esi + 0x213], dl
mov dl, byte [esi + 0x639]
mov byte [esi + 0x214], al
mov al, byte [esi + 0x63a]
mov byte [esi + 0x219], cl
mov cl, byte [esi + 0x63b]
mov byte [esi + 0x21d], dl
mov dl, byte [esi + 0x63c]
mov byte [esi + 0x21e], al
mov byte [esi + 0x21f], cl
mov byte [esi + 0x220], dl
mov ecx, esi
call fcn.00406af0
push 0xffffffffffffffff
lea eax, [esi + 0x610]
push 0
push 0
push eax
push 1
push 0xff
mov ecx, esi
mov byte [eax], 0
call fcn.0040ba80
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp ebp, 3
ja case.default.0x40c5c9
jmp dword [ebp*4 + 0x40c7ec]
mov al, byte [esi + 0x20]
test al, al
jne 0x40c5df
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0xb4]
mov edi, 0x424cc0
test eax, eax
jne 0x40c5f3
mov edi, str.__Complete____s__r_n
lea eax, [esp + 0x14]
push str._Y__m__d__H:_M:_S
lea ecx, [esp + 0x2c]
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.00401660
add esp, 0xc
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
jmp 0x40c7c2
mov al, byte [esi + 0x20]
test al, al
jne 0x40c642
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 0x40c654
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
jmp 0x40c656
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 0x40c716
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 0x40c716
lea ecx, [esp + 0x34]
push 0x29
push ecx
call edi
mov byte [eax], 0
mov eax, dword [esi + 0xb4]
add esp, 8
mov edi, 0x424c74
test eax, eax
jne 0x40c6bd
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.00401660
add esp, 0x10
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
mov eax, dword [esi + 0xb4]
test eax, eax
mov eax, str._r_n_r_n
jne 0x40c707
mov eax, str._r_n_r_nPlease_using_the_newest_software__
push eax
push esi
call fcn.00401660
add esp, 8
jmp 0x40c7c2
mov eax, dword [esi + 0xb4]
mov edi, 0x424bf0
test eax, eax
jne 0x40c72a
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.00401660
add esp, 0xc
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CString::CString
jmp 0x40c7c2
mov al, byte [esi + 0x20]
test al, al
jne 0x40c76c
push 0
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0xb4]
mov edi, 0x424bc4
test eax, eax
jne 0x40c780
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.00401660
add esp, 0xc
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString
jmp 0x40c7c2
mov al, byte [esi + 0x20]
test al, al
jne 0x40c7c2
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
mov eax, dword [esi + 0x10]
cmp eax, 0xffffffff
je 0x40c7d8
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