Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add built-in ultrasn0w unlock to openiboot

  • Loading branch information...
commit 2bcd24c68d858e778e393965f991856d07c4c45a 1 parent b54f1ad
@marcan marcan authored
Showing with 54 additions and 1 deletion.
  1. +37 −1 openiboot/radio.c
  2. +17 −0 openiboot/ultrasn0w.h
View
38 openiboot/radio.c
@@ -7,6 +7,7 @@
#include "uart.h"
#include "pmu.h"
#include "wmcodec.h"
+#include "ultrasn0w.h"
// For the +XDRV stuff, it's usually device,function,arg1,arg2,arg3,...
// device 4 seems to be the vibrator, device 0 seems to be the speakers,
@@ -23,6 +24,8 @@ static char* response_buf;
#ifdef CONFIG_3G
int radio_setup_3g()
{
+ int res;
+ const char *unlock = NULL;
response_buf = malloc(RESPONSE_BUF_SIZE);
gpio_pulldown_configure(RADIO_BB_PULLDOWN, GPIOPDDown);
@@ -57,7 +60,40 @@ int radio_setup_3g()
speaker_setup();
- return 0;
+ if(!(res = radio_cmd("at+xgendata\r\n", 10)))
+ {
+ bufferPrintf("radio: failed to check version!\r\n");
+ return -1;
+ }
+
+ if(strstr(response_buf, "ICE2_MODEM_04.26.08")) {
+ bufferPrintf("radio: baseband version is 04.26.08\r\n");
+ unlock = ultrasn0w_042608;
+ } else if(strstr(response_buf, "ICE2_MODEM_05.11.07")) {
+ bufferPrintf("radio: baseband version is 05.11.07\r\n");
+ unlock = ultrasn0w_051107;
+ } else if(strstr(response_buf, "ICE2_MODEM_05.12.01")) {
+ bufferPrintf("radio: baseband version is 05.12.01\r\n");
+ unlock = ultrasn0w_051201;
+ } else if(strstr(response_buf, "ICE2_MODEM_05.13.04")) {
+ bufferPrintf("radio: baseband version is 05.13.04\r\n");
+ unlock = ultrasn0w_051304;
+ } else {
+ bufferPrintf("radio: unknown baseband version\n");
+ bufferPrintf("radio: unlock not available\n");
+ return 0;
+ }
+
+ bufferPrintf("radio: sending ultrasn0w unlock string.\r\n");
+ res = radio_cmd(unlock, 10);
+ if (res == TRUE)
+ bufferPrintf("radio: ultrasn0w successful\r\n");
+ else {
+ bufferPrintf("radio: ultrasn0w UNSUCCESSFUL\r\n");
+ bufferPrintf("radio: buffer is %s\r\n", response_buf);
+ }
+
+ return res;
}
#else
int radio_setup_2g()
View
17 openiboot/ultrasn0w.h
@@ -0,0 +1,17 @@
+/* Copyright iPhone DevTeam 2009
+ * Leet Hax not for commercial use.
+ * DO NOT SELL - STRICTLY NO COMMERCIAL USE.
+ * CUSTOM PACKETS MUST NOT BE USED IN ANY OTHER THIRD PARTY PRODUCTS.
+ * YOU HAVE BEEN WARNED.
+ * Punishment: Monkeys coming out of your ass Bruce Almighty style.
+ *
+ * Thanks @Oranav for at+xlog injection vector
+ */
+
+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";
+
+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";
+
+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";
+
+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";
Please sign in to comment.
Something went wrong with that request. Please try again.