dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot.img Using MSM Download Tool : For devices like OnePlus or Oppo, you can use the MSM Download Tool
Modifying boot images and flashing device firmware can brick your device if done incorrectly. Always ensure you're modifying and flashing the correct images for your device. bootemmcwin to bootimg extra quality
Do not just extract the files. You need to mount the EMMC image with write access to clean it. dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot