Well. You can compute the width and height for square textures. It's a square root. I did it in bms with a full mip chain.
# mipratio: 1/1.333.. = *9/12 * rgba2blockratio: *6/3 -> nr_pixel -> sqrt + int rounding error
xmath square1 "(((fsize * 3) / 2) // 2) + 1"
xmath square5 "(fsize // 2) + 1"
You'd have to choose if you wanna compute full mip 1.3333 or partial and bit test the width/height for the max pow of 2.
Anyway: Did the table thingy with common sizes found in the archive. If you need more you can just add those below the
elif fsize == 327680
ofs = 65536 # skip the mip(s)
w = 512
h = 512
f = 5
Finding the mip offset may be a lil tricky, but is possible to approximatel get if you got a image viewer that supports raw 16-bit rgb.