logoalt Hacker News

pyrolisticallast Thursday at 11:24 PM2 repliesview on HN

It decodes to binary pdf and there are only so many valid encodings. So this is how I would solve it.

1. Get an open source pdf decoder

2. Decode bytes up to first ambiguous char

3. See if next bits are valid with an 1, if not it’s an l

4. Might need to backtrack if both 1 and l were valid

By being able to quickly try each char in the middle of the decoding process you cut out the start time. This makes it feasible to test all permutations automatically and linearly


Replies

pletnesyesterday at 6:29 AM

You might need to backtrack a lot more, due to the intermediate compression step?

bawolfflast Thursday at 11:45 PM

Sounds like a job for afl