sekyHC / Hacking-dell-charger

Arduino code for hacking dell charger
23 stars 11 forks source link

Code is Incomprehensible #3

Open crabdancing opened 6 years ago

crabdancing commented 6 years ago

This is exactly the project I've been looking for, and I'd love to collaborate with you! I'm starting a tech blog and want one of my projects to be reverse engineering and breaking HRM (hardware rights management) on Dell machines -- especially chargers.

Unfortunately, I can't make heads or tails of this code. I come from a Python/C++ background and haven't really done much with arcane C memory management stuff, besides basic data structure implementations.

Is it just supposed to output a set ID pattern, and if so, to which pins? (and how exactly did you derive these numbers?) Your code could really benefit from some more code comments -- as it is, there are a LOT of magic numbers here, and it obscures the thought that went into the program's design.

I was wondering if we could get in touch and talk about how you did this project, and how exactly it works -- maybe I could write a blog post on it? (Giving you full credit for the implementation, of course.)

(I'd also ideally like to get this code to work on Arduino nano clones on Ebay, then build my own cheap chargers for Dell laptops. Not necessarily to sell, but as a project that techies can easily and conveniently copy -- FYI, you can get Arduino nano clones for as little as $3 on Ebay, so it seems very cost effective.)

Edit: found your schematic. You should really put this in README.md! This is far too fancily done for something that'll likely only be seen by a few people. Do you accept pull requests?

Edit 2: I bought some tiny85 chips, along with the dev boards with a USB input. I will try to recreate your work with that specific chip. :)

ghost commented 6 years ago

It will work with any chip. I had done this code long time ago and I would definitely do it differently now. This code just sends the data that laptop is expecting and it is not handling any reset conditions that should be handled to get it to proper stable level.. I do not have time to rewrite this but this is working for me as it is Here is what I have used for this before I have used logic analyzer to verify everything https://hackaday.com/2014/03/03/hacking-dell-laptop-charger-identification/

crabdancing commented 6 years ago

@seky2205 So, you derived these numbers yourself, from a logic analyzer? Is this a simple replay attack, then?

Where did you get the memory location values from?

ghost commented 6 years ago

Yea they are from the logic analyzer. I know how that at first there is reset then a laptop is sending X number of bytes which I count and do nothing with them, and then send a reply about wattage with CRC.