Skip to content
This repository
Browse code

Add built-in ultrasn0w unlock to openiboot

  • Loading branch information...
commit 2bcd24c68d858e778e393965f991856d07c4c45a 1 parent b54f1ad
Hector Martin authored July 01, 2010
38  openiboot/radio.c
@@ -7,6 +7,7 @@
7 7
 #include "uart.h"
8 8
 #include "pmu.h"
9 9
 #include "wmcodec.h"
  10
+#include "ultrasn0w.h"
10 11
 
11 12
 // For the +XDRV stuff, it's usually device,function,arg1,arg2,arg3,...
12 13
 // device 4 seems to be the vibrator, device 0 seems to be the speakers,
@@ -23,6 +24,8 @@ static char* response_buf;
23 24
 #ifdef CONFIG_3G
24 25
 int radio_setup_3g()
25 26
 {
  27
+	int res;
  28
+	const char *unlock = NULL;
26 29
 	response_buf = malloc(RESPONSE_BUF_SIZE);
27 30
 
28 31
 	gpio_pulldown_configure(RADIO_BB_PULLDOWN, GPIOPDDown);
@@ -57,7 +60,40 @@ int radio_setup_3g()
57 60
 
58 61
 	speaker_setup();
59 62
 
60  
-	return 0;
  63
+	if(!(res = radio_cmd("at+xgendata\r\n", 10)))
  64
+	{
  65
+		bufferPrintf("radio: failed to check version!\r\n");
  66
+		return -1;
  67
+	}
  68
+
  69
+	if(strstr(response_buf, "ICE2_MODEM_04.26.08")) {
  70
+		bufferPrintf("radio: baseband version is 04.26.08\r\n");
  71
+		unlock = ultrasn0w_042608;
  72
+	} else if(strstr(response_buf, "ICE2_MODEM_05.11.07")) {
  73
+		bufferPrintf("radio: baseband version is 05.11.07\r\n");
  74
+		unlock = ultrasn0w_051107;
  75
+	} else if(strstr(response_buf, "ICE2_MODEM_05.12.01")) {
  76
+		bufferPrintf("radio: baseband version is 05.12.01\r\n");
  77
+		unlock = ultrasn0w_051201;
  78
+	} else if(strstr(response_buf, "ICE2_MODEM_05.13.04")) {
  79
+		bufferPrintf("radio: baseband version is 05.13.04\r\n");
  80
+		unlock = ultrasn0w_051304;
  81
+	} else {
  82
+		bufferPrintf("radio: unknown baseband version\n");
  83
+		bufferPrintf("radio: unlock not available\n");
  84
+		return 0;
  85
+	}
  86
+
  87
+	bufferPrintf("radio: sending ultrasn0w unlock string.\r\n");
  88
+	res = radio_cmd(unlock, 10);
  89
+	if (res == TRUE)
  90
+		bufferPrintf("radio: ultrasn0w successful\r\n");
  91
+	else {
  92
+		bufferPrintf("radio: ultrasn0w UNSUCCESSFUL\r\n");
  93
+		bufferPrintf("radio: buffer is %s\r\n", response_buf);
  94
+	}
  95
+
  96
+	return res;
61 97
 }
62 98
 #else
63 99
 int radio_setup_2g()
17  openiboot/ultrasn0w.h
... ...
@@ -0,0 +1,17 @@
  1
+/* Copyright iPhone DevTeam 2009
  2
+ * Leet Hax not for commercial use.
  3
+ * DO NOT SELL - STRICTLY NO COMMERCIAL USE.
  4
+ * CUSTOM PACKETS MUST NOT BE USED IN ANY OTHER THIRD PARTY PRODUCTS.
  5
+ * YOU HAVE BEEN WARNED.
  6
+ * Punishment: Monkeys coming out of your ass Bruce Almighty style.
  7
+ *
  8
+ * Thanks @Oranav for at+xlog injection vector
  9
+ */
  10
+
  11
+const char * ultrasn0w_042608 = "at+xlog=1,\"00001111222233334444555566667777\200\036\377\377\355\241(         \360nq@\020\001\021\001\215\376& Poq@0S%@\201\036\377\377\021!\t\001\0061\t\002J\034! \00103x\230Bpx\a\320A;A8\033\001\033\030\013p\0011\0026\361\347\220G\001 \0018\001\034\240G\255F\177\275\";\"AALFAIEIAKKBCGKCFCBKAFELJIEHAGEICHKBEPKCFCBKACELJIEHADEIIAEHAALNCMIIEACAMACPEJEACACMEJEAMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIDALFBBENIFLABBELCIBMGJEGPPCCJIEHAAJLANCLBBNBABJJANELAKGIBKGAAEDDEKGIBKGAIKGIALELBDGAALELFDGAALELJDGAABCDMLGACACDAAJDCIBMGJEGPPCCAHELJIEHNPOHAAAAJMICBOEANIPPECCAFABGDAEAAAPPAAABABAEACAEADAEAEAEEAAAEDCAMAEGMAEGMAEGMAEGMAEGMAEGMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIPALFBFELIACECEABIJLABIIABDENCABMAPBMKIEHAGBMJICAKIEHAACCEECDBAEJMCGAADJDAKCDAFJDAMCDAAJCACJEAEJCAGJDAMEKABJGAACDALEMKAEHACBMAACIAENBAKEJDIBMAKELJIEHADOAAJEJDIBMAHELJIEHAJLAPALNLINDBOEAPAJDBECAKECMEJEAMACPEJEALEOFEDCALACMEJEAPABBELCALECMEJEAGEGFHGHEGFGBGNDBAAAAAAAAEPELCBAAEFFCFCEPFCCACFGEAAAA\"\r\n";
  12
+
  13
+const char * ultrasn0w_051107 = "at+xapp=\"........................................\200\036\377\377........\361\335'         \370\242l@\020\001\021\001\365uS \230\243l@NI\037@\201\036\377\377\021!\t\001\0061\t\002J\034! \00103x\230Bpx\a\320A;A8\033\001\033\030\013p\0011\0026\361\347\220G\001 \0018\001\034\240G\255F\177\275\";\"AALFAIEIAKKBCGKCFCBKAFELJIEHAGEICHKBEPKCFCBKACELJIEHADEIIAEHAALNDIOEEACAOAEDEDEAEAEAEDEAMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIDALFBBENIFLABBELCIBMGJEGPPCCJIEHAAJLANCLBBNBABJJANELAKGIBKGAAEDDEKGIBKGAIKGIALELBDGAALELFDGAALELJDGAABCDMLGACACDAAJDCIBMGJEGPPCCAHELJIEHNPOHAAAACELJBOEAMEIOBGCAGAAODCEAAAPPAAABABAEACAEADAEAEAECMIPBGCAMAEGMAEGMAEGMAEGMAEGMAEGMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIPALFBFELIACECEABIJLABIIABDENCABMAPBMKIEHAGBMJICAKIEHAACCEECDBAEJMCGAADJDAKCDAFJDAMCDAAJCACJEAEJCAGJDAMEKABJGAACDALEMKAEHACBMAACIAENBAKEJDIBMAKELJIEHADOAAJEJDIBMAHELJIEHAJLAPALNDMAKBPEANEEJEBCAMEEAEDEAOAEDEDEAJAFLEECANAEAEDEACENJBOCANEEAEDEAGEGFHGHEGFGBGNDBAAAAAAAAEPELCBAAEFFCFCEPFCCACFGEAAAA\"\r\n";
  14
+
  15
+const char * ultrasn0w_051201 = "at+xapp=\"........................................\200\036\377\377........y%(         \330\235l@\020\001\021\001\221$S x\236l@.D\037@\201\036\377\377\021!\t\001\0061\t\002J\034! \00103x\230Bpx\a\320A;A8\033\001\033\030\013p\0011\0026\361\347\220G\001 \0018\001\034\240G\255F\177\275\";\"AALFAIEIAKKBCGKCFCBKAFELJIEHAGEICHKBEPKCFCBKACELJIEHADEIIAEHAALNPIMBEACAMADOEDEACADLEDEAMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIDALFBBENIFLABBELCIBMGJEGPPCCJIEHAAJLANCLBBNBABJJANELAKGIBKGAAEDDEKGIBKGAIKGIALELBDGAALELFDGAALELJDGAABCDMLGACACDAAJDCIBMGJEGPPCCAHELJIEHNPOHAAAAAELEBOEAGEPKBGCAEAAJDCEAAAPPAAABABAEACAEADAEAEAEMMPKBGCAMAEGMAEGMAEGMAEGMAEGMAEGMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIPALFBFELIACECEABIJLABIIABDENCABMAPBMKIEHAGBMJICAKIEHAACCEECDBAEJMCGAADJDAKCDAFJDAMCDAAJCACJEAEJCAGJDAMEKABJGAACDALEMKAEHACBMAACIAENBAKEJDIBMAKELJIEHADOAAJEJDIBMAHELJIEHAJLAPALNBMAFBPEAJMCJEBCAKEDLEDEAMADOEDEAOAOGEDCALADLEDEAKIGABPCALEDLEDEAGEGFHGHEGFGBGNDBAAAAAAAAEPELCBAAEFFCFCEPFCCACFGEAAAA\"\r\n";
  16
+
  17
+const char * ultrasn0w_051304 = "at+xapp=\"........................................\200\036\377\377........\001<(         \270\242l@\020\001\021\001\211f& X\243l@>D\037@\201\036\377\377\021!\t\001\0061\t\002J\034! \00103x\230Bpx\a\320A;A8\033\001\033\030\013p\0011\0026\361\347\220G\001 \0018\001\034\240G\255F\177\275\";\"AALFAIEIAKKBCGKCFCBKAFELJIEHAGEICHKBEPKCFCBKACELJIEHADEIIAEHAALNNINKBDCAKADPEDEAAADMEDEAMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIDALFBBENIFLABBELCIBMGJEGPPCCJIEHAAJLANCLBBNBABJJANELAKGIBKGAAEDDEKGIBKGAIKGIALELBDGAALELFDGAALELJDGAABCDMLGACACDAAJDCIBMGJEGPPCCAHELJIEHNPOHAAAABELEBOEAPINOBGCAIAAJDCEAAAPPAAABABAEACAEADAEAEAEEADKEDCAMAEGMAEGMAEGMAEGMAEGMAEGMAEGMAEGPOFPCNOJAAAAAAPKPOJPLNOIPALFBFELIACECEABIJLABIIABDENCABMAPBMKIEHAGBMJICAKIEHAACCEECDBAEJMCGAADJDAKCDAFJDAMCDAAJCACJEAEJCAGJDAMEKABJGAACDALEMKAEHACBMAACIAENBAKEJDIBMAKELJIEHADOAAJEJDIBMAHELJIEHAJLAPALNCMAFBPEADMDCBECAIEDMEDEAKADPEDEACAMPBHCAJADMEDEAKEOEELCAJEDMEDEAGEGFHGHEGFGBGNDBAAAAAAAAEPELCBAAEFFCFCEPFCCACFGEAAAA\"\r\n";

0 notes on commit 2bcd24c

Please sign in to comment.
Something went wrong with that request. Please try again.