a. Latest QPST from qpstflash (sorry, can't post links yet. Just google it).
b. Magisk Manager
c. Stock L38041 rom. I used the global version from FirmwareX.
d. ADB and Fastboot tools.
This method uses Qualcomm flashing, so if you've never heard of that, read as much as you can before you try this.
1. Download and extract the ROM to your PC.
2. Attach your adb enabled device via usb and copy the boot.img file from the extracted folder to your device storage.
3. Install and open magisk manager on your device, then install magisk via 'patch stock boot image'. Navigate to where you put the stock boot.img and select it.
4. Once completed, take the patched_boot.img, rename it back to boot.img, and put it back in the extracted ROM folder on your PC. Make sure you've backed up your stock boot. because you'll be replacing it with the patched.
5. Install the QPST package on your PC and run QFIL. Select Flat build, then navigate the programmer path to your ROM folder. Select the prog_emmc_ufs_firehose_Sdm660_ddr.elf as your programmer path. Next, load XMLs RawProgram0.xml and patch0.xml.
6. At this point, run the adb command "adb reboot edl." This will put your device into emergency download mode, in which you will be able to use QFIL . QFIL should go from 'No Port' to 'Qualcomm HS-USB QDLoader 9008'. Immediately after you see this pop up, select 'Download'. This will completely reset your device.
7. If flashing was successful, wait a bit then boot your device. You should see a little warning complaining that the software has been altered. Wait a little bit more. You can install magisk manager at this point if it didn't show up after the flash. Reboot the device again.
8. Et voila, you should have a rooted device now. Due to the locked bootloader, you still can't (or at least I couldn't) use a custom recovery, were there even one available.
Note: if you get a sahara error in the flashing process, it's probably because you waited too long to hit download.
Hope this helps for those of you with rooting your K5 Pro
edit: There is a way to unlock the bootloader! User KiiKeEp has posted a guide on the method, which also contains a usable TWRP for the global rom. Here's a more streamlined version adapted from his tutorial. Make sure you have oem unlocking enabled in developer options.
1. Go to "zui.com/iunlock" and fill in the boxes.
a. First input your IMEI1 which can be found by dialing *#06# or going to the "about phone" section in the settings.
b. Second, input your phone's serial number. You can find this by enabling debugging in your developer options menu, then using the adb command "adb reboot bootloader"
c. Input your email into the third box.
d. Type the displayed 4 digit number into the 4th box and then submit.
2. You'll receive an email containing a download link for an unlock .img called "sn.img". Download it.
3. Flash the unlock image in fastboot. Use the command "fastboot flash unlock", drag and drop the sn.img into the command window, hit enter, then follow the onscreen command.
4. If this is done correctly, you can flash the twrp.img that KiiKeEp included in his post. "fastboot flash recovery twrp.img"