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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff34
mov dword [ebp - 0x7c], ecx
mov dword [ebp - 4], edx
mov dword [ebp - 0x78], eax
mov eax, 0x504730
call fcn.004c58b8
mov dword [ebp - 0x58], 1
lea edx, [ebp - 4]
lea eax, [ebp - 4]
call fcn.004d13b4
inc dword [ebp - 0x58]
mov word [ebp - 0x64], 8
mov byte [ebp - 0x89], 0
xor edx, edx
mov dword [ebp - 0x94], edx
cmp byte [0x50f408], 0
je 0x40fbdc
call fcn.00433e20
cmp byte [0x50f409], 0
je 0x40fbea
call fcn.00434268
call fcn.0042f6ec
mov ecx, dword [ebp - 0x78]
mov dword [ecx + 0x758], eax
push 0
call fcn.0042ff7c
pop ecx
mov word [ebp - 0x64], 0x14
lea eax, [ebp - 8]
call fcn.00401e94
mov ecx, eax
inc dword [ebp - 0x58]
mov edx, dword [ebp - 0x78]
mov eax, dword [edx + 0x758]
mov edx, 4
call fcn.004b0c1c
lea ecx, [ebp - 8]
push ecx
lea eax, [ebp - 0xc]
call fcn.00401e94
mov ecx, eax
inc dword [ebp - 0x58]
mov eax, str.Change_Status_from_0x
pop edx
call fcn.004d1884
lea ecx, [ebp - 0xc]
push ecx
lea eax, [ebp - 0x14]
call fcn.00401e94
push eax
inc dword [ebp - 0x58]
mov edx, str._to_0x0000
lea eax, [ebp - 0x10]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x10]
pop ecx
pop eax
call fcn.004d1534
lea edx, [ebp - 0x14]
push dword [edx]
push dword [ebp - 0x78]
call fcn.00425970
add esp, 8
dec dword [ebp - 0x58]
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.004d14dc
dec dword [ebp - 0x58]
lea eax, [ebp - 0x10]
mov edx, 2
call fcn.004d14dc
dec dword [ebp - 0x58]
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.004d14dc
dec dword [ebp - 0x58]
lea eax, [ebp - 8]
mov edx, 2
call fcn.004d14dc
mov word [ebp - 0x64], 0x20
mov edx, str.ATMEL
lea eax, [ebp - 0x18]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x18]
mov eax, 0x60c5f8
call fcn.004d15c0
test al, al
je 0x40fcfe
cmp byte [0x4e98ac], 0x2d
je 0x40fd02
cmp byte [0x4e98ac], 0x2e
je 0x40fd02
cmp byte [0x4e98ac], 0x2f
je 0x40fd02
xor ecx, ecx
jmp 0x40fd07
mov ecx, 1
push ecx
dec dword [ebp - 0x58]
lea eax, [ebp - 0x18]
mov edx, 2
call fcn.004d14dc
pop ecx
test cl, cl
je 0x40fd25
push 0
call fcn.0042ff7c
pop ecx
push 0x32
call sub.KERNEL32.DLL_Sleep
cmp byte [0x50f407], 0
je 0x40fd3e
mov byte [ebp - 0x8a], 0xc1
jmp 0x40fd45
mov byte [ebp - 0x8a], 0x81
xor eax, eax
mov dword [ebp - 0x88], eax
mov edx, dword [0x517da8]
mov eax, dword [edx]
call fcn.004675a4
cmp byte [0x4e98a8], 0
je 0x40fd86
xor eax, eax
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
call fcn.0042f6ec
xor ecx, ecx
mov cl, byte [ebp - 0x8a]
and eax, ecx
je 0x40fdb0
push 1
call sub.KERNEL32.DLL_Sleep
inc dword [ebp - 0x88]
cmp dword [ebp - 0x88], 0x7d0
jb 0x40fd4d
cmp dword [ebp - 0x88], 0x7d0
jne 0x40fe11
mov word [ebp - 0x64], 0x2c
mov edx, str.Write_Protect_cannt_be_disabled___
lea eax, [ebp - 0x1c]
call fcn.004d137c
inc dword [ebp - 0x58]
push dword [eax]
push 1
call fcn.004029e0
add esp, 8
dec dword [ebp - 0x58]
lea eax, [ebp - 0x1c]
mov edx, 2
call fcn.004d14dc
mov al, 1
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
mov word [ebp - 0x64], 0x38
lea eax, [ebp - 0x24]
call fcn.00401e94
push eax
inc dword [ebp - 0x58]
mov edx, 0x4ff274
lea eax, [ebp - 0x20]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x20]
lea eax, [ebp - 4]
pop ecx
call fcn.004d1534
lea edx, [ebp - 0x24]
mov edx, dword [edx]
mov eax, dword [ebp - 0x78]
call fcn.004ad63c
mov dword [ebp - 0x90], eax
dec dword [ebp - 0x58]
lea eax, [ebp - 0x24]
mov edx, 2
call fcn.004d14dc
dec dword [ebp - 0x58]
lea eax, [ebp - 0x20]
mov edx, 2
call fcn.004d14dc
mov ecx, dword [ebp - 0x78]
mov eax, dword [ecx + 0x4e8]
mov edx, dword [eax]
call dword [edx + 0xc4]
test al, al
je 0x40ffeb
mov ecx, dword [ebp - 0x78]
mov eax, dword [ecx + 0x67c]
mov edx, dword [eax]
call dword [edx + 0xc4]
test al, al
jne 0x40ffeb
push dword [ebp - 0x78]
call fcn.0042374c
pop ecx
test al, al
je 0x40feb8
call fcn.00430424
jmp 0x40ff21
call fcn.00430308
test al, al
jne 0x40ff21
mov word [ebp - 0x64], 0x44
mov edx, str.Chip_erase_fail_
lea eax, [ebp - 0x28]
call fcn.004d137c
inc dword [ebp - 0x58]
push dword [eax]
push 1
call fcn.004029e0
add esp, 8
dec dword [ebp - 0x58]
lea eax, [ebp - 0x28]
mov edx, 2
call fcn.004d14dc
mov byte [ebp - 0x89], 1
mov al, byte [ebp - 0x89]
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
call sub.KERNEL32.DLL_GetTickCount
mov dword [ebp - 0x94], eax
mov dword [ebp - 0x84], 0x30d40
xor ecx, ecx
mov dword [ebp - 0x88], ecx
mov eax, dword [ebp - 0x88]
cmp eax, dword [ebp - 0x84]
jae 0x40ffc5
mov edx, dword [0x517da8]
mov eax, dword [edx]
call fcn.004675a4
cmp byte [0x4e98a8], 0
je 0x40ff85
xor eax, eax
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
call fcn.0042f6ec
test al, 1
je 0x40ffc5
mov eax, dword [ebp - 0x88]
mov ecx, 0x64
xor edx, edx
div ecx
mov edx, eax
mov eax, dword [ebp - 0x90]
call fcn.0048efdc
push 1
call sub.KERNEL32.DLL_Sleep
inc dword [ebp - 0x88]
mov ecx, dword [ebp - 0x88]
cmp ecx, dword [ebp - 0x84]
jb 0x40ff4c
mov eax, dword [ebp - 0x88]
cmp eax, dword [ebp - 0x84]
jne 0x40ffdf
mov byte [ebp - 0x89], 1
jmp 0x410626
mov byte [ebp - 0x89], 0
jmp 0x410626
cmp byte [0x60c718], 0
je 0x410010
push dword [ebp + 8]
push dword [ebp - 0x7c]
push dword [ebp - 0x78]
call fcn.0042706c
add esp, 0xc
mov byte [ebp - 0x89], al
jmp 0x410626
mov byte [ebp - 0x95], 0
mov word [ebp - 0x64], 8
mov edx, dword [0x60c6ec]
add dword [ebp - 0x7c], edx
mov ecx, dword [0x60c6ec]
add dword [ebp + 8], ecx
cmp byte [0x4e98b0], 0x31
jne 0x41003d
call fcn.004304dc
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x9c], eax
xor edx, edx
mov dword [ebp - 0xa0], edx
xor ecx, ecx
mov dword [ebp - 0xa4], ecx
xor eax, eax
mov dword [ebp - 0xa8], eax
cmp dword [ebp - 0xa8], 0x1e
jle 0x41008a
xor eax, eax
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
mov byte [ebp - 0xa9], 0
mov word [ebp - 0x64], 8
xor ecx, ecx
mov dword [ebp - 0x88], ecx
mov eax, dword [0x517da8]
mov eax, dword [eax]
call fcn.004675a4
call fcn.004300b4
push 1
call sub.KERNEL32.DLL_Sleep
call fcn.0042f6ec
mov dword [ebp - 0xa4], eax
cmp byte [0x4e98a8], 0
je 0x4100ee
xor eax, eax
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
test byte [ebp - 0xa4], 1
jne 0x41010e
mov ecx, dword [ebp - 0xa4]
and ecx, 2
cmp ecx, 2
jne 0x41010e
mov byte [ebp - 0xa9], 1
jmp 0x41012b
push 1
call sub.KERNEL32.DLL_Sleep
inc dword [ebp - 0x88]
cmp dword [ebp - 0x88], 0x7d0
jb 0x41009f
cmp byte [ebp - 0xa9], 0
jne 0x41015e
mov byte [ebp - 0x89], 1
xor eax, eax
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
mov ecx, dword [ebp + 8]
sub ecx, dword [ebp - 0x7c]
inc ecx
cmp ecx, dword [0x60c6dc]
jb 0x41023f
mov ecx, dword [0x60c6dc]
mov edx, dword [ebp - 0x7c]
mov eax, dword [ebp - 0x78]
call fcn.0040faec
test al, al
jne 0x41023f
test dword [ebp - 0x7c], 0xffff
jne 0x41023f
push dword [ebp - 0x7c]
push dword [ebp - 0x78]
call fcn.00427aa8
add esp, 8
test al, al
jne 0x410231
push dword [ebp - 0x7c]
call fcn.00430528
pop ecx
test al, al
je 0x4101c7
mov eax, dword [0x60c6dc]
add dword [ebp - 0x7c], eax
jmp 0x4104c7
mov word [ebp - 0x64], 0x50
lea eax, [ebp - 0x30]
call fcn.00401e94
push eax
inc dword [ebp - 0x58]
lea eax, [ebp - 0x2c]
mov edx, dword [ebp - 0xa8]
call fcn.004d1498
mov edx, eax
inc dword [ebp - 0x58]
mov eax, str.block_erase_retryCnt
pop ecx
call fcn.004d1884
lea eax, [ebp - 0x30]
push dword [eax]
push 1
call fcn.004029e0
add esp, 8
dec dword [ebp - 0x58]
lea eax, [ebp - 0x30]
mov edx, 2
call fcn.004d14dc
dec dword [ebp - 0x58]
lea eax, [ebp - 0x2c]
mov edx, 2
call fcn.004d14dc
inc dword [ebp - 0xa8]
jmp 0x4104c7
mov ecx, dword [0x60c6dc]
add dword [ebp - 0x7c], ecx
jmp 0x410611
mov word [ebp - 0x64], 0x5c
mov edx, str.ATMEL
lea eax, [ebp - 0x34]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x34]
mov eax, 0x60c5f8
call fcn.004d15c0
test al, al
jne 0x4103b2
mov edx, 0x4e98fa
lea eax, [ebp - 0x38]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x38]
mov eax, 0x60c5f8
call fcn.004d15c0
test al, al
setne cl
and ecx, 1
push ecx
dec dword [ebp - 0x58]
lea eax, [ebp - 0x38]
mov edx, 2
call fcn.004d14dc
pop ecx
test ecx, ecx
jne 0x4103b2
mov eax, dword [ebp - 0x78]
mov eax, dword [eax + 0x4b0]
mov edx, dword [eax]
call dword [edx + 0xc4]
test al, al
jne 0x4103b2
mov edx, str.MX25L3205
lea eax, [ebp - 0x3c]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x3c]
mov eax, 0x60c5fc
call fcn.004d15c0
test al, al
setne cl
and ecx, 1
push ecx
dec dword [ebp - 0x58]
lea eax, [ebp - 0x3c]
mov edx, 2
call fcn.004d14dc
pop ecx
test ecx, ecx
jne 0x4103b2
mov edx, str.WIN25X16
lea eax, [ebp - 0x40]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x40]
mov eax, 0x60c5fc
call fcn.004d15c0
test al, al
setne cl
and ecx, 1
push ecx
dec dword [ebp - 0x58]
lea eax, [ebp - 0x40]
mov edx, 2
call fcn.004d14dc
pop ecx
test ecx, ecx
jne 0x4103b2
mov edx, str.WIN25X32
lea eax, [ebp - 0x44]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x44]
mov eax, 0x60c5fc
call fcn.004d15c0
test al, al
setne cl
and ecx, 1
push ecx
dec dword [ebp - 0x58]
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.004d14dc
pop ecx
test ecx, ecx
jne 0x4103b2
mov edx, str.WIN25X64
lea eax, [ebp - 0x48]
call fcn.004d137c
inc dword [ebp - 0x58]
lea edx, [ebp - 0x48]
mov eax, 0x60c5fc
call fcn.004d15c0
test al, al
setne cl
and ecx, 1
push ecx
dec dword [ebp - 0x58]
lea eax, [ebp - 0x48]
mov edx, 2
call fcn.004d14dc
pop ecx
test ecx, ecx
je 0x4103d0
mov ecx, dword [0x60c6dc]
mov edx, dword [ebp - 0x7c]
mov eax, dword [ebp - 0x78]
call fcn.0040faec
test al, al
jne 0x4103d0
test dword [ebp - 0x7c], 0xffff
je 0x4103d4
xor eax, eax
jmp 0x4103d9
mov eax, 1
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 0x34]
mov edx, 2
call fcn.004d14dc
pop ecx
test cl, cl
je 0x410425
push dword [ebp - 0x7c]
push dword [ebp - 0x78]
call fcn.00427aa8
add esp, 8
test al, al
jne 0x410417
push dword [ebp - 0x7c]
call fcn.00430528
pop ecx
mov eax, dword [0x60c6dc]
add dword [ebp - 0x7c], eax
jmp 0x4104c7
mov edx, dword [0x60c6dc]
add dword [ebp - 0x7c], edx
jmp 0x410611
mov byte [ebp - 0x95], 1
push dword [ebp - 0x7c]
push dword [ebp - 0x78]
call fcn.00427aa8
add esp, 8
test al, al
jne 0x4104bb
push dword [ebp - 0x7c]
call fcn.00430678
pop ecx
test al, al
je 0x410454
add dword [ebp - 0x7c], 0x1000
jmp 0x4104c7
mov word [ebp - 0x64], 0x68
lea eax, [ebp - 0x50]
call fcn.00401e94
push eax
inc dword [ebp - 0x58]
lea eax, [ebp - 0x4c]
mov edx, dword [ebp - 0xa8]
call fcn.004d1498
mov edx, eax
inc dword [ebp - 0x58]
mov eax, str.sector_erase_retryCnt
pop ecx
call fcn.004d1884
lea eax, [ebp - 0x50]
push dword [eax]
push 1
call fcn.004029e0
add esp, 8
dec dword [ebp - 0x58]
lea eax, [ebp - 0x50]
mov edx, 2
call fcn.004d14dc
dec dword [ebp - 0x58]
lea eax, [ebp - 0x4c]
mov edx, 2
call fcn.004d14dc
inc dword [ebp - 0xa8]
jmp 0x4104c7
add dword [ebp - 0x7c], 0x1000
jmp 0x410611
mov ecx, dword [ebp - 0x78]
mov eax, dword [ecx + 0x4b0]
mov edx, dword [eax]
call dword [edx + 0xc4]
test al, al
je 0x410532
mov ecx, dword [ebp - 0x7c]
sub ecx, dword [ebp - 0x9c]
mov dword [ebp - 0xb4], ecx
xor eax, eax
mov dword [ebp - 0xb0], eax
fild qword [ebp - 0xb4]
mov edx, dword [ebp + 8]
sub edx, dword [ebp - 0x9c]
mov dword [ebp - 0xbc], edx
xor ecx, ecx
mov dword [ebp - 0xb8], ecx
fild qword [ebp - 0xbc]
fdivp st(1)
fmul dword [0x410650]
call fcn.004ca030
mov edx, eax
mov eax, dword [ebp - 0x90]
call fcn.0048efdc
jmp 0x41057a
mov edx, dword [ebp - 0x7c]
mov dword [ebp - 0xc4], edx
xor ecx, ecx
mov dword [ebp - 0xc0], ecx
fild qword [ebp - 0xc4]
mov eax, dword [ebp + 8]
mov dword [ebp - 0xcc], eax
xor edx, edx
mov dword [ebp - 0xc8], edx
fild qword [ebp - 0xcc]
fdivp st(1)
fmul dword [0x410650]
call fcn.004ca030
mov edx, eax
mov eax, dword [ebp - 0x90]
call fcn.0048efdc
call sub.KERNEL32.DLL_GetTickCount
mov dword [ebp - 0x94], eax
xor edx, edx
mov dword [ebp - 0x88], edx
call fcn.0042f6ec
mov dword [ebp - 0xa4], eax
mov ecx, dword [0x517da8]
mov eax, dword [ecx]
call fcn.004675a4
cmp byte [0x4e98a8], 0
je 0x4105ce
xor eax, eax
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x410648
test byte [ebp - 0xa4], 2
jne 0x4105e0
test byte [ebp - 0xa4], 1
je 0x4105f9
push 1
call sub.KERNEL32.DLL_Sleep
inc dword [ebp - 0x88]
cmp dword [ebp - 0x88], 0x7d0
jb 0x41058d
cmp dword [ebp - 0x88], 0x7d0
jb 0x410609
mov cl, 1
jmp 0x41060b
xor ecx, ecx
mov byte [ebp - 0x89], cl
mov eax, dword [ebp - 0x7c]
cmp eax, dword [ebp + 8]
jae 0x410626
cmp byte [ebp - 0x89], 0
je 0x41005e
mov al, byte [ebp - 0x89]
push eax
dec dword [ebp - 0x58]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d14dc
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
mov esp, ebp
pop ebp
ret 4