YTread Logo
YTread Logo

Reversing an unkown digital protocol with an Arduino - rhme2 Whac the mole (misc 200)

May 29, 2021
I'm easy on a couple of software-based challenges now, but originally I really wanted to get more hardware experience and there's only two or three weeks left until the competition, so I decided it's time to try

whac

k-a-

mole

. I guess it's more hardware related who doesn't like a classic Westham game all this time the most infiltrated deep in the backyard of a poor farming family the

mole

s are ruining the crops the farmer desperately needs to support his wife and two children at any time. Tremor able to help him extinguish the damn thing will be greatly rewarded. Are you up to the task?
reversing an unkown digital protocol with an arduino   rhme2 whac the mole misc 200
I've never played wax and mobile, but I've seen it have these holes and a hammer and most keep popping out for a short period of time. time and you need to hit them fast enough and if this is what this channel is about then how could you simulate or implement a game like this on an Arduino? I mean, you could imagine that this Arduino sits at the core of this arcade machine, how could it? It works, so let's strap a sucker to the dash and see what the serial console tells us. Welcome adventurer. We're glad you're here.
reversing an unkown digital protocol with an arduino   rhme2 whac the mole misc 200

More Interesting Facts About,

reversing an unkown digital protocol with an arduino rhme2 whac the mole misc 200...

A large family of moles has arrived in our garden. We need you to get rid of the twenty if you succeed we will reward you when you are ready press Enter ok so let's press ENTER ready set set you missed it try again by pressing Enter hmm so first I checked this and some other entries for something For example, can I press Enter? very fast or space or maybe a number on the keyboard but it doesn't do anything so I think we have to get out some hardware. My logic is this: we can interact with sport through a spherical connection.
reversing an unkown digital protocol with an arduino   rhme2 whac the mole misc 200
There doesn't seem to be much. is happening except starting the game by pressing Enter, so what other ways are there for us to interact with the board? There aren't many options. This thing has no other peripherals except a couple of input or output pins, so I want to know if I see any output on these pins on the Otto, you know when the game starts because that one makes sense if the other you know where to sit on an arcade machine , I would use them. I open them to control the motors LEDs or anything else to do this. my Sailor logic analyzer that I showed in a previous video, I can basically connect it to all the pins that I want to look at and then I can use the software on my left or to record any events and these sailor cables can be conveniently connected directly by soldering pins on the board , so basically when I click start, now in very short intervals it will check the voltage of these connected pins and store the value.
reversing an unkown digital protocol with an arduino   rhme2 whac the mole misc 200
This happens millions of times and already uses more than two gigabytes of frame to store all of these points. so this takes a little bit of time to process, but look at this, you can already see that there is at least one pin with some action. You also see that some other channels reflect that pattern, which is probably just analog leakage. I don't know, it is somehow. interferes with each other but we ignored it and started the game twice in this period of time, so you can see that there was an amazing result twice to explore this now a little closer.
I decided to use my oscilloscope so I could unplug the logic analyzer and plug it in. By raising the two channels of the oscilloscope you can already see some of the pros and cons of an oscilloscope where the logic analyzer, my Scylla oscilloscope only has two channels, the logic analyzer had eight so it was easier to find the interesting pin with the XLE but Now that we know where it is, the oscilloscope is a little faster to proceed because we don't have to wait for the data to be collected etc., it will display the contents instantly, so I connected the yellow channel 1 to the serial TX pin which is the output zero of the board so here we can see all the characters that the board prints.
I want to see that because I want to know how this interesting pin reacts when the game sends that to say the game started and hooked a blue. interesting pin 13 can also enable decoding fear on the oscilloscope, so that the bubbles on the screen are actually the decoded ASCII characters and I set the trigger to fire when there is some serial data. Sending a trigger means that the oscilloscope will wait until it sees the given event and then record and display what happens after it, so it will be swapped now every time the board sends something, so that when we start the game we can see the ready and go and in the last exit see how the interesting pin goes.
Hi, I think we're too far into serial output this way faster than what we see on pin 13, so let's adjust the screen a little more and start the game again and there we see three peaks if we do it again six. spikes and we start the game again for spikes, what could that mean? I think it's pretty clear where this is going. If you think about the game

whac

k-a-mole, first you have to see where the mole is peeking out and then hit it. I'm sure the number of peaks tells you which hole you have to reach, so at first I tried to look at the peaks and then quickly sent like a number four or a number six five zero because I thought maybe the game is played by a distillery . concept, but again nothing happens and I actually already suspected that it was probably hardware again, so how could we interact with the sport now?
How can we count the peaks and then somehow perform the hips? So I thought I'd try it with a simple microcontroller, let's take another Arduino. This is a self-incompatible board and you only need to program it. The first thing we have to do is count the number of peaks to do this. Obviously I have to add some cables between the Arduino and the challenge board. There are already two connections here, one goes to the pin. with the spikes so we can count them and the second one is testing my assumption that we have to send a spike to one of the other

digital

pins to reach them all.
I just picked one that I'm still exploring. I started with the

digital

read example included with the other IDE you know which sets up a serial connection between the audrina and the laptop so it can print some debug messages and then I basically write some code that reads from the input pin and checks The state changes if I suddenly encounter a spike. I don't want to spend too much time explaining the code, but let's look at this initial stage here, a Piercy setup routine that will run once at startup and define the input of the pin forest and the output of pin 7 with the pin. 4 we can read and count the spikes and on pin 7 we want to send the spike and hopefully hit them all then the loop routine will run in a loop so read this code knowing it will run over and over again . very fast, so first we read the digital state of the input pin if the state does not change, for example when we constantly read a zero, nothing happens.
When it changes, when we see a spike, we read a 1, we enter this if we save. the current state and remember the current time and if the current state is one so we are at the peak we will count it immediately and then in the next cycle we will read this pin again and it may still be high so the state is not different and nothing happens, they all fall again, we would remember the next time and if it increases after that, it will count again so this can count the spikes and then the if's down here will check the time that was stored from the last change of state we have.
We have seen that the spikes always have the same time antelope, so if we have not seen a state change for 100 milliseconds, basically there will not be another spike and it will be low for a while, we want to reach the correct mode to do this, set the output pin 7. too high wait a bit with a delay and then set it back to 0, this will create a spike and then we reset the counter. Let's look at this on the oscilloscope. I connected the yellow channel to our output 7 to see our peak and, as you can see the counter.
The beaks are ready and then you see the beak of the fine needle. If you zoom in, you'll see that it is indeed the beak, but it's definitely too short. In the oscilloscope interface you have information like the x-axis time scale, so you can see that the blue spikes have a duration of 50 milliseconds, so let's set the delay to 15 milliseconds as well. I would assume that we should send the exact same spike to the challenge board and this is what it looks like by running the output from the challenge board here on the left. and here on the right is the other one on our exit, counting the spikes seems to work.
Did you see that we got a great job? You hit it, only 50 more to go again twice. This happened because we count three spikes every time it seems that Let's do exactly what we're supposed to do and the pin we connect from the switch board represents the third hole so the plan is clear, let's figure out what other numbers correspond to which other pin. I decided to go pin by pin, so I connect one more. and make this peak every time if you get any number other than three and hit something, we know this number is that pin, if no number would work with this pin we move on to the next one.
Let's be an easy process, just the tedious thing takes a while, but it's fun to look at the oscilloscope and see the successful results, so I keep adding wires trying to find which counted number corresponds to which input pin and as you can see, F each Maybe there are more output pins and I have this big switch box where it depends on a number. of peaks we count a certain trigger output pin if you count one peak we send the peak on pin eight if we count five peaks we send a glimpse on pin nine it works very well look how far we got it looks amazing on the oscilloscope We fly other peaks that we count and yellow indicates when we're trying to make a hole, but why the hell doesn't it continue after six of the sevens hit?
This really stumped me. I had a few theories, one was that starting at level seven we actually have to drill several holes. like in your card game more moles appear or maybe the numbering of the holes changes and suddenly it is no longer correct but it was late and I had to go to bed the next day I want to continue but nothing worked anymore what the hell is happening I realized that When you reset the board the pin assignments will be different, hole number three is no longer pin number seven. This is when I start writing some code that would automatically snap a correct pin, hit the holes randomly until it continued and when it did the hit was correct and I saved it to a large table, this took a long time and in the end all these attempts were a bit stupid because when I was looking at the screen of your chairs I realized that the level was failing. the failed cereal response seems to come back a little faster.
Blue is zero output, so it tells us that we achieve something or fail and other yellow peaks that we see, if you look closely you can tell the difference. What if I'm just sending? too slow and the pin out is random at the beginning, but it is fixed throughout the levels, so here is my final code, much more complex, fixes the timing problem and still with some code that can select random numbering of the pinholes, it's a pretty bad code for words. Here's the serial output on the left and the current level status sent from the other board you know on the right.
The small star indicates the last highest level. The arrow shows how far we got in the last level. Once it is completed, we can finish them all. and there is the flag and this is how it looks on the oscilloscope. You can see that he only occasionally solves a level until he solves all the numbers and then solves them all.

If you have any copyright issue, please Contact