Advertisement
Guest User

FacistsRunRIM

a guest
Dec 13th, 2009
1,521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. BlackBerry Engineering Screens:
  2. The BlackBerry devices all contain a hidden engineering screen (internally referred to as the escreen).
  3. On all recent devices (OS 4.0 and later), access to the escreen is controlled through a code generated
  4. from the application version, device PIN, and device uptime.
  5.  
  6. To access the escreen, access the device "Help Me!" screen. For QWERTY devices, perform the key
  7. combination Alt+Shift+H on the homescreen. For SureType devices, type Alt+EACE on the homescreen. For
  8. SurePress devices, hold the Escape button, and tap the screen upper left, upper right, upper left, and
  9. upper right corners in that sequence.
  10.  
  11. The "Help Me!" screen contains the application version, PIN, and current up time. Without leaving the
  12. "Help Me!" screen, enter that information into the generator. The generator will give you the 8 digit
  13. code for the current "Help Me!" screen. If you close the "Help Me!" screen, the device uptime will no
  14. longer match the uptime used to generate the code.
  15.  
  16. Type the 8 digit code into the "Help Me!" screen. You will not see the digits as you type them, but once
  17. all 8 correct digits are entered, the escreen will activate. Make sure to use Alt for the numbers on
  18. QWERTY devices. Make sure to use multitap to enter the digits on SureType devices.
  19.  
  20. Once activated, the escreen will replace the "Help Me!" screen for the duration specified when
  21. generating the code. You can close the escreen earlier by setting your device clock ahead past the
  22. expiration time, reactivating the "Help Me!" screen, then setting your device clock back to normal.
  23.  
  24. Pseudo-Code:
  25. # Filter uptime, PIN, and OS version by regexps `^[0-9]+$`, `^[0-9a-f]{8}$`, and `^([0-9]+\.[0-9]+\.[0-9]+ \([0-9]+\))|(4\.[0-1]\.[0-9]+\.[0-9]+)$`, respectively.
  26. # Convert PIN to lowercase.
  27. # Select the lifetime string value based on the desired code lifetime:
  28. * 1 day: ""
  29. * 3 days: "Hello my baby, hello my honey, hello my rag time gal"
  30. * 7 days: "He was a boy, and she was a girl, can I make it any more obvious?"
  31. * 15 days: "So am I, still waiting, for this world to stop hating?"
  32. * 30 days: "I love myself today, not like yesterday. I'm cool, I'm calm, I'm gonna be okay"
  33. # To create the data string: concatonate the PIN, OS version, uptime, and lifetime string, in that order.
  34. # Calculate an HMAC-SHA1 on the data string using "Up the time stream without a TARDIS" as the HMAC key.
  35. # Convert the first 4 bytes of the binary HMAC into an 8 character hex string (or if your HMAC-SHA1 outputs a hex string, take the first 8 characters).
  36.  
  37. Sample Codes (to test your own generator):
  38. ***********************************
  39. App Version: 4.5.0.110 (152)
  40. PIN: 12345678
  41. Uptime: 12345
  42.  
  43. Unlock code [1 day]: e1242bea
  44. Unlock code [3 days]: 5003da66
  45. Unlock code [7 days]: 88c59071
  46. Unlock code [15 days]: b9b8520d
  47. Unlock code [30 days]: 434bea2e
  48. ***********************************
  49. App Version: 5.0.0.1 (1)
  50. PIN: 00000000
  51. Uptime: 54321
  52.  
  53. Unlock code [1 day]: b9cddfdc
  54. Unlock code [3 days]: 9fe7a8a0
  55. Unlock code [7 days]: e76342b8
  56. Unlock code [15 days]: fb29bef6
  57. Unlock code [30 days]: 18f120c4
  58. ***********************************
  59. App Version: 4.7.0.1 (2)
  60. PIN: 88888888
  61. Uptime: 5
  62.  
  63. Unlock code [1 day]: e8f37d51
  64. Unlock code [3 days]: cec3ae24
  65. Unlock code [7 days]: 0f6c06fa
  66. Unlock code [15 days]: 284ea7cc
  67. Unlock code [30 days]: 58d732cb
  68. ***********************************
  69.  
  70. Java Implementation:
  71. import java.io.BufferedReader;
  72. import java.io.IOException;
  73. import java.io.InputStreamReader;
  74.  
  75. import java.security.InvalidKeyException;
  76. import java.security.NoSuchAlgorithmException;
  77. import javax.crypto.Mac;
  78. import javax.crypto.spec.SecretKeySpec;
  79.  
  80. // The code RIM doesn't want you to see.
  81. public class EScreenWizard
  82. {
  83. private static final String HMAC_KEY = "Up the time stream without a TARDIS";
  84.  
  85. private static final String[] DURATION_KEY = {
  86. "",
  87. "Hello my baby, hello my honey, hello my rag time gal",
  88. "He was a boy, and she was a girl, can I make it any more obvious?",
  89. "So am I, still waiting, for this world to stop hating?",
  90. "I love myself today, not like yesterday. I'm cool, I'm calm, I'm gonna be okay"};
  91.  
  92. private static final String[] DURATION_LEN = {
  93. "1 day",
  94. "3 days",
  95. "7 days",
  96. "15 days",
  97. "30 days"};
  98.  
  99. public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException
  100. {
  101. BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
  102. System.out.println("BlackBerry Engineering Screen Unlock Code Generator");
  103. System.out.println();
  104.  
  105. // get the data that is used to generate the key
  106. System.out.print("App Version: ");
  107. String appVer = console.readLine();
  108. System.out.print("PIN: ");
  109. String pin = console.readLine();
  110. System.out.print("Uptime: ");
  111. String uptime = console.readLine();
  112. System.out.println();
  113.  
  114. // generate the HMAC-SHA1 for all 5 possible codes
  115. for (int duration = 0; duration < 5; duration++)
  116. {
  117. // get an hmac_sha1 key from the raw key bytes
  118. SecretKeySpec signingKey = new SecretKeySpec(HMAC_KEY.getBytes(), "HmacSHA1");
  119. Mac mac = Mac.getInstance("HmacSHA1");
  120. mac.init(signingKey);
  121.  
  122. // generate the data
  123. StringBuffer buffer = new StringBuffer();
  124.  
  125. buffer.append(pin.toLowerCase());
  126. buffer.append(appVer.toLowerCase());
  127. buffer.append(uptime.toLowerCase());
  128.  
  129. buffer.append(DURATION_KEY[duration]);
  130. String data = buffer.toString();
  131.  
  132. // compute the hmac on input data bytes
  133. byte[] rawHmac = mac.doFinal(data.getBytes());
  134.  
  135. System.out.println("Unlock code [" + DURATION_LEN[duration] + "]: " + makeDigestString(rawHmac).split(" ")[0]);
  136. }
  137. }
  138.  
  139. private static String makeDigestString(byte[] input)
  140. {
  141. StringBuffer buffer = new StringBuffer();
  142. for (int i = 0; i < input.length; i++)
  143. {
  144. if (i % 4 == 0 && i != 0)
  145. buffer.append(" ");
  146. int x = (int)input[i];
  147. if (x < 0)
  148. x += 256;
  149. if (x < 16)
  150. buffer.append("0");
  151. buffer.append(Integer.toString(x, 16));
  152. }
  153. return buffer.toString();
  154. }
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement