Frostavator⚓︎
Elf: Grody Goiterson
Direct link: frostavator website
Objective: FPGA Programming
Request⚓︎
Grody Goiterson
Hrmph. Snrack! Pthbthbthb.
Gnerphk. Well, on to business.
I'm Grody Goiterson. ... It's a family name.
So hey, this is the Frostavator. It runs on some logic chips... that fell out.
I put them back in, but I must have mixed them up, because it isn't working now.
If you don't know much about logic gates, it's something you should look up.
If you help me run the elevator, maybe I can help you with something else.
I'm pretty good with FPGAs, if that's worth something to ya'.
Hints⚓︎
Logic Gate Iconography
Solution⚓︎
There's three ways to approach this. The first option is to ignore the elevator and just use the stairs. Option two is take the time to learn about logic gates and drag and drop the components on the Frostavator panel around until we end up with a valid solution. The final option is to bruteforce the Frostavator and compile a list of all the valid panel layouts. The first leaves us without a hint, the second is the most educational, the third however is probably the most fun!
The app.js
code tells us that the panel layout is stored as an Array of 6 integers ranging from 0 to 5. The code first tries to load the data from a local storage variable called frostavatorData
. If that's not available, the layout defaults to [4, 3, 5, 0, 1, 2]. Each number in the list corresponds with a type of logic gate, while the number's position in the list defines its location on the panel.
Each time we drag one of the ICs around and let go of the mouse button, the gateCheck()
function is executed which validates the current panel layout. If everything checks out the layout is then sent via a POST request to /check
. While the POST request is shielded by some validation logic in app.js
, all it really requires as input is an ID and a list representation of a panel layout. We can confirm this by sending a manual POST request and capturing the response.
An invalid panel layout returns a result
field set to false. Generating all 720 permutations of [0, 1, 2, 3, 4, 5] and sending each one to the /check
endpoint for validation will at some point respond with a hash
field and value, indicating that particular sequence is a valid one. Now that we know the difference between valid and invalid, we can finalize our automation.
bruteforce_frostavator.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
Using the custom bruteforce_frostavator.py
script we end up with 72 valid panel layouts. In other words, if you opted for randomly dragging ICs around to solve this challenge, you had a 1 in 10 chance of hitting a valid layout.
To make life a little easier, the script also supports a --pick-one
option which prints an additional ASCII panel layout.
Now that we know all the valid layouts, we can copy one of the solutions from the script output into the frostavatorData
local storage variable and reload the page to have the JavaScript code pick up the new value. Alternatively, we can drag and drop the ICs on the panel to match the ASCII representation provided by the --pick-one
option.
Secret __Shenanigans__ area
There's a note on the Frostavator panel telling us that the residential floors aren't accessible during FrostFest. But hey, might as well poke around at that panel some more, right? Use your web browser's console to set targetFloor
to an unused value (line 1) and run the below code snippet taken from app.js
. You'll be taken to a hidden __Shenanigans__ area. See the Easter Eggs section for additional details. This works for both the Santavator and Frostavator.
Change to another floor | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Response⚓︎
Grody Goiterson
Oooo... That's it!
A deal's a deal. Let's talk FPGA.
First, did you know there are people who do this stuff for fun??
I mean, I'm more into picking on other trolls for fun, but whatever.
Also, that Prof. Petabyte guy is giving a talk about FPGAs. Weirdo.
So hey, good luck or whatever.