Qualcomm Sahara / Firehose Attack Client / Diag Tools
(c) B. Kerler 2018-2021
Made By @Jacoa on Telegram

To make everything less problematic I recommend flashing the H93010f kdz then the stock rom of your choice via my AFH after unbricked

Prerequisite:
- Extract abl.img, laf.img, xbl.img from a files zip or bootloader zip for your model to the Files folder

Windows:
- Install Qualcomm_Diag_QD_Loader_2016_driver.exe from Drivers\Windows
- Boot device into 9008 mode (https://t.me/LGEV30/601417)
- Install UsbDk_1.0.22_x64.msi from Drivers\Windows
- Run Unbrick.bat

Linux:
# Debian/Ubuntu/Mint/etc
- sudo apt install adb fastboot python3-dev python3-pip liblzma-dev git
- sudo apt purge modemmanager
# Fedora/CentOS/etc
- sudo dnf install adb fastboot python3-devel python3-pip xz-devel git

- sudo systemctl stop ModemManager
- sudo systemctl disable ModemManager
- sudo apt purge ModemManager
- Cd to Ubrick folder
- sudo cp Drivers/51-edl.rules /etc/udev/rules.d
- sudo cp Drivers/50-android.rules /etc/udev/rules.d
- python setup.py build
- sudo python setup.py install
- Run "python edl.py qfil rawprogram.xml patch.xml Files --memory=ufs --loader=Loaders/0006b0e100310000_2cf7619a278d2607_fhprg_peek.bin

MacOS:
In bash run:
- brew install libusb git
- python setup.py build
- sudo python setup.py install
- cd <V30_Unbrick folder>
- python3 edl.py qfil rawprogram.xml patch.xml Files --memory=ufs --loader=Loaders/0006b0e100310000_2cf7619a278d2607_fhprg_peek.bin


Flash Command:

python edl.py qfil rawprogram.xml patch.xml Files --memory=ufs --loader=Loaders/0006b0e100310000_2cf7619a278d2607_fhprg_peek.bin

-> to write all files from "Files" folder to according partitions

Backup Commands:

Backup everything except userdata, system, and cache
python edl.py rl Backup --skip=userdata,system,cache --memory=ufs --loader=Loaders/0006b0e100310000_2cf7619a278d2607_fhprg_peek.bin

Backup everything
python edl.py rl Backup --memory=ufs --loader=Loaders/0006b0e100310000_2cf7619a278d2607_fhprg_peek.bin


All Commands:
edl.py printgpt --memory=ufs --lun=0" -> to print gpt on lun 0
edl.py printgpt --memory=ufs" -> to print gpt of all lun
edl.py rf lun0.bin --memory=ufs --lun=0" -> to dump whole lun 0
edl.py rf flash.bin --memory=ufs" -> to dump all luns as lun0_flash.bin, lun1_flash.bin, ...
edl.py rl dumps --memory=ufs --lun=0 --skip=userdata,vendor_a" -> to dump all partitions from lun0 to directory dumps for device with ufs and skip userdata and vendor_a partition
edl.py rl dumps --memory=ufs --genxml" -> to dump all partitions from all lun to directory dumps and write rawprogram[lun].xml
edl.py rs 0 15 data.bin --memory=ufs --lun=0" -> to dump 15 sectors from starting sector 0 from lun 0 to file data.bin
edl.py r boot_a boot.img --memory=ufs --lun=4" -> to dump the partition "boot_a" from lun 4 to the filename boot.img
edl.py r boot_a boot.img --memory=ufs" -> to dump the partition "boot_a" to the filename boot.img using lun autodetection
edl.py r boot_a,boot_b boot_a.img,boot_b.img --memory=ufs" -> to dump multiple partitions to multiple filenames
edl.py footer footer.bin --memory=ufs" -> to dump the crypto footer
edl.py w boot boot.img --memory=ufs --lun=4" -> to write boot.img to the "boot" partition on lun 4 on the device with ufs flash
edl.py wl dumps --memory=ufs --lun=0" -> to write all files from "dumps" folder to according partitions to flash lun 0
edl.py wl dumps --memory=ufs" -> to write all files from "dumps" folder to according partitions to flash and try to autodetect lun
edl.py wf dump.bin --memory=ufs --lun=0" -> to write the rawimage dump.bin to flash lun 0
edl.py e misc --memory=ufs --lun=0" -> to erase the partition misc on lun 0
edl.py gpt . --genxml --memory=ufs" -> dump gpt_main[lun].bin/gpt_backup[lun].bin and write rawpartition[lun].xml to current directory (".")