UMassCTF 2026 - Smart Brick v2
I managed to get my hands on a design files from LEGO HQ. Apparently it is the design for the new Smart Brick v2. I want to analyze it but I don’t have the hardware to do so. Can you help me figure out what it does?? 我设法从乐高总部拿到了一份设计文件。我想对它进行分析,但我没有分析所需的硬件。你能帮我弄明白它是做什么的吗?
Hint 1: I think I have seen that file format before on an popular open-source eCAD software but I can’t remember which one… (我好像在一款流行的开源 eCAD 软件上见过这种文件格式,但记不清是哪一款了) Hint 2: Hmmm… there seem to be 7 inputs, I wonder what encoding uses only 7 bits? (嗯……似乎有 7 个输入,我想知道什么编码只使用 7 位?) Hint 3: I found a great python library to interact with this file programmatically: kiutils (我发现了一个很棒的 Python 库,可以通过编程与该文件交互:kiutils)
Initial Analysis
The challenge provides a KiCad PCB design file
(smart-brick-v2.kicad_pcb) and asks to analyze it to
discover its function. Hints suggest that the board uses a 7-bit
encoding (ASCII) and points toward the kiutils Python
library for programmatic analysis.
Opening the file or inspecting the raw text reveals it is a KiCad 9.0 board file. Key features identified:
- Inputs: 7 nets labeled
/IN0through/IN6. This confirms the hint about 7-bit encoding (ASCII). - Outputs: 19 LEDs (
D1–D19) driven by 19 MOSFETs (Q1–Q19). - Logic: A large array of 74LS series discrete logic gates (AND, NAND, OR, NOR, XOR, NOT).
The circuit is a combinational logic “decoder” where each LED represents a character in the flag. An LED will light up if the 7-bit input matches a specific character programmed into the logic gates for that stage.
Solution
To solve this without physical hardware or a manual schematic trace, we can automate the logic extraction and simulation using Python.
1. Technical Approach
Step 1: Parsing the PCB Using the
kiutils library, we extract all footprints, their values
(e.g., 74LS00), and the nets connected to their pins.
Step 2: Mapping Logic Gates Each 74LS chip contains
multiple gates. For example: - 74LS00: Quad 2-input NAND. -
74LS08: Quad 2-input AND. - 74LS86: Quad
2-input XOR. - 74LS21: Dual 4-input AND.
We build a dependency graph where each net’s value is determined by the boolean operation of its input nets.
Step 3: Simulation Since there are only 128 possible
values for a 7-bit input (ASCII 0–127), we can brute-force the inputs
for each of the 19 output stages. For each character c from
0 to 127, we propagate the values through the logic gate graph and check
which MOSFET gates (Q1–Q19) are pulled
HIGH.
2. Execution
The simulation reveals that each LED corresponds to exactly one ASCII character:
| LED | Hex | Char | LED | Hex | Char |
|---|---|---|---|---|---|
| D1 | 0x55 | U | D11 | 0x68 | h |
| D2 | 0x4D | M | D12 | 0x33 | 3 |
| D3 | 0x41 | A | D13 | 0x5F | _ |
| D4 | 0x53 | S | D14 | 0x47 | G |
| D5 | 0x53 | S | D15 | 0x34 | 4 |
| D6 | 0x7B | { | D16 | 0x74 | t |
| D7 | 0x49 | I | D17 | 0x33 | 3 |
| D8 | 0x6E | n | D18 | 0x73 | s |
| D9 | 0x5F | _ | D19 | 0x7D | } |
| D10 | 0x54 | T |
3. Simulation Script
1 | import re |