Showing posts with label reverse engineering. Show all posts
Showing posts with label reverse engineering. Show all posts

Wednesday, 25 August 2021

Hex Messages when Reverse Engineering

One of the things I did in 2018 was a bit of reverse engineering, the company I worked for had bought a bunch of older hardware which had to be reused, the trouble being?  They had bought the hardware NOT the software.

It look a lot of USB sniffing and signal trapping but eventually I had the device handshake and could see it spew me messages, from these I saw the header format was pretty simple just a pair of bytes and then a length byte followed by whatever the message was.

Interacting with the device stimulated it into sending more messages, so we could start to map physical actions to these USB packet ghosts, eventually we had all the ones we could just prod out of the unit, so it was time to work on more advanced interactions and actually try to tell the device to carry out actions for us.

This immediately met with problems, you see the messages coming out had a counter in the footer, it turned out that if you sent a message you had to use the next number... so receiving messages 1, 2, 3 and then you send 4 and receive 5.  Keeping this in sync was a little bit of black magic, but it soon made sense the unit was serial in operation, you could only talk when it was listening, and it only listened after certain choice messages it sent to you.

This all made sense.... What didn't make sense was a four byte message I saw every few minutes, this frustrated me no end....

10111110111011111101111010101101

I converted these to two into an integer... 3203391149... It didn't ring any bells, but I persisted and was rewarded when I switched it into hex...

BEEF DEAD

This is a common message left in hex in code, as a joke, but it was also apt, the board was not going to talk until a full handshake was given again and the packet series stream started over to order things.  Cute.

I've found other hex strings, but this one was the first on this particular board

Monday, 26 July 2021

Your Best Work?

The best piece of work you've ever done?

This is one of those subjective questions you can pose people, and you always hope that there's better to come, so really what we're asking a software engineer is "What is the best piece of software or project you've done so far?"

As technology is always marching on and new ideas are always emerging you can often say you're going to make something better, which is great, but it makes it harder and harder to pick out the best pieces of work from your portfolio.... Do you judge it by the number of users or downloads or how much money it made the company or even how much you were paid to do the work?

Monetarily the most money I've ever made on a piece of software was for a website I wrote in about two weeks in ASP & javascript in about 2002, which netted me the grand sum of £4000 for 80 hours work, literally £50 an hour.  But it wasn't the best work I ever did; I mean (snear) it was javascript.

The most interesting work I've ever done is the work I'm doing right now, but I can't talk about that.

So this leads me back a step to my long tenure at my prior employer, the best work I think I did, was a project to port the existing system to a new hardware platform; this involved reverse engineering the hardware interface and writing a new interface for the hardware abstraction layer for that particular hardware, which worked seamlessly and the whole system was agnostic as to which hardware type it was booted up upon.

This was not how that particular system was engineered, so in about four weeks I not only made the hardware interface an abstract interface, but also developed a test bed for the new hardware and then sewed the two together; four weeks in that environment was an incredibly fast turn around.

And it was extremely enjoyable.

That section of work was one of the best pieces of work I ever did.

Years later the creator of that hardware came to work for the company, he saw his hardware but our software and asked a few pertinent questions, for he thought his hardware was secure and could not be made to work on another platform without his secret sauce.  Let us just say it was fun to NOT tell him quite how I'd done the reverse engineering; unfortunately this reverse engineering nous set me up for the next big reverse engineering jail break required by the company, and it was a totally different kettle of fish and worthy of it's own post later.