we just need to duplicate the JPG header ◦ and trick the JPG header to find its data ‘further’ than expected • ZIP can store data unmodified ◦ we just need to trick ZIP structure to find its file data within the PDF
PDF image object overlaps LocalFileHeader :( Solution: ZIP contains 2 filenames entries: • in CentralDirectory (important one) • in each LocalFileHeader (discardable) → abused LFH’s filename to overlap PDF object start (not 100% compatible)
:( ◦ 7z, ZipFile don’t support it • Adobe Reader blacklists JPEGs-starting PDFs → need to slightly corrupt JPEG header → some JPEG viewers don’t support it :( JPEG corrupted to let PDF open under Adobe easy to fix, would break Adobe