I have a file that contains an embedded file that is compressed using zlib.
I know where the compressed file starts within the main file and I have the decompressed file size, but don't know where the compressed file ends.
My goal is to extract the compressed file from its containing file and save it as its own file.
Given the start location of the compressed file and the decompressed file size, is there anything that will tell me the compressed file size or where the compressed file ends?
Presently I pass from the zlib header to EOF into a inflate function. This works fine for smaller files as the inflate function will discard any data after the end of the compressed file and only return me the decompressed bytes. However for larger files where the compressed file is located near the top of the file, my system does not have enough memory to pass the majority of the file into the inflate function.