|
From: <bob...@us...> - 2007-07-22 06:54:04
|
Revision: 1197
http://svn.sourceforge.net/hackndev/?rev=1197&view=rev
Author: bobofdoom
Date: 2007-07-21 23:54:01 -0700 (Sat, 21 Jul 2007)
Log Message:
-----------
Cocoboot: Added GSM unlock code dumping to info menu.
* Note: This does NOT allow you to unlock a locked Treo. It only shows the
code from an already unlocked phone.
Modified Paths:
--------------
cocoboot/trunk/Changelog
cocoboot/trunk/include/cocoboot.rcp
cocoboot/trunk/include/cocoboot_r.h
cocoboot/trunk/m68k/mainform.c
Modified: cocoboot/trunk/Changelog
===================================================================
--- cocoboot/trunk/Changelog 2007-07-22 02:50:44 UTC (rev 1196)
+++ cocoboot/trunk/Changelog 2007-07-22 06:54:01 UTC (rev 1197)
@@ -1,3 +1,6 @@
+ - Added GSM unlock code to info menu (unlocked GSM Treos only).
+ - Added basic memory tracing.
+
version 0.4:
- Fixed 'c01d' error introduced in 0.3 on LD, TX etc.
- Added reading of a config file.
Modified: cocoboot/trunk/include/cocoboot.rcp
===================================================================
--- cocoboot/trunk/include/cocoboot.rcp 2007-07-22 02:50:44 UTC (rev 1196)
+++ cocoboot/trunk/include/cocoboot.rcp 2007-07-22 06:54:01 UTC (rev 1197)
@@ -26,6 +26,7 @@
MENUITEM "LCD registers (PXA only)" MenuItemLCD
MENUITEM "LCD test (PXA only)" MenuItemLCDTest
MENUITEM "Dump MMU" MenuItemDumpMMU
+ MENUITEM "GSM Unlock Code" MenuItemGsmCode
END
PULLDOWN "Tools"
BEGIN
Modified: cocoboot/trunk/include/cocoboot_r.h
===================================================================
--- cocoboot/trunk/include/cocoboot_r.h 2007-07-22 02:50:44 UTC (rev 1196)
+++ cocoboot/trunk/include/cocoboot_r.h 2007-07-22 06:54:01 UTC (rev 1197)
@@ -18,6 +18,7 @@
#define MenuItemConsole 1006
#define MenuItemStartIrqTrace 1007
#define MenuItemDumpTraceLog 1008
+#define MenuItemGsmCode 1009
#define ErrorAlert 1000
#define InfoAlert 1001
Modified: cocoboot/trunk/m68k/mainform.c
===================================================================
--- cocoboot/trunk/m68k/mainform.c 2007-07-22 02:50:44 UTC (rev 1196)
+++ cocoboot/trunk/m68k/mainform.c 2007-07-22 06:54:01 UTC (rev 1197)
@@ -264,6 +264,24 @@
FrmCustomAlert(InfoAlert, "Error writing to /cocoboot.memtrace.", " ", " ");
}
+void show_gsm_code(void)
+{
+ char *buf = 0;
+ UInt16 len;
+ char buf2[256];
+ int i;
+ SysGetROMToken(0, 'GoUc', &buf, &len);
+ if (!buf || len == 0xffff) {
+ FrmCustomAlert(InfoAlert, "Code not found.", "This option only works on unlocked GSM phones. It does not allow you to unlock a locked phone.", " ");
+ return;
+ }
+ strncpy(buf2, buf, len < 256 ? len : 256);
+ buf2[len] = 0;
+ for (i=0; i<len; i++)
+ buf2[i] -= 13;
+ FrmCustomAlert(InfoAlert, "GSM unlock code:", buf2, " ");
+}
+
UInt32 load_parts(int n, char *name, void **image)
{
/* more ugly code... */
@@ -402,7 +420,11 @@
return true;
case MenuItemDumpTraceLog:
dump_trace_log();
+ return true;
+ case MenuItemGsmCode:
+ show_gsm_code();
return true;
+
}
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|