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

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
mov ebp, ecx
push 0xa
call edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0xb4]
test eax, eax
mov eax, 0x422cfc
jne 0x405121
mov eax, str.Erasing_MCU_flash_...
push eax
push ebp
call fcn.00401660
mov eax, dword [ebp + 0xf8]
add esp, 8
shl eax, 5
mov esi, 4
mov ecx, dword [eax + 0x413448]
shr ecx, 0xe
and ecx, 0xff
lea eax, [ecx - 1]
mov ecx, 0x72
cmp eax, 0x20
ja case.0x405161.5
xor edx, edx
mov dl, byte [eax + 0x405a20]
jmp dword [edx*4 + 0x405a0c]
mov byte [ebp + 0xc6c], 0x46
mov byte [ebp + 0xc6d], 0xb9
cmp dword [ebp + 0x12c], ecx
jge 0x405357
push 1
push 0
mov ecx, ebp
call fcn.0040aa70
add eax, 0x1ff
lea esi, [ebp + 0x610]
cdq
and edx, 0x1ff
push 8
add eax, edx
push esi
sar eax, 9
mov byte [ebp + 0x611], al
mov al, 0x33
mov ecx, ebp
mov byte [esi], 0x84
mov byte [ebp + 0x612], al
mov byte [ebp + 0x613], al
mov byte [ebp + 0x614], al
mov byte [ebp + 0x615], al
mov byte [ebp + 0x616], al
mov byte [ebp + 0x617], al
call fcn.00401c00
push 0x61a8
jmp 0x4055a7
mov byte [ebp + 0xc6c], 0x46
mov byte [ebp + 0xc6d], 0xb9
cmp dword [ebp + 0x12c], ecx
jge 0x405357
push 1
push 0
mov ecx, ebp
call fcn.0040aa70
add eax, 0x1ff
lea esi, [ebp + 0x610]
cdq
and edx, 0x1ff
mov byte [esi], 0x84
add eax, edx
xor edx, edx
sar eax, 9
mov ecx, eax
mov byte [ebp + 0x611], 0
shl eax, 9
mov dl, ah
mov eax, dword [ebp + 0xf8]
shl eax, 5
shl ecx, 9
shr ecx, 0x10
lea eax, [eax + 0x413454]
mov byte [ebp + 0x612], cl
mov byte [ebp + 0x613], dl
mov byte [ebp + 0x614], 0
mov ecx, dword [eax]
xor edx, edx
shr ecx, 0x10
mov byte [ebp + 0x615], cl
mov dl, byte [eax + 1]
mov byte [ebp + 0x616], dl
mov al, byte [eax]
lea edx, [ebp + 0x618]
xor ecx, ecx
mov byte [ebp + 0x617], al
xor eax, eax
mov dword [edx], ecx
mov dword [edx + 4], ecx
mov word [edx + 8], cx
mov byte [edx + 0xa], cl
mov cl, 0x80
sub cl, al
mov byte [eax + ebp + 0x623], cl
inc eax
cmp eax, 0x73
jl 0x405292
push 0x86
jmp 0x40559a
cmp dword [ebp + 0x12c], 0x71
jge case.0x405161.5
push 1
push 0
mov ecx, ebp
call fcn.0040aa70
mov edx, eax
lea esi, [ebp + 0x610]
shr edx, 0x10
mov byte [esi], 0x84
mov byte [ebp + 0x612], dl
mov edx, dword [ebp + 0xf8]
xor ecx, ecx
shl edx, 5
mov cl, ah
mov byte [ebp + 0x614], al
lea eax, [edx + 0x413454]
mov byte [ebp + 0x611], 0xff
mov byte [ebp + 0x613], cl
xor edx, edx
mov ecx, dword [eax]
shr ecx, 0x10
mov byte [ebp + 0x615], cl
mov dl, byte [eax + 1]
mov byte [ebp + 0x616], dl
mov al, byte [eax]
lea edx, [ebp + 0x618]
xor ecx, ecx
mov byte [ebp + 0x617], al
xor eax, eax
mov dword [edx], ecx
mov dword [edx + 4], ecx
mov word [edx + 8], cx
mov byte [edx + 0xa], cl
mov cl, 0x80
sub cl, al
mov byte [eax + ebp + 0x623], cl
inc eax
cmp eax, 0x22
jl 0x405333
push 0x35
jmp 0x40559a
cmp dword [ebp + 0x12c], ecx
jl 0x4054da
cmp dword [ebp + 0x144], esi
je 0x405476
mov ecx, dword [ebp + 0xa64]
lea ebx, [ebp + 0x610]
lea esi, [ebp + 0xa6c]
lea edi, [ebp + 0x615]
mov byte [ebx], 5
mov dl, byte [ebp + 0xc6c]
mov al, byte [ebp + 0xc6d]
mov byte [ebp + 0x613], dl
mov edx, ecx
mov byte [ebp + 0x611], 0
shr ecx, 2
mov byte [ebp + 0x612], 0
mov byte [ebp + 0x614], al
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0xa64]
mov ecx, ebp
add eax, 5
push eax
push ebx
call fcn.00401c00
push 0x7d0
mov ecx, ebp
call fcn.00401f50
push 1
push 0
mov ecx, ebp
call fcn.00401cf0
mov al, byte [ebp + 0x17]
test al, al
je 0x4055e1
mov ecx, ebp
call fcn.00401f70
test al, al
jne 0x4055ee
lea ecx, [ebp + 0x210]
push 1
push ecx
mov ecx, ebp
call fcn.00401cf0
test al, al
je 0x4053db
mov dl, byte [ebx]
mov al, byte [ebp + 0x210]
and dl, 0xf
cmp al, dl
je 0x40546e
cmp al, 0xe
jne 0x40543a
mov eax, dword [ebp + 0xb4]
test eax, eax
mov eax, 0x422cd0
jne 0x405430
mov eax, str._r_nUser_password_error___r_n
push eax
push ebp
call fcn.00401660
add esp, 8
cmp byte [ebp + 0x210], 0xf
jne 0x405461
mov eax, dword [ebp + 0xb4]
test eax, eax
mov eax, 0x422c88
jne 0x405457
mov eax, str._r_nMCU_is_locked___r_n
push eax
push ebp
call fcn.00401660
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
lea esi, [ebp + 0x610]
push 1
push 0
mov byte [ebp + 0x611], 0
mov byte [esi], 3
mov cl, byte [ebp + 0xc6d]
mov al, byte [ebp + 0xc6c]
mov byte [ebp + 0x614], cl
mov ecx, ebp
mov byte [ebp + 0x612], 0
mov byte [ebp + 0x613], al
call fcn.0040aa70
mov edx, dword [ebp + 0xf8]
shl edx, 5
mov ecx, dword [edx + 0x413454]
cmp eax, ecx
jle 0x4054d3
sub eax, ecx
add eax, 0x1ff
shr eax, 9
mov byte [ebp + 0x611], al
push 5
jmp 0x40559a
cmp dword [ebp + 0x144], esi
je 0x40555a
lea esi, [ebp + 0x610]
push 1
push esi
mov ecx, ebp
mov byte [esi], 5
call fcn.00401c00
push 0x7d0
mov ecx, ebp
call fcn.00401f50
push 1
push 0
mov ecx, ebp
call fcn.00401cf0
mov al, byte [ebp + 0x17]
test al, al
je 0x4055e1
mov ecx, ebp
call fcn.00401f70
test al, al
jne 0x4055ee
lea eax, [ebp + 0x210]
push 1
push eax
mov ecx, ebp
call fcn.00401cf0
test al, al
je 0x40550c
mov cl, byte [esi]
mov al, byte [ebp + 0x210]
and cl, 0xf
cmp al, cl
je 0x405556
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
push 0xa
call edi
lea esi, [ebp + 0x610]
push 1
push 0
mov ecx, ebp
mov byte [esi], 3
mov byte [ebp + 0x611], 0
call fcn.0040aa70
mov edx, dword [ebp + 0xf8]
shl edx, 5
mov ecx, dword [edx + 0x413454]
cmp eax, ecx
jle 0x405598
sub eax, ecx
add eax, 0x1ff
shr eax, 9
mov byte [ebp + 0x611], al
push 2
push esi
mov ecx, ebp
call fcn.00401c00
push 0x3a98
mov ecx, ebp
call fcn.00401f50
push 1
push 0
mov ecx, ebp
call fcn.00401cf0
mov al, byte [ebp + 0x17]
test al, al
je 0x4055e1
mov ecx, ebp
call fcn.00401f70
test al, al
jne 0x4055ee
lea eax, [ebp + 0x210]
push 1
push eax
mov ecx, ebp
call fcn.00401cf0
test al, al
jne 0x4055fb
jmp 0x4055b9
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 8
ret
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 8
ret
lea ebx, [ebp + 0xa10]
lea ecx, [ebp + 0x211]
mov edx, ebx
mov eax, dword [ecx]
mov dword [edx], eax
mov ax, word [ecx + 4]
mov word [edx + 4], ax
mov eax, dword [ebp + 0x12c]
mov cl, byte [ecx + 6]
cmp eax, 0x62
mov byte [edx + 6], cl
jg 0x405640
lea edx, [ebp + 0x1ab]
mov eax, ebx
mov ecx, dword [edx]
mov dword [eax], ecx
mov cx, word [edx + 4]
mov word [eax + 4], cx
mov dl, byte [edx + 6]
mov byte [eax + 6], dl
mov eax, dword [ebp + 0x144]
test eax, eax
jne 0x405660
cmp byte [ebp + 0x210], 0x80
je 0x4056b1
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
cmp eax, 3
jl 0x40569a
mov al, byte [esi]
mov cl, byte [ebp + 0x210]
and al, 0xf
cmp cl, al
jne 0x4056a4
mov al, byte [ebp + 0x23]
test al, al
je 0x4056b1
mov ecx, 7
mov edi, ebx
lea esi, [ebp + 0xa33]
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4056b1
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
mov al, byte [ebp + 0x210]
test al, al
je 0x4056b1
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
mov eax, dword [ebp + 0xb4]
mov esi, 0x422c60
test eax, eax
jne 0x4056c5
mov esi, str.OK___t_t__.3f___r_n
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [esp + 0x10]
mov dword [esp + 0x14], 0
sub eax, edi
sub esp, 8
mov dword [esp + 0x18], eax
fild qword [esp + 0x18]
fmul dword [0x41aa3c]
fstp qword [esp]
push esi
push ebp
call fcn.00401660
mov eax, dword [ebp + 0xf8]
add esp, 0x10
shl eax, 5
mov ecx, dword [eax + 0x413448]
and ecx, 0x3fc000
cmp ecx, 0x1c000
jbe 0x4059ff
mov al, byte [ebx]
mov cl, byte [ebp + 0xa11]
cmp al, cl
jne 0x405750
cmp al, byte [ebp + 0xa12]
jne 0x405750
cmp al, byte [ebp + 0xa13]
jne 0x405750
cmp al, byte [ebp + 0xa14]
jne 0x405750
cmp al, byte [ebp + 0xa15]
jne 0x405750
cmp al, byte [ebp + 0xa16]
je 0x4059ff
mov dl, byte [ebp + 0x2d]
test dl, dl
jne 0x4057af
mov edx, dword [ebp + 0xb4]
mov esi, 0x422c20
test edx, edx
jne 0x40576b
mov esi, str.MCU_ID_:__02X_02X_02X_02X_02X_02X_02X_r_n
xor edx, edx
and ecx, 0xff
mov dl, byte [ebp + 0xa16]
and eax, 0xff
push edx
xor edx, edx
mov dl, byte [ebp + 0xa15]
push edx
xor edx, edx
mov dl, byte [ebp + 0xa14]
push edx
xor edx, edx
mov dl, byte [ebp + 0xa13]
push edx
xor edx, edx
mov dl, byte [ebp + 0xa12]
push edx
push ecx
push eax
push esi
push ebp
call fcn.00401660
add esp, 0x24
mov al, byte [ebp + 0xa3a]
test al, al
je 0x405841
mov ecx, 0xfffff5e9
lea esi, [ebp + 0xa17]
sub ecx, ebp
mov al, byte [esi - 7]
xor edi, edi
mov byte [esi], al
mov dl, byte [ebp + 0xa3e]
mov byte [esp + 0x10], dl
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x4057e7
jmp dword [eax*4 + 0x405a44]
mov al, byte [edi + ebp + 0xa42]
mov dl, byte [esi]
add dl, al
mov byte [esi], dl
jmp case.default.0x4057e7
mov al, byte [edi + ebp + 0xa42]
imul byte [esi]
jmp 0x405825
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa42]
cdq
idiv ebx
jmp 0x405825
mov dl, byte [edi + ebp + 0xa42]
mov al, byte [esi]
xor al, dl
mov byte [esi], al
mov bl, byte [esp + 0x10]
shr bl, 2
inc edi
mov byte [esp + 0x10], bl
cmp edi, 4
jl 0x4057db
inc esi
lea eax, [ecx + esi]
cmp eax, 7
jl 0x4057ca
mov al, byte [ebp + 0xa3b]
test al, al
je 0x4058d7
mov ecx, 0xfffff5e2
lea esi, [ebp + 0xa1e]
sub ecx, ebp
mov dl, byte [esi - 0xe]
xor edi, edi
mov byte [esi], dl
mov al, byte [ebp + 0xa3f]
mov byte [esp + 0x10], al
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x405879
jmp dword [eax*4 + 0x405a54]
mov dl, byte [edi + ebp + 0xa46]
mov al, byte [esi]
add al, dl
mov byte [esi], al
jmp case.default.0x405879
mov al, byte [edi + ebp + 0xa46]
imul byte [esi]
mov byte [esi], al
jmp case.default.0x405879
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa46]
cdq
idiv ebx
mov byte [esi], al
jmp case.default.0x405879
mov al, byte [edi + ebp + 0xa46]
mov dl, byte [esi]
xor dl, al
mov byte [esi], dl
mov bl, byte [esp + 0x10]
shr bl, 2
inc edi
mov byte [esp + 0x10], bl
cmp edi, 4
jl 0x40586d
inc esi
lea edx, [ecx + esi]
cmp edx, 7
jl 0x40585c
mov al, byte [ebp + 0xa3c]
test al, al
je 0x405969
mov ecx, 0xfffff5db
lea esi, [ebp + 0xa25]
sub ecx, ebp
mov al, byte [esi - 0x15]
xor edi, edi
mov byte [esi], al
mov dl, byte [ebp + 0xa40]
mov byte [esp + 0x10], dl
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x40590f
jmp dword [eax*4 + 0x405a64]
mov al, byte [edi + ebp + 0xa4a]
mov dl, byte [esi]
add dl, al
mov byte [esi], dl
jmp case.default.0x40590f
mov al, byte [edi + ebp + 0xa4a]
imul byte [esi]
jmp 0x40594d
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa4a]
cdq
idiv ebx
jmp 0x40594d
mov dl, byte [edi + ebp + 0xa4a]
mov al, byte [esi]
xor al, dl
mov byte [esi], al
mov bl, byte [esp + 0x10]
shr bl, 2
inc edi
mov byte [esp + 0x10], bl
cmp edi, 4
jl 0x405903
inc esi
lea eax, [ecx + esi]
cmp eax, 7
jl 0x4058f2
mov al, byte [ebp + 0xa3d]
test al, al
je 0x4059ff
mov ecx, 0xfffff5d4
lea esi, [ebp + 0xa2c]
sub ecx, ebp
mov dl, byte [esi - 0x1c]
xor edi, edi
mov byte [esi], dl
mov al, byte [ebp + 0xa41]
mov byte [esp + 0x10], al
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x4059a1
jmp dword [eax*4 + 0x405a74]
mov dl, byte [edi + ebp + 0xa4e]
mov al, byte [esi]
add al, dl
mov byte [esi], al
jmp case.default.0x4059a1
mov al, byte [edi + ebp + 0xa4e]
imul byte [esi]
mov byte [esi], al
jmp case.default.0x4059a1
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa4e]
cdq
idiv ebx
mov byte [esi], al
jmp case.default.0x4059a1
mov al, byte [edi + ebp + 0xa4e]
mov dl, byte [esi]
xor dl, al
mov byte [esi], dl
mov bl, byte [esp + 0x10]
shr bl, 2
inc edi
mov byte [esp + 0x10], bl
cmp edi, 4
jl 0x405995
inc esi
lea edx, [ecx + esi]
cmp edx, 7
jl 0x405984
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret