Writing, 2026
Reverse-Engineering a WeChat Mini-Program How forgetting to book a library seat turned into my first real look under an app.
Why I started
For a while I liked studying at the library near my home. The problem was that a seat had to be booked in advance, and I was busy enough that I kept forgetting to do it. So I decided to write a program that would book one for me.
Automating the surface
I started the wrong way. I wrote a small script that drove the app the way a person would: find the button, tap it. It ran, but it ran unreliably. An element loading a beat late, a slow network, a layout shifted by a few pixels: any of these could make it fail. I spent a while tuning timeouts and retry counts before I saw that none of this was the real problem. These small delays were not things I could control, and a machine cannot improvise around them the way a person does. The quick idea I had reached for first turned out to be full of things that could go wrong.
Reading the requests instead
So I changed my approach. The screen and the buttons could change, but underneath them there is a layer that stays the same: the request the app sends. I started digging into those requests, capturing traffic and testing over and over until I had worked out which request each button actually sent. Once I knew that, I could send the request directly, instead of finding a button on the screen and tapping it.
Stuck on the wrong layer
Then I got stuck for days. The server expected a signature on each request, a short string meant to prove the request had not been tampered with. I first tried to break it by brute force, looking for a pattern across the requests, but there was none to find. So I changed tack and reverse-engineered the WeChat mini-program itself: I read its source to understand how it built that encrypted parameter and which inputs it fed into the signature. After a few more days of reading code and searching for keywords, I found the algorithm it used to encrypt, and I reused that same algorithm to build a valid signature of my own.
The guards I noticed by their absence
Somewhere in there I noticed something that stayed with me. Some of the systems I looked at trusted inputs they had no reason to trust. They would accept the same request a second time, or accept one made much earlier as if it had just arrived. A careful system does the opposite. It makes each request good exactly once, and only for a short window, so a copy of it is worthless a minute later. I did not learn why those protections exist by reading about them. I learned it by seeing a system that was missing them.
What the project gave me
What I took from this was the experience of finding a problem and working it out, which was unlike the algorithm contests I had done before. There was no standard solution, and no standard input and output to satisfy. I had to test one case at a time, pile up attempts, and find the connections between them myself. Before this project I did not really know how a request was sent, or how two devices talked to each other. Working through it took me from a kid who could only solve algorithm problems to someone who could put code to work on a real system, and it left me understanding the lower layers, the network traffic and the encryption, far better than I had before.