Editing and Replacing videos in CyberPunk 2077 with RAD Video Tools
This wiki page is about the .bk2 file format used in the game, and how to edit them.
TL;DR
The .bk2 file format is used in many games including Cyberpunk 2077. It stands for Bink 2 By Rad Tools and needs to be used to extract and recompress the video that you want to replace.
Converting to back to .bk2 requires a byte offset for the video to appear in the game.
Searching in the asset browser for .bk2 files will get you every video in the game. For this tutorial we will be using the boxing video (q001_boxinggame.bk2)
Visit Viktor's RipperDoc, the boxing video consistently plays on his screen for easy testing.
import os
import glob
def modify_fourth_byte(file_path):
"""
Opens a file in read/write binary mode and overwrites
the 4th byte (index 3) with 0x6A.
"""
try:
# Print the filename as processing begins
print(f"Working on: '{file_path}'...", end=" ", flush=True)
# Check file size before opening
file_size = os.path.getsize(file_path)
if file_size < 4:
print(f"\nSkipping: File is only {file_size} bytes (needs at least 4).")
return
with open(file_path, "r+b") as f:
# Navigate to 4th byte (index 3) and overwrite
f.seek(3)
f.write(bytes([0x6A]))
print("Done (4th byte set to 0x6A).")
except PermissionError:
print(f"\nError: Permission denied for '{file_path}'.")
except Exception as e:
print(f"\nAn unexpected error occurred with '{file_path}': {e}")
def main():
# Use recursive glob pattern to find files in all subdirectories
# '**/*.bk2' tells glob to look in current and all sub-folders
bk2_files = glob.glob("**/*.bk2", recursive=True)
if not bk2_files:
print("No .bk2 files found in the current directory or subdirectories.")
return
print(f"Found {len(bk2_files)} file(s) across all directories. Starting processing...")
for file_path in bk2_files:
modify_fourth_byte(file_path)
print("-" * 30)
print("Batch processing complete.")
if __name__ == "__main__":
main()