[OnePlus 9 Pro] djsubterrain:
1. To extract the image collection from your downloaded rom :

Download Payload Dumper from here (It's a zip file but it's not flashable) to your computer

Extract the zip file to a folder, make it a folder you can use regularly because this is the default tool you would use from now on

Download the rom version you want to root

Unzip the rom to a folder, you will find a file within it called payload.bin

Copy and paste that file into the "payload_input" folder within the Payload Dumper folder you created

Execute the payload_dumper.exe file within Payload Dumper folder, you will not have to specify any options as it always extracts from any payload.bin file in payload_input and outputs the image files to payload_output.

Leave the extraction to be completed, the program will automatically close itself once it's completed

Your extracted .img files will be shown within the payload_output folder

2. If you need to root the boot image you extracted :

Copy the boot.img file from the payload_output folder to a folder on your phone storage (Best to name it appropriately if you will be doing this regularly)

Download and Install the latest Magisk apk from the release site (Accept any prompt to allow install from external source)

Launch the app and then choose Install under the top "Magisk" section

Choose Select and Patch a File then browse to where you copied the boot.img on your storage

Magisk will then apply root to the boot image you specified, Your rooted image file will be output to your phone's Download folder : /sdcard/Download

You don't need to keep the default filename of the rooted image file so you can rename it appropriately for the rom version after you copy it to your computer, just ensure to keep the .img file extension

If you rename the rooted boot image, try not to use spaces in the filename, rather use _ or - as spaces make it more difficult to use in a command window although when you start typing the filename you can use TAB to autocomplete it, always ensure the filename shows .img as the extension and at the end of any commandline

3. If you need to use your rooted boot image to apply root to your phone :

Install the drivers from the mounted drive you should get when connecting the phone to your computer

On Windows you should then have a folder in C:\Program Files (x86)\OnePlus USB Drivers\Android with the platform tools (ADB.exe and Fastboot.exe) you will need, you can obviously copy the content from that folder somewhere else if you wish.

Connect your phone to your computer

Copy your rooted boot image to the folder that has adb.exe and fastboot.exe

Open a command window on your computer by right clicking in that folder and choosing Open command window here

In the command window, Type or copy/paste the command ADB devices and press enter

If you see a prompt on your phone to allow the computer connection then accept it, better still, tell it to allow from now on also.

You should see a string of characters shown in the command window, if you don't see that, then try another cable or re-install your drivers and reboot the computer.

Reboot your phone into Fastboot either by using ADB on your computer ( ADB Reboot Fastboot ) or by enabling Advanced reboot in your developer options in settings and then hold down the power button and use the 3 dot menu on the top right and choosing "Bootloader"

In the command window type Fastboot Boot <filename.img> i.e. Fastboot Boot rooted_boot.img and press enter

You should see a couple of lines in the command window telling you it's copying over to the phone, don't worry it's not being flashed or replacing your existing installed boot image

The phone should then restart and boot using the image from your computer, it will be a slightly slower boot than usual, your existing unlock method should still work

Launch the Magisk app, it should already have root access because the boot image you've used is already rooted

Go to Install under the top Magisk section

Choose Direct Install (Recommended)

Magisk will then apply root access to the boot image on the actual phone

You will be prompted to reboot the phone on the bottom right, do this to complete the process

You don't need the phone connected to your computer anymore as the installed boot image on the phone should now have root access

You can check for root either using any app which requires root or by using an app like Root Checker

Remember to empty the contents of payload_input and payload_output once you have finished, leaving them ready for any future rom versions

4. To retain root access after ROM/OTA update :

Install the update either from Oxygen Updater or from Settings > System > System updates

DO NOT REBOOT when prompted

Go to the Magisk app

Go to Install under the top Magisk section

Choose Install to Inactive Slot (After OTA)

Magisk will apply root to the newly installed boot image for the next version

Reboot when prompted by the Magisk app

The phone should reboot into the updated version with root already applied