Author Topic: Epic reverse-engineering  (Read 17707 times)

0 Members and 4 Guests are viewing this topic.

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5524
  • Country: gb
Re: Epic reverse-engineering
« Reply #25 on: May 26, 2015, 08:19:36 am »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12494
  • Country: us
    • Personal site
Re: Epic reverse-engineering
« Reply #26 on: May 26, 2015, 09:08:25 am »
This is how hacking should look in movies. And not typing a bunch of random characters into turned off notebook :)
Alex
 

Online mikeselectricstuffTopic starter

  • Super Contributor
  • ***
  • Posts: 14807
  • Country: gb
    • Mike's Electric Stuff
Re: Epic reverse-engineering
« Reply #27 on: May 26, 2015, 09:30:26 am »
How hard is really to figure out a Commodore 64 really?

In those days, systems where so simple that it doesn't compare to now, 20 KB of Rom with 6502 code is hardly a challenge.

We are going off topic, but it mostly relied on clever tricks, e.g. one of the "encryption" techniques used was to execute a loader code in screen memory, so in case you break the execution, the screen clears and the code is gone.

ISTR when I was hacking game protection on the BBC Micro, one clever scheme used a hardware timer as the XOR key to decrypt code, so any change to the code would make the results meaningless. They also arranged it so that on completion it dropped straight into the code, so you couldn't easily stop it once the decrypt had happenned. I think the first pass of the loop modified part of the decrypt code as well.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Epic reverse-engineering
« Reply #28 on: May 26, 2015, 11:39:06 am »
one clever scheme used a hardware timer as the XOR key to decrypt code
I don't get this. That would imply that the flow of the program code has to be 100% predictable (always the same) and fully (hardware) time(r) aligned?
 

Online mikeselectricstuffTopic starter

  • Super Contributor
  • ***
  • Posts: 14807
  • Country: gb
    • Mike's Electric Stuff
Re: Epic reverse-engineering
« Reply #29 on: May 26, 2015, 01:15:46 pm »
one clever scheme used a hardware timer as the XOR key to decrypt code
I don't get this. That would imply that the flow of the program code has to be 100% predictable (always the same) and fully (hardware) time(r) aligned?
Yes. That is why it was so clever. Remember this was a 2MHz 6502 where you have very tight control over timing - the timing between the code initialising the timer and using the value is fixed - it just makes it hard to simulate.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 9221
  • Country: de
  • A qualified hobbyist ;)
Re: Epic reverse-engineering
« Reply #30 on: May 26, 2015, 01:16:21 pm »
one clever scheme used a hardware timer as the XOR key to decrypt code
I don't get this. That would imply that the flow of the program code has to be 100% predictable (always the same) and fully (hardware) time(r) aligned?

Take the code as binary blob, write the decoder function (setting up the timer and a XOR loop) and determine the start value of the timer for the first XOR and the cycles needed for each loop run. Then use those numbers to encrypt the code, put the decoder in front of the encrypted code and have a cup of tea. The timer's start value is the first key. The second key is the start value plus the number of cycles for one loop run. And so on for the other keys. If you don't count CPU cycles, i.e. using the timer with a prescaler, you have to devide the cycles per loop run too. Basically you could use the decoder to encode too ;)
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Epic reverse-engineering
« Reply #31 on: May 26, 2015, 02:15:26 pm »
the code initialising the timer and using the value is fixed
Ok that could work, I read it as that the software was using a free running hardware timer which will not work.
Still tricky if there are HW interrupts that could interfere.
And I guess you have to (re)set that timer for every branch in the code?
Still the regular setting of the timer gives this neat trick away to the hacker.
 

Online Kalvin

  • Super Contributor
  • ***
  • Posts: 2178
  • Country: fi
  • Embedded SW/HW.
Re: Epic reverse-engineering
« Reply #32 on: May 26, 2015, 02:46:09 pm »
the code initialising the timer and using the value is fixed
Still tricky if there are HW interrupts that could interfere.
Like a [HW] debugger used for reverese-engineering the copy protection? ;)
 

Offline SArepairman

  • Frequent Contributor
  • **
  • Posts: 885
  • Country: 00
  • wannabee bit hunter
Re: Epic reverse-engineering
« Reply #33 on: May 26, 2015, 06:33:49 pm »
 

Offline Muxr

  • Super Contributor
  • ***
  • Posts: 1375
  • Country: us
Re: Epic reverse-engineering
« Reply #34 on: May 26, 2015, 07:18:50 pm »
Old school reverse engineering was hard core because there was no web or google. Now days it's all about how much time you want to spend cracking something, provided you have some fundamentals, time and will.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12494
  • Country: us
    • Personal site
Re: Epic reverse-engineering
« Reply #35 on: May 26, 2015, 07:58:30 pm »
And grass was greener and trees were taller as well.

In the old days they could not have engineered that much in a first place. Both engineering and reverse-engineering techniques go hand in hand, so no need to complain.
Alex
 

Online mikeselectricstuffTopic starter

  • Super Contributor
  • ***
  • Posts: 14807
  • Country: gb
    • Mike's Electric Stuff
Re: Epic reverse-engineering
« Reply #36 on: May 26, 2015, 08:50:16 pm »
And grass was greener and trees were taller as well.

In the old days they could not have engineered that much in a first place. Both engineering and reverse-engineering techniques go hand in hand, so no need to complain.
A major difference is that nowadays, the amount of code is vastly bigger, and may well have stuff like bought-in libraries and leftovers from other versions, which makes disassembly a lot harder.
Gone are the days when you could hook up a logic analyser to an address/data bus to capture every read/write cycle & follow code execution paths
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Epic reverse-engineering
« Reply #37 on: May 26, 2015, 09:10:17 pm »
That said look at the Rigol scope hack, I2C and the hint of an ECC lib and a very talented hacker/engineer.
 

Offline Muxr

  • Super Contributor
  • ***
  • Posts: 1375
  • Country: us
Re: Epic reverse-engineering
« Reply #38 on: May 26, 2015, 09:27:47 pm »
And grass was greener and trees were taller as well.

In the old days they could not have engineered that much in a first place. Both engineering and reverse-engineering techniques go hand in hand, so no need to complain.
True. Also agree with Mike's point.

I believe that democratization that Internet provided has made it far more accessible than it used to be however. Sure the technical complexity has gone up, but so have the tools, like this for instance: https://hackaday.io/project/956-chipwhisperer-security-research

As well as the accessibility of tools in general. I am looking at it from the other side. If you were tasked with securing something I think it would be harder today.

I am not complaining at all, I think it's fascinating, just reading through that Rigol thread was pretty cool, to see the community coming together to hack the product in such a short amount of time.
« Last Edit: May 26, 2015, 09:30:18 pm by Muxr »
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1562
  • Country: 00
Re: Epic reverse-engineering
« Reply #39 on: May 26, 2015, 09:33:16 pm »
Now days it's all about how much time you want to spend cracking something, provided you have some fundamentals, time and will.
Probably you watched too many james Bond films  :-DD
Try to crack this message:


Ok, maybe it is not message but... ATTiny85 code?

I can help you-do not waste your time-it is not possible to crack this  >:D

12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Online mikeselectricstuffTopic starter

  • Super Contributor
  • ***
  • Posts: 14807
  • Country: gb
    • Mike's Electric Stuff
Re: Epic reverse-engineering
« Reply #40 on: May 26, 2015, 10:30:45 pm »
Of course the flipside of code sizes getting bigger is that when manufacturers are effectively forced to choose an off-the-shelf OS, this allows all sorts of potential ways in because of it's general-purpose functionality, like with the Flir E4 !
Bigger code can sometimes mean more ways in ;D
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Epic reverse-engineering
« Reply #41 on: May 26, 2015, 11:05:46 pm »
A major difference is that nowadays, the amount of code is vastly bigger, and may well have stuff like bought-in libraries and leftovers from other versions, which makes disassembly a lot harder.

And you can't tell what they were thinking.

What is this shit?  It's all just moving around, going in circles...

Why are we jumping into this?  We were already here a hundred times...

Nevermind, probably just some dumbass compiler...

...But then, if you gain familiarity with the typical compilers, you can recognize their output.  It may be dumb output, but it's characteristically dumb.  Like the dull kid at school, easily recognized.  That helps to distinguish not just between functions, but between internal and library functions, for example.

Same goes for libraries, whether purchased or free -- it's all bad!  Free software is often better, rarely so much in quality (unless it's an exceedingly popular distribution with a lot of exposure), but just because, at least you can fix it from the source level when it does break.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Dongulus

  • Regular Contributor
  • *
  • Posts: 232
  • Country: us
Re: Epic reverse-engineering
« Reply #42 on: May 27, 2015, 12:02:22 am »
Take a look at 2:18 into her second video. It seems that Scanlime is a fan of Dave's videos.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->