adb reboot bootloader
fastboot boot <downloaded Image.gz-dtb> <downloaded twrp.cpio.gz>
adb devices
adb exec-out "dd if=/dev/block/platform/soc/7824900.sdhci/by-name/ramdisk 2>/dev/null" > ramdisk.img
adb exec-out "dd if=/dev/block/platform/soc/7824900.sdhci/by-name/kernel 2>/dev/null" > kernel.img
adb exec-out "dd if=/dev/block/platform/soc/7824900.sdhci/by-name/recovery_ramdisk 2>/dev/null" > recovery_ramdisk.img
su
dd if=/dev/block/platform/soc/7824900.sdhci/by-name/system of=/sdcard/system.img
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/system system.img
adb reboot
adb reboot bootloader
fastboot flash ramdisk ramdisk.img
fastboot flash kernel kernel.img
fastboot flash recovery_ramdisk recovery_ramdisk.img
fastboot flash system system.img
fastboot reboot