I don't know the format of payload.bin, and if it is exctractable in streaming mode or not, but if at all possible, it would be nice to extract e.g. boot.img without needing to extract gigabytes worth of payload.bin as a temporary file just to extract a (potentially) small partition.