How to flash custom ROM together with modem and bootloader without odin or heimdal?
Important note: Hey guys, thanks for the upvotes but this answer turned out  to not work at all.

The steps below don't break anything and this is why I thought I flashed modem/bootloader. You can use dd to make backups of the partitions below by swapping of/if but modem/bootloader won't be modified by the code I've posted..

In the end I had to fiddle with heimdall and boot the phone in download mode to actually flash the partitions.



Original answer:

In case anyone else wants to flash Bootloader/Modem and heimdall/fastboot/odin is not an option - this worked for me:

Extract/copy the files you need somewhere on your phone - e.g. with adb push ./bl_modem/ /mnt/extSdCard/, start a su-shell:

adb shell
&gt; su
&gt; cd /mnt/extSdCard/bl_modem/


then just flash the files with dd:

&gt; dd if=NON-HLOS.bin  of=/dev/block/mmcblk0p1
&gt; dd if=modem.bin     of=/dev/block/mmcblk0p2
&gt; dd if=sbl1.mbn      of=/dev/block/mmcblk0p3
&gt; dd if=sdi.mbn       of=/dev/block/mmcblk0p5
&gt; dd if=aboot.mbn     of=/dev/block/mmcblk0p7
&gt; dd if=rpm.mbn       of=/dev/block/mmcblk0p8
&gt; dd if=tz.mbn        of=/dev/block/mmcblk0p9


Important: the provided block device names only apply to Note4/N910F. Have a look at the links at /dev/block/platform/msm_sdcc.1/by-name/ to find out yours.

I double checked these names by first making a copy with dd and comparing sizes. The sizes won't be equal to the sizes of the files you're going to flash but they should be about similar size.