Function at 0x403580
Capabilities:
Query environment variable

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x28
mov ebx, dword [ecx]
mov esi, dword [ecx + 4]
call fcn.00401320
dec ebx
mov dword [ebp - 0x28], ebx
je 0x4035d1
lea eax, [esi + 4]
mov edi, str.devices
mov dword [ebp - 0x24], eax
mov ecx, 8
mov ebx, dword [esi + 4]
cld
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4035e7
call fcn.00402c80
lea esp, [ebp - 0x10]
pop ecx
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
call fcn.00402a80
mov eax, 1
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
cld
mov edi, str.help
mov ecx, 5
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x403712
sub esp, 0xc
push str.ANDROID_SERIAL
call sub.msvcrt.dll_getenv
mov dword [0x4240a8], eax
mov eax, dword [ebp - 0x28]
add esp, 0x10
test eax, eax
jle 0x4036e6
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0x800
jmp 0x40365e
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x38], 1
dec eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x24]
add eax, 4
mov dword [ebp - 0x24], eax
mov edi, dword [ebp - 0x28]
test edi, edi
jle 0x4036c5
mov edx, dword [ebp - 0x24]
mov ecx, 3
cld
mov ebx, dword [edx]
mov edi, 0x41df06
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x403640
cld
mov edi, 0x41df09
mov ecx, 3
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403725
cmp dword [ebp - 0x28], 1
je 0x403856
push eax
push 0x10
push 0
mov ecx, dword [ebp - 0x24]
mov eax, dword [ecx + 4]
push eax
call sub.msvcrt.dll_strtoul
mov edi, dword [ebp - 0x28]
mov esi, dword [ebp - 0x24]
sub edi, 2
add esi, 8
mov dword [ebp - 0x28], edi
add esp, 0x10
mov edi, dword [ebp - 0x28]
mov dword [0x41c014], eax
mov dword [ebp - 0x24], esi
test edi, edi
jg 0x40365e
mov esi, dword [ebp - 0x38]
test esi, esi
jne 0x403819
mov edi, dword [ebp - 0x34]
test edi, edi
jne 0x40380f
mov esi, dword [ebp - 0x30]
test esi, esi
jne 0x4037c0
call fcn.00402ca0
sub esp, 0xc
mov dword [0x4240e8], eax
push eax
call fcn.004020d0
add esp, 0x10
test eax, eax
setne al
lea esp, [ebp - 0x10]
and eax, 0xff
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
call fcn.00402a80
lea esp, [ebp - 0x10]
pop ecx
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
cld
mov edi, 0x41df0c
mov ecx, 3
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403774
cmp dword [ebp - 0x28], 1
je 0x403856
push ebx
push 0
push 0
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + 4]
push ecx
call sub.msvcrt.dll_strtoul
add esp, 0x10
mov ebx, eax
test eax, eax
je 0x4037ae
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x24]
sub edx, 2
add eax, 8
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x2c], ebx
jmp 0x403657
cld
mov edi, 0x41df21
mov ecx, 3
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4037d9
cmp dword [ebp - 0x28], 1
je 0x403856
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 4]
mov dword [0x4240a8], eax
mov eax, dword [ebp - 0x28]
add edx, 8
sub eax, 2
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x28], eax
jmp 0x403657
sub esp, 0xc
push str.invalid_page_size
call fcn.00402d60
add esp, 0x10
jmp 0x40375a
push ebx
push ebx
push str.rebooting_into_bootloader
push str.reboot_bootloader
call fcn.00401970
add esp, 0x10
jmp 0x4036e6
cld
mov edi, 0x41df24
mov ecx, 3
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403865
cmp dword [ebp - 0x28], 1
je 0x403856
mov ecx, dword [ebp - 0x24]
mov eax, dword [ecx + 4]
add ecx, 8
mov dword [0x4240b8], eax
mov eax, dword [ebp - 0x28]
sub eax, 2
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], eax
jmp 0x403657
call fcn.00401990
jmp 0x4036e6
sub esp, 0xc
push str.userdata
call fcn.00402060
pop ecx
pop ebx
push 1
push str.userdata
call fcn.00402020
mov dword [esp], str.cache
call fcn.00402060
pop eax
pop edx
push 1
push str.cache
call fcn.00402020
add esp, 0x10
jmp 0x4036d0
call fcn.00402a80
sub esp, 0xc
push 1
call sub.msvcrt.dll_exit
cld
mov edi, 0x41df27
mov ecx, 3
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40388c
cmp dword [ebp - 0x28], 1
je 0x403856
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 4]
mov dword [0x4240c8], eax
jmp 0x40379a
cld
mov edi, 0x41df2a
mov ecx, 3
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40390c
mov dword [ebp - 0x18], 0
cmp dword [ebp - 0x28], 1
je 0x403856
lea ecx, [ebp - 0x18]
mov esi, dword [ebp - 0x24]
push eax
push 0
push ecx
add esi, 4
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 4]
push eax
call sub.msvcrt.dll_strtoul
mov ebx, eax
mov eax, dword [ebp - 0x18]
add esp, 0x10
test eax, eax
je 0x4038dc
cmp byte [eax], 0
jne 0x4038dc
test ebx, 0xffff0000
je 0x4038ee
push edi
push edi
mov esi, dword [esi]
push esi
push str.invalid_vendor_id__s
call fcn.00402d60
add esp, 0x10
mov ecx, dword [ebp - 0x24]
mov word [0x4240d8], bx
mov ebx, dword [ebp - 0x28]
add ecx, 8
sub ebx, 2
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], ebx
jmp 0x403657
cld
mov edi, str.getvar
mov ecx, 7
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403950
cmp dword [ebp - 0x28], 1
je 0x403856
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 4]
push edx
push edx
push eax
push eax
call fcn.00401a40
mov eax, dword [ebp - 0x28]
add esp, 0x10
sub eax, 2
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x24]
add eax, 8
mov dword [ebp - 0x24], eax
jmp 0x403657
cld
mov edi, str.erase
mov ecx, 6
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40397c
cmp dword [ebp - 0x28], 1
je 0x403856
mov ecx, dword [ebp - 0x24]
sub esp, 0xc
mov eax, dword [ecx + 4]
push eax
call fcn.00402060
jmp 0x403936
cld
mov edi, str.format
mov ecx, 7
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4039c1
cmp dword [ebp - 0x28], 1
je 0x403856
push edi
push edi
push 0
mov eax, dword [ebp - 0x24]
mov esi, dword [eax + 4]
push esi
call fcn.00402020
mov ebx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
sub ebx, 2
add ecx, 8
add esp, 0x10
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ecx
jmp 0x403657
cld
mov edi, str.signature
mov ecx, 0xa
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403a65
cmp dword [ebp - 0x28], 1
je 0x403856
push edx
push edx
lea edx, [ebp - 0x14]
push edx
mov ecx, dword [ebp - 0x24]
mov eax, dword [ecx + 4]
push eax
call fcn.00404390
add esp, 0x10
mov ebx, eax
test eax, eax
jne 0x403a11
push eax
push eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 4]
push eax
push str.could_not_load__s
call fcn.00402d60
add esp, 0x10
cmp dword [ebp - 0x14], 0x100
je 0x403a2a
sub esp, 0xc
push str.signature_must_be_256_bytes
call fcn.00402d60
add esp, 0x10
push eax
mov eax, dword [ebp - 0x14]
push eax
push ebx
push str.signature
call fcn.00401ee0
pop edi
pop eax
push str.installing_signature
push str.signature
call fcn.00401970
mov esi, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x24]
sub esi, 2
add ebx, 8
add esp, 0x10
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x24], ebx
jmp 0x403657
cld
mov edi, str.reboot
mov ecx, 7
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403a92
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
dec ecx
add edx, 4
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x34], 1
jmp 0x403657
cld
mov edi, str.reboot_bootloader
mov ecx, 0x12
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403abf
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x30], 1
dec eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x24]
add eax, 4
mov dword [ebp - 0x24], eax
jmp 0x403657
cld
mov edi, str.continue
mov ecx, 9
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403af9
push eax
push eax
push str.resuming_boot
push str.continue
call fcn.00401970
mov eax, dword [ebp - 0x28]
dec eax
add esp, 0x10
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x24]
add eax, 4
mov dword [ebp - 0x24], eax
jmp 0x403657
cld
mov edi, str.boot
mov ecx, 5
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403b6d
mov eax, dword [ebp - 0x24]
add eax, 4
dec dword [ebp - 0x28]
mov dword [ebp - 0x24], eax
jne 0x403cf6
xor eax, eax
xor edx, edx
sub esp, 0xc
mov esi, dword [0x4240c8]
lea ecx, [ebp - 0x14]
push esi
push ecx
push eax
push edx
mov ebx, dword [ebp - 0x2c]
push ebx
call fcn.00402ab0
add esp, 0x20
test eax, eax
je 0x403cef
push ecx
mov edx, dword [ebp - 0x14]
push edx
push eax
push str.boot.img
call fcn.00401ee0
pop edi
pop eax
push str.booting
push str.boot
call fcn.00401970
add esp, 0x10
jmp 0x403657
cld
mov edi, str.flash
mov ecx, 6
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403c20
mov eax, dword [ebp - 0x24]
cmp dword [ebp - 0x28], 1
mov edi, dword [eax + 4]
je 0x403856
cmp dword [ebp - 0x28], 2
je 0x403bfa
mov edx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x28]
sub esi, 3
mov ebx, dword [edx + 8]
add edx, 0xc
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x24], edx
test ebx, ebx
jne 0x403bc1
push eax
push eax
push edi
push str.cannot_determine_image_filename_for__s
call fcn.00402d60
add esp, 0x10
lea ecx, [ebp - 0x14]
push eax
push eax
push ecx
push ebx
call fcn.00404390
add esp, 0x10
mov esi, eax
test eax, eax
jne 0x403be6
push eax
push eax
push ebx
push str.cannot_load__s_n
call fcn.00402d60
add esp, 0x10
push eax
mov eax, dword [ebp - 0x14]
push eax
push esi
push edi
call fcn.00401fb0
add esp, 0x10
jmp 0x403657
push ecx
push ecx
mov edx, dword [0x4240b8]
push edx
push edi
call fcn.00403240
add esp, 0x10
mov ebx, eax
mov eax, dword [ebp - 0x24]
add eax, 8
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], eax
jmp 0x403bad
cld
mov edi, str.flash:raw
mov ecx, 0xa
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403cbd
mov eax, dword [ebp - 0x24]
cmp dword [ebp - 0x28], 2
mov esi, dword [eax + 4]
mov edx, dword [eax + 8]
jle 0x403856
cmp dword [ebp - 0x28], 3
je 0x403ca9
mov ecx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x28]
sub edi, 4
mov eax, dword [ecx + 0xc]
add ecx, 0x10
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], ecx
sub esp, 0xc
mov ecx, dword [0x4240c8]
push ecx
lea ecx, [ebp - 0x14]
push ecx
push eax
push edx
mov eax, dword [ebp - 0x2c]
push eax
call fcn.00402ab0
add esp, 0x20
mov ebx, eax
test eax, eax
jne 0x403c95
sub esp, 0xc
push str.cannot_load_bootable_image
call fcn.00402d60
add esp, 0x10
push eax
mov edi, dword [ebp - 0x14]
push edi
push ebx
push esi
call fcn.00401fb0
add esp, 0x10
jmp 0x403657
mov ebx, dword [ebp - 0x24]
xor eax, eax
add ebx, 0xc
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], ebx
jmp 0x403c63
cld
mov edi, str.flashall
mov ecx, 9
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403d0d
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
dec ecx
add edx, 4
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], edx
call fcn.004033e0
mov dword [ebp - 0x34], 1
jmp 0x403657
mov al, 1
jmp 0x4035db
mov ecx, dword [ebp - 0x24]
mov edx, dword [ecx]
add ecx, 4
dec dword [ebp - 0x28]
mov dword [ebp - 0x24], ecx
jne 0x403d54
xor eax, eax
jmp 0x403b20
cld
mov edi, str.update
mov ecx, 7
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403d87
cmp dword [ebp - 0x28], 1
je 0x403d6b
mov eax, dword [ebp - 0x24]
sub esp, 0xc
mov eax, dword [eax + 4]
push eax
call fcn.00403040
mov eax, dword [ebp - 0x28]
add esp, 0x10
sub eax, 2
mov dword [ebp - 0x34], 1
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x24]
add eax, 8
mov dword [ebp - 0x24], eax
jmp 0x403657
mov ecx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x28]
dec edi
mov eax, dword [ecx]
add ecx, 4
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], ecx
jmp 0x403b20
sub esp, 0xc
push str.update.zip
call fcn.00403040
add esp, 0x10
mov dword [ebp - 0x34], 1
jmp 0x4036c5
cld
mov edi, 0x41e031
mov ecx, 4
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4035d1
push eax
push eax
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x28]
push eax
call fcn.004026f0
add esp, 0x10
mov dword [ebp - 0x28], eax
jmp 0x403657