Function at 0x40b460
Capabilities:
Check for time delay via gettickcount
Encrypt data using speck

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, 0x490c54
jne 0x40b491
mov eax, str.Erasing_MCU_flash_...
push eax
push ebp
call fcn.00406ea0
mov eax, dword [ebp + 0xf8]
add esp, 8
shl eax, 5
mov esi, 4
mov ecx, dword [eax + 0x46cc88]
shr ecx, 0xb
and ecx, 0xff
lea eax, [ecx - 1]
mov ecx, 0x72
cmp eax, 0x1b
ja case.0x40b4d1.5
xor edx, edx
mov dl, byte [eax + 0x40bdb8]
jmp dword [edx*4 + 0x40bda4]
mov byte [ebp + 0xca0], 0x46
mov byte [ebp + 0xca1], 0xb9
cmp dword [ebp + 0x14c], ecx
jge 0x40b6ef
push 1
push 0
mov ecx, ebp
call fcn.00411f30
add eax, 0x1ff
lea esi, [ebp + 0x644]
cdq
and edx, 0x1ff
push 8
add eax, edx
push esi
sar eax, 9
mov byte [ebp + 0x645], al
mov al, 0x33
mov ecx, ebp
mov byte [esi], 0x84
mov byte [ebp + 0x646], al
mov byte [ebp + 0x647], al
mov byte [ebp + 0x648], al
mov byte [ebp + 0x649], al
mov byte [ebp + 0x64a], al
mov byte [ebp + 0x64b], al
call fcn.00407470
push 0x61a8
jmp 0x40b93f
mov byte [ebp + 0xca0], 0x46
mov byte [ebp + 0xca1], 0xb9
cmp dword [ebp + 0x14c], ecx
jge 0x40b6ef
push 1
push 0
mov ecx, ebp
call fcn.00411f30
lea esi, [ebp + 0x644]
mov byte [ebp + 0x645], 0
mov byte [esi], 0x84
mov ecx, dword [ebp + 0xf8]
shl ecx, 5
mov edx, dword [ecx + 0x46cc94]
lea ecx, [ecx + 0x46cc94]
cmp eax, edx
jae 0x40b5c3
shr edx, 0x10
mov byte [ebp + 0x646], dl
xor edx, edx
mov dl, byte [ecx + 1]
mov byte [ebp + 0x647], dl
mov al, byte [ecx]
mov byte [ebp + 0x648], al
jmp 0x40b5f6
add eax, 0x1ff
mov byte [ebp + 0x648], 0
cdq
and edx, 0x1ff
add eax, edx
sar eax, 9
mov edx, eax
shl edx, 9
shr edx, 0x10
mov byte [ebp + 0x646], dl
shl eax, 9
xor edx, edx
mov dl, ah
mov byte [ebp + 0x647], dl
mov eax, dword [ecx]
xor edx, edx
shr eax, 0x10
mov byte [ebp + 0x649], al
mov dl, byte [ecx + 1]
mov byte [ebp + 0x64a], dl
mov al, byte [ecx]
lea edx, [ebp + 0x64c]
xor ecx, ecx
mov byte [ebp + 0x64b], 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 + 0x657], cl
inc eax
cmp eax, 0x73
jl 0x40b62a
push 0x86
jmp 0x40b932
cmp dword [ebp + 0x14c], 0x71
jge case.0x40b4d1.5
push 1
push 0
mov ecx, ebp
call fcn.00411f30
mov edx, eax
lea esi, [ebp + 0x644]
shr edx, 0x10
mov byte [esi], 0x84
mov byte [ebp + 0x646], dl
mov edx, dword [ebp + 0xf8]
xor ecx, ecx
shl edx, 5
mov cl, ah
mov byte [ebp + 0x648], al
lea eax, [edx + 0x46cc94]
mov byte [ebp + 0x645], 0xff
mov byte [ebp + 0x647], cl
xor edx, edx
mov ecx, dword [eax]
shr ecx, 0x10
mov byte [ebp + 0x649], cl
mov dl, byte [eax + 1]
mov byte [ebp + 0x64a], dl
mov al, byte [eax]
lea edx, [ebp + 0x64c]
xor ecx, ecx
mov byte [ebp + 0x64b], 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 + 0x657], cl
inc eax
cmp eax, 0x22
jl 0x40b6cb
push 0x35
jmp 0x40b932
cmp dword [ebp + 0x14c], ecx
jl 0x40b872
cmp dword [ebp + 0x170], esi
je 0x40b80e
mov ecx, dword [ebp + 0xa98]
lea ebx, [ebp + 0x644]
lea esi, [ebp + 0xaa0]
lea edi, [ebp + 0x649]
mov byte [ebx], 5
mov dl, byte [ebp + 0xca0]
mov al, byte [ebp + 0xca1]
mov byte [ebp + 0x647], dl
mov edx, ecx
mov byte [ebp + 0x645], 0
shr ecx, 2
mov byte [ebp + 0x646], 0
mov byte [ebp + 0x648], 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 + 0xa98]
mov ecx, ebp
add eax, 5
push eax
push ebx
call fcn.00407470
push 0x7d0
mov ecx, ebp
call fcn.004077c0
push 1
push 0
mov ecx, ebp
call fcn.00407560
mov al, byte [ebp + 0x17]
test al, al
je 0x40b979
mov ecx, ebp
call fcn.004077e0
test al, al
jne 0x40b986
lea ecx, [ebp + 0x244]
push 1
push ecx
mov ecx, ebp
call fcn.00407560
test al, al
je 0x40b773
mov dl, byte [ebx]
mov al, byte [ebp + 0x244]
and dl, 0xf
cmp al, dl
je 0x40b806
cmp al, 0xe
jne 0x40b7d2
mov eax, dword [ebp + 0xb4]
test eax, eax
mov eax, 0x490c28
jne 0x40b7c8
mov eax, str._r_nUser_password_error___r_n
push eax
push ebp
call fcn.00406ea0
add esp, 8
cmp byte [ebp + 0x244], 0xf
jne 0x40b7f9
mov eax, dword [ebp + 0xb4]
test eax, eax
mov eax, 0x490be0
jne 0x40b7ef
mov eax, str._r_nMCU_is_locked___r_n
push eax
push ebp
call fcn.00406ea0
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 + 0x644]
push 1
push 0
mov byte [ebp + 0x645], 0
mov byte [esi], 3
mov cl, byte [ebp + 0xca1]
mov al, byte [ebp + 0xca0]
mov byte [ebp + 0x648], cl
mov ecx, ebp
mov byte [ebp + 0x646], 0
mov byte [ebp + 0x647], al
call fcn.00411f30
mov edx, dword [ebp + 0xf8]
shl edx, 5
mov ecx, dword [edx + 0x46cc94]
cmp eax, ecx
jle 0x40b86b
sub eax, ecx
add eax, 0x1ff
shr eax, 9
mov byte [ebp + 0x645], al
push 5
jmp 0x40b932
cmp dword [ebp + 0x170], esi
je 0x40b8f2
lea esi, [ebp + 0x644]
push 1
push esi
mov ecx, ebp
mov byte [esi], 5
call fcn.00407470
push 0x7d0
mov ecx, ebp
call fcn.004077c0
push 1
push 0
mov ecx, ebp
call fcn.00407560
mov al, byte [ebp + 0x17]
test al, al
je 0x40b979
mov ecx, ebp
call fcn.004077e0
test al, al
jne 0x40b986
lea eax, [ebp + 0x244]
push 1
push eax
mov ecx, ebp
call fcn.00407560
test al, al
je 0x40b8a4
mov cl, byte [esi]
mov al, byte [ebp + 0x244]
and cl, 0xf
cmp al, cl
je 0x40b8ee
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
push 0xa
call edi
lea esi, [ebp + 0x644]
push 1
push 0
mov ecx, ebp
mov byte [esi], 3
mov byte [ebp + 0x645], 0
call fcn.00411f30
mov edx, dword [ebp + 0xf8]
shl edx, 5
mov ecx, dword [edx + 0x46cc94]
cmp eax, ecx
jle 0x40b930
sub eax, ecx
add eax, 0x1ff
shr eax, 9
mov byte [ebp + 0x645], al
push 2
push esi
mov ecx, ebp
call fcn.00407470
push 0x3a98
mov ecx, ebp
call fcn.004077c0
push 1
push 0
mov ecx, ebp
call fcn.00407560
mov al, byte [ebp + 0x17]
test al, al
je 0x40b979
mov ecx, ebp
call fcn.004077e0
test al, al
jne 0x40b986
lea eax, [ebp + 0x244]
push 1
push eax
mov ecx, ebp
call fcn.00407560
test al, al
jne 0x40b993
jmp 0x40b951
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 + 0xa44]
lea ecx, [ebp + 0x245]
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 + 0x14c]
mov cl, byte [ecx + 6]
cmp eax, 0x62
mov byte [edx + 6], cl
jg 0x40b9d8
lea edx, [ebp + 0x1df]
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 + 0x170]
test eax, eax
jne 0x40b9f8
cmp byte [ebp + 0x244], 0x80
je 0x40ba49
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
cmp eax, 3
jl 0x40ba32
mov al, byte [esi]
mov cl, byte [ebp + 0x244]
and al, 0xf
cmp cl, al
jne 0x40ba3c
mov al, byte [ebp + 0x23]
test al, al
je 0x40ba49
mov ecx, 7
mov edi, ebx
lea esi, [ebp + 0xa67]
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40ba49
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
mov al, byte [ebp + 0x244]
test al, al
je 0x40ba49
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret
mov eax, dword [ebp + 0xb4]
mov esi, 0x490bb8
test eax, eax
jne 0x40ba5d
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 [0x47505c]
fstp qword [esp]
push esi
push ebp
call fcn.00406ea0
mov eax, dword [ebp + 0xf8]
add esp, 0x10
shl eax, 5
mov ecx, dword [eax + 0x46cc88]
and ecx, 0x7f800
cmp ecx, 0x3800
jbe 0x40bd97
mov al, byte [ebx]
mov cl, byte [ebp + 0xa45]
cmp al, cl
jne 0x40bae8
cmp al, byte [ebp + 0xa46]
jne 0x40bae8
cmp al, byte [ebp + 0xa47]
jne 0x40bae8
cmp al, byte [ebp + 0xa48]
jne 0x40bae8
cmp al, byte [ebp + 0xa49]
jne 0x40bae8
cmp al, byte [ebp + 0xa4a]
je 0x40bd97
mov dl, byte [ebp + 0x2d]
test dl, dl
jne 0x40bb47
mov edx, dword [ebp + 0xb4]
mov esi, 0x490b78
test edx, edx
jne 0x40bb03
mov esi, str.MCU_ID_:__02X_02X_02X_02X_02X_02X_02X_r_n
xor edx, edx
and ecx, 0xff
mov dl, byte [ebp + 0xa4a]
and eax, 0xff
push edx
xor edx, edx
mov dl, byte [ebp + 0xa49]
push edx
xor edx, edx
mov dl, byte [ebp + 0xa48]
push edx
xor edx, edx
mov dl, byte [ebp + 0xa47]
push edx
xor edx, edx
mov dl, byte [ebp + 0xa46]
push edx
push ecx
push eax
push esi
push ebp
call fcn.00406ea0
add esp, 0x24
mov al, byte [ebp + 0xa6e]
test al, al
je 0x40bbd9
mov ecx, 0xfffff5b5
lea esi, [ebp + 0xa4b]
sub ecx, ebp
mov al, byte [esi - 7]
xor edi, edi
mov byte [esi], al
mov dl, byte [ebp + 0xa72]
mov byte [esp + 0x10], dl
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x40bb7f
jmp dword [eax*4 + 0x40bdd4]
mov al, byte [edi + ebp + 0xa76]
mov dl, byte [esi]
add dl, al
mov byte [esi], dl
jmp case.default.0x40bb7f
mov al, byte [edi + ebp + 0xa76]
imul byte [esi]
jmp 0x40bbbd
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa76]
cdq
idiv ebx
jmp 0x40bbbd
mov dl, byte [edi + ebp + 0xa76]
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 0x40bb73
inc esi
lea eax, [ecx + esi]
cmp eax, 7
jl 0x40bb62
mov al, byte [ebp + 0xa6f]
test al, al
je 0x40bc6f
mov ecx, 0xfffff5ae
lea esi, [ebp + 0xa52]
sub ecx, ebp
mov dl, byte [esi - 0xe]
xor edi, edi
mov byte [esi], dl
mov al, byte [ebp + 0xa73]
mov byte [esp + 0x10], al
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x40bc11
jmp dword [eax*4 + 0x40bde4]
mov dl, byte [edi + ebp + 0xa7a]
mov al, byte [esi]
add al, dl
mov byte [esi], al
jmp case.default.0x40bc11
mov al, byte [edi + ebp + 0xa7a]
imul byte [esi]
mov byte [esi], al
jmp case.default.0x40bc11
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa7a]
cdq
idiv ebx
mov byte [esi], al
jmp case.default.0x40bc11
mov al, byte [edi + ebp + 0xa7a]
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 0x40bc05
inc esi
lea edx, [ecx + esi]
cmp edx, 7
jl 0x40bbf4
mov al, byte [ebp + 0xa70]
test al, al
je 0x40bd01
mov ecx, 0xfffff5a7
lea esi, [ebp + 0xa59]
sub ecx, ebp
mov al, byte [esi - 0x15]
xor edi, edi
mov byte [esi], al
mov dl, byte [ebp + 0xa74]
mov byte [esp + 0x10], dl
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x40bca7
jmp dword [eax*4 + 0x40bdf4]
mov al, byte [edi + ebp + 0xa7e]
mov dl, byte [esi]
add dl, al
mov byte [esi], dl
jmp case.default.0x40bca7
mov al, byte [edi + ebp + 0xa7e]
imul byte [esi]
jmp 0x40bce5
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa7e]
cdq
idiv ebx
jmp 0x40bce5
mov dl, byte [edi + ebp + 0xa7e]
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 0x40bc9b
inc esi
lea eax, [ecx + esi]
cmp eax, 7
jl 0x40bc8a
mov al, byte [ebp + 0xa71]
test al, al
je 0x40bd97
mov ecx, 0xfffff5a0
lea esi, [ebp + 0xa60]
sub ecx, ebp
mov dl, byte [esi - 0x1c]
xor edi, edi
mov byte [esi], dl
mov al, byte [ebp + 0xa75]
mov byte [esp + 0x10], al
mov eax, dword [esp + 0x10]
and eax, 3
cmp eax, 3
ja case.default.0x40bd39
jmp dword [eax*4 + 0x40be04]
mov dl, byte [edi + ebp + 0xa82]
mov al, byte [esi]
add al, dl
mov byte [esi], al
jmp case.default.0x40bd39
mov al, byte [edi + ebp + 0xa82]
imul byte [esi]
mov byte [esi], al
jmp case.default.0x40bd39
xor eax, eax
xor ebx, ebx
mov al, byte [esi]
mov bl, byte [edi + ebp + 0xa82]
cdq
idiv ebx
mov byte [esi], al
jmp case.default.0x40bd39
mov al, byte [edi + ebp + 0xa82]
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 0x40bd2d
inc esi
lea edx, [ecx + esi]
cmp edx, 7
jl 0x40bd1c
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret