CTF writeups

Challenge with PIC16F87

Three or four years ago, a friend of mine asked me to check a memory card of the stone crushing device to find a way to change its data. It contained a counter which decreased from X to zero, and the zero means no more stone crushing. At first glance, it looked like a CF memory for me with the same size and style, but it was a failed mission those days because ram readers didn’t work, and I’ve never worked on it again. Recently I’ve been eager to learn and work with hardware devices. If you’re a hardware lover, you know there’s a curiosity to break almost every electronic device at home, and I’m not an exception either. After challenging all of my routers, I finally found this memory card. It was game-changing for me. I decided to break its box, and believe me, breaking the boxes is always the most challenging part. Finally, the board revealed:

As I said, breaking the shield was the most challenging part, but I was wrong. The hardest part was to clean the junk from the PCB; I spent some hours making it clean:

Six circles on the backside of the board seemed UART for me. But I was wrong. After spending some time and analysis, I understood how to deal with it, and the answer was this IC:

Microchip PIC16F87

Then I googled the PIC16F87 to find its datasheet. The next thing I needed was a programmer to flash the content of the IC and read its content. After checking my programmers, I’ve found out XGecu TL866 can do this. It’s small, easy to use but powerful and also cheap. Here is the pinout:

Quick but dirty:

Later I bought a PCBite which was a life saver

Then it was time to read the data, and it worked:

I’ve never succeeded in testing it on an actual device because it wasn’t available anymore, but it probably works. Btw, it was a hobby, and as a hobby, I was happy about my findings. For the final part, I decided to use my ram reader’s CF Memory reader and some wiring to make a small box to read the cards without breaking them; just put the card and re-write it. It wasn’t what I looked for, but I accepted it as my first job. It was an exciting and enjoyable challenge for me, and I learned a lot, so I decided to share what I did as a blog post, It might be helpful for someone else, and I hope to do better next time:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.