lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Jul 6, 2021 at 1:19 AM Paul Ducklin wrote:
Not sure if I have misunderstood the subject line or the goal of this exercise, but how does turning a number (any number) into a Lua table compress it into two bytes?

In 16 bits you can uniquely encode 2^16 different values, and that’s the end of the discussion,surely?

The task requirement is "to inspect the censor's implementation (see the code below), find its weaknesses and write your own compressor and decompressor to deceive the censor as much as you can"
In other words, you should hack the censor by providing a "magical" compressor which can compress any number in 0 bytes.
This is possible due to incorrect checks for compressed data size in the censor's implementation.
The key fact: a Lua table is more than just a set of key-value pairs.  This is what the censor missed.  This is what you should abuse to write a hack.