I've been trying to extract files from the first partition of the following image (talking about the img file, not the xz archive that it is inside):
https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.5-preinstalled-server-armhf+raspi.img.xz
However, this has been unsuccessful:
PS D:\> 7z l .\ubuntu-22.04.5-preinstalled-server-armhf+raspi.img
7-Zip 26.01 (x64) : Copyright (c) 1999-2026 Igor Pavlov : 2026-04-27
Scanning the drive for archives:
1 file, 4363124736 bytes (4161 MiB)
Listing archive: .\ubuntu-22.04.5-preinstalled-server-armhf+raspi.img
ERROR: .\ubuntu-22.04.5-preinstalled-server-armhf+raspi.img : Cannot open the file as archive
Errors: 1
Further inspection of the file reveals that the CHS Addresses (highlighted in red) for the partitions are set to 0:

However, the LBA of partition start (highlighted in green) and number of sectors in partition (highlighted in purple) are set which is enough to know where the partitions are. I believe that tools that work on partitions generally ignore the CHS values and use the LBA ones since the max values allowed by CHS are pretty limiting.
For comparision, if I manually edit the CHS addresses in the file to use correct values as shown on the image below, 7z manages to see the partitions and extract what I need:

PS D:\> 7z l .\ubuntu-22.04.5-preinstalled-server-armhf+raspi-modified.img
7-Zip 26.01 (x64) : Copyright (c) 1999-2026 Igor Pavlov : 2026-04-27
Scanning the drive for archives:
1 file, 4363124736 bytes (4161 MiB)
Listing archive: .\ubuntu-22.04.5-preinstalled-server-armhf+raspi-modified.img
--
Path = .\ubuntu-22.04.5-preinstalled-server-armhf+raspi-modified.img
Type = MBR
Physical Size = 4363124736
Sector Size = 512
ID = 699253995
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
..... 536870912 536870912 0.fat
..... 3807518720 3807518720 1.img
..... 17686528 17686528 2
------------------- ----- ------------ ------------ ------------------------
4362076160 4362076160 3 files
It would be great, if 7z could parse these sort of images considering that the LBA is there.
If you're viewing directly on the SourceForge site, please note that the markdown preview is cutting off parts of the image - you'll need to open it in a new tab to see it in its whole.