├── .gitignore ├── Dell_hack.ino └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | -------------------------------------------------------------------------------- /Dell_hack.ino: -------------------------------------------------------------------------------- 1 | #define turnOn10 PORTB|=B00000100 2 | #define turnOff10 PORTB&=B11111011 3 | 4 | #define output10 DDRB|=B00000100 5 | #define input10 DDRB&=B11111011 6 | 7 | byte CRC=0xFB; 8 | 9 | byte data[3] = { 0x30, 0x39, 0x30}; 10 | boolean restarted=false; 11 | unsigned long start=0; 12 | #define restart_time 450 13 | 14 | boolean read10(){ 15 | byte nkj=PINB; 16 | nkj&=B00000100; 17 | if(nkj != 0){ 18 | return 1; 19 | }else{ 20 | return 0; 21 | } 22 | } 23 | 24 | void setup() { 25 | noInterrupts(); 26 | DDRB &= B11000000; //reset port 27 | PORTB &= B11000000; //reset port to disable all pull-ups 28 | } 29 | 30 | void loop() { 31 | 32 | if(!restarted){ //waiting for restart 33 | 34 | if(read10() == 0 && start == 0){ //pin goes low and we are not measuring yet 35 | start=micros(); 36 | } 37 | if(read10() != 0 && start != 0){ //pin goes high and we are waiting for that 38 | if(micros()-start >= restart_time){ //we have a restart 39 | restarted=true; 40 | delayMicroseconds(30); 41 | output10; 42 | turnOff10; 43 | delayMicroseconds(120); 44 | turnOn10; 45 | input10; 46 | }else{ //we dont have restat yet 47 | start=0; 48 | } 49 | } 50 | }else{ //we have passed restart state 51 | //read crap 52 | for(int k=0; k < 4; k++){ //read skip_rom, readmem, 2 za adresu 53 | for(int i=0; i < 8; i++){ 54 | while(read10() != 0); 55 | while(read10() == 0); 56 | } 57 | } 58 | 59 | //write CRC 60 | for(int i=0; i<8; i++){ 61 | if(CRC & 1<