Function at 0x40d540
Capabilities:
Terminate process

Disassembly:
sub esp, 0x16c
mov eax, dword [0x457a00]
xor eax, esp
mov dword [esp + 0x168], eax
push ebx
push ebp
mov ebp, dword [esp + 0x178]
push esi
push edi
push 0x11f
lea eax, [esp + 0x5d]
push 0
push eax
mov ebx, ecx
mov byte [esp + 0x64], 0
call fcn.00433570
add esp, 0xc
mov edi, str.flash
mov esi, ebx
mov ecx, 6
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
mov dword [esp + 0x34], str.amss
mov dword [esp + 0x38], str.appsboot
mov dword [esp + 0x3c], 0x44f20c
mov dword [esp + 0x40], str.oemsbl
mov dword [esp + 0x44], str.qcsbl
mov dword [esp + 0x48], 0x44f220
mov dword [esp + 0x4c], str.fsbl
mov dword [esp + 0x50], str.osbl
mov dword [esp + 0x54], str.pcsuite
mov dword [esp + 0x10], 1
mov dword [esp + 0x14], 2
mov dword [esp + 0x18], 4
mov dword [esp + 0x1c], 8
mov dword [esp + 0x20], 0x10
mov dword [esp + 0x24], 0x20
mov dword [esp + 0x28], 0x40
mov dword [esp + 0x2c], 0x80
mov dword [esp + 0x30], 0x100
je 0x40d680
mov edi, str.restore
mov esi, ebx
mov ecx, 8
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40d680
mov edi, str._atbmclrmru
mov esi, ebx
mov ecx, 0xc
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40d680
mov edi, str._backupwifi
mov esi, ebx
mov ecx, 0xc
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40d680
mov edi, str._checkversion
mov esi, ebx
mov ecx, 0xe
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40d680
push str.Invalid_operational_type._n
call fcn.004301ca
push str.Usage:_nflash__typeamssappsbootefsoemsblqcsbldblfsbl__n
call fcn.004301ca
add esp, 8
jmp 0x40d719
mov edi, str.flash
mov esi, ebx
mov ecx, 6
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d73c
mov dword [0x458e68], eax
push 9
lea edi, [esp + 0x5c]
mov ebx, 0x44d88c
mov eax, ebp
mov byte [0x45bd5e], 1
call fcn.00401430
add esp, 4
xor ebp, ebp
test eax, eax
jle 0x40d714
lea ecx, [ecx]
xor esi, esi
mov ecx, dword [esp + esi*4 + 0x34]
mov edx, edi
mov bl, byte [ecx]
cmp bl, byte [edx]
jne 0x40d6e8
test bl, bl
je 0x40d6e4
mov bl, byte [ecx + 1]
cmp bl, byte [edx + 1]
jne 0x40d6e8
add ecx, 2
add edx, 2
test bl, bl
jne 0x40d6c8
xor ecx, ecx
jmp 0x40d6ed
sbb ecx, ecx
sbb ecx, 0xffffffff
test ecx, ecx
je 0x40d6fb
add esi, 1
cmp esi, 9
jl 0x40d6c2
jmp 0x40d705
mov ecx, dword [esp + esi*4 + 0x10]
or dword [0x458e68], ecx
cmp esi, 9
je 0x40d732
add ebp, 1
add edi, 0x20
cmp ebp, eax
jl 0x40d6c0
call fcn.0040c670
mov ecx, dword [esp + 0x178]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0042fb8f
add esp, 0x16c
ret
push str.Invalid_flash_type.
jmp 0x40d669
xor edx, edx
mov edi, str._backupwifi
mov esi, ebx
mov ecx, 0xc
repe cmpsb byte [esi], byte es:[edi]
mov edi, str._atbmclrmru
lea ecx, [edx + 0xc]
jne 0x40d789
mov esi, ebp
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
mov byte [0x45be73], 1
jne 0x40d76e
mov byte [0x45bf04], 1
jmp 0x40d714
mov edi, str._checkversion
mov esi, ebp
mov ecx, 0xe
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d7f7
mov byte [0x45be71], 1
jmp 0x40d714
mov esi, ebx
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d7b6
mov edi, str._backupwifi
mov esi, ebp
mov ecx, 0xc
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
mov byte [0x45bf04], 1
jne 0x40d76e
mov byte [0x45be73], 1
jmp 0x40d714
mov edi, str._checkversion
mov esi, ebx
mov ecx, 0xe
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d819
mov edi, str._backupwifi
mov esi, ebp
mov ecx, 0xc
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
mov byte [0x45be71], 1
je 0x40d7aa
mov edi, str._atbmclrmru
mov esi, ebp
mov ecx, 0xc
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40d765
mov edi, str._downloadall
mov esi, ebp
mov ecx, 0xd
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d714
mov byte [0x45bf05], 1
jmp 0x40d714
mov edi, str._downloadall
mov esi, ebx
mov ecx, 0xd
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d880
mov edi, str._backupwifi
mov esi, ebp
mov ecx, 0xc
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
mov byte [0x45be71], 1
je 0x40d7aa
mov edi, str._atbmclrmru
mov esi, ebp
mov ecx, 0xc
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40d765
mov edi, str._checkversion
mov esi, ebp
mov ecx, 0xe
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d714
mov byte [0x45be71], 1
jmp 0x40d714
push 0x103
lea ecx, [esp + 0x5d]
push 0
push ecx
mov byte [esp + 0x64], 0
call fcn.00433570
lea edx, [esp + 0x64]
add esp, 0xc
mov byte [0x45bd5f], 1
mov eax, ebp
sub edx, ebp
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x40d8a8
lea edx, [esp + 0x58]
push 0x5c
push edx
call fcn.00431a10
add esp, 8
test eax, eax
jne 0x40d92a
mov esi, 0x45bb50
call fcn.00401520
mov edi, esi
add edi, 0xffffffff
lea eax, [edi + 1]
lea esp, [esp]
mov cl, byte [edi + 1]
add edi, 1
test cl, cl
jne 0x40d8e0
mov cx, word [0x44c6f4]
mov word [edi], cx
mov ecx, ebp
mov dl, byte [ebp]
add ebp, 1
test dl, dl
jne 0x40d8f6
sub ebp, ecx
add eax, 0xffffffff
mov esi, ecx
mov edi, eax
lea esp, [esp]
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x40d910
mov ecx, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40d93e
mov ecx, 0x45bb50
sub ecx, ebp
mov al, byte [ebp]
mov byte [ecx + ebp], al
add ebp, 1
test al, al
jne 0x40d931
mov eax, 0x45bb50
call fcn.00401fc0
test al, al
jne 0x40d714
push 0x45bb50
push str._s_is_not_exist.
call fcn.004301ca
add esp, 8
push 0
call fcn.00431368
int3