Permalink
Browse files

iOS5 support; MinGW build fixes

  • Loading branch information...
1 parent aff6c4a commit 6ef3cea6b6c12e34c8c127222bb7fccfa3eac0ff @msftguy committed Dec 29, 2011
Showing with 114 additions and 83 deletions.
  1. +4 −1 .gitignore
  2. +51 −73 external/Win32/limera1n.h
  3. +8 −0 payload.mk
  4. +6 −1 platform.mk
  5. +3 −1 syringe/Makefile
  6. +39 −6 utilities/tetheredboot.c
  7. +3 −1 utilities/utilities.mk
View
5 .gitignore
@@ -31,6 +31,9 @@ ipch/*
/loadibec
.DS_Store
+# Binaries (Win32 mingw)
+utilities/*.exe
+
# Misc
tetheredboot-Debug/*
@@ -45,4 +48,4 @@ tools/bin2c.exe
Debug-Dynlink
ipch
-Release-Dynlink
+Release-Dynlink
View
124 external/Win32/limera1n.h
@@ -1,74 +1,52 @@
-/**
- * GreenPois0n Syringe
- * Copyright (C) 2010 Chronic-Dev Team
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef limera1n_H
-#define limera1n_H
-
-const unsigned char limera1n_payload[] = {
- 0x7f, 0x46, 0x07, 0xe0, 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46,
- 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46, 0x65, 0x48, 0x02, 0x68,
- 0x65, 0x48, 0x90, 0x42, 0x06, 0xd1, 0x65, 0x49, 0x39, 0x60, 0x65, 0x49,
- 0x79, 0x60, 0x65, 0x49, 0xb9, 0x60, 0x1c, 0xe0, 0x64, 0x48, 0x90, 0x42,
- 0x06, 0xd1, 0x64, 0x49, 0x39, 0x60, 0x64, 0x49, 0x79, 0x60, 0x64, 0x49,
- 0xb9, 0x60, 0x12, 0xe0, 0x63, 0x48, 0x90, 0x42, 0x06, 0xd1, 0x63, 0x49,
- 0x39, 0x60, 0x63, 0x49, 0x79, 0x60, 0x63, 0x49, 0xb9, 0x60, 0x08, 0xe0,
- 0x62, 0x48, 0x90, 0x42, 0x05, 0xd1, 0x62, 0x49, 0x39, 0x60, 0x5e, 0x49,
- 0x79, 0x60, 0x61, 0x49, 0xb9, 0x60, 0x61, 0x48, 0x61, 0x49, 0x3b, 0x68,
- 0x98, 0x47, 0x61, 0x48, 0x5e, 0x49, 0x4a, 0x68, 0x00, 0xf0, 0x88, 0xf8,
- 0x00, 0x28, 0xcb, 0xd0, 0x06, 0x1c, 0x5e, 0x48, 0x5a, 0x49, 0x4a, 0x68,
- 0x00, 0xf0, 0x80, 0xf8, 0x00, 0x28, 0xc3, 0xd0, 0x05, 0x1c, 0x11, 0x20,
- 0x14, 0x24, 0x29, 0x19, 0x2a, 0x19, 0x30, 0x23, 0x58, 0x4c, 0x00, 0x94,
- 0x00, 0x24, 0x01, 0x94, 0x00, 0x24, 0x02, 0x94, 0x7c, 0x68, 0xa0, 0x47,
- 0x11, 0x20, 0x0c, 0x24, 0x31, 0x19, 0x32, 0x19, 0xb3, 0x68, 0x53, 0x4c,
- 0x00, 0x94, 0x24, 0x24, 0x64, 0x19, 0x01, 0x94, 0x14, 0x24, 0x64, 0x19,
- 0x02, 0x94, 0x7c, 0x68, 0xa0, 0x47, 0x49, 0x48, 0x0c, 0x21, 0x89, 0x19,
- 0xb2, 0x68, 0x15, 0x1c, 0x00, 0xf0, 0x52, 0xf8, 0x4b, 0x48, 0x45, 0x49,
- 0x2a, 0x1c, 0x00, 0xf0, 0x55, 0xf8, 0x00, 0x28, 0x08, 0xd0, 0x01, 0x1c,
- 0x48, 0x48, 0x49, 0x4a, 0x00, 0xf0, 0x4e, 0xf8, 0x00, 0x28, 0x01, 0xd0,
- 0x47, 0x49, 0x01, 0x60, 0x47, 0x48, 0x3d, 0x49, 0x2a, 0x1c, 0x00, 0xf0,
- 0x45, 0xf8, 0x00, 0x28, 0x08, 0xd0, 0x01, 0x1c, 0x44, 0x48, 0x41, 0x4a,
- 0x00, 0xf0, 0x3e, 0xf8, 0x00, 0x28, 0x01, 0xd0, 0x42, 0x49, 0x01, 0x60,
- 0x42, 0x48, 0x35, 0x49, 0x2a, 0x1c, 0x00, 0xf0, 0x35, 0xf8, 0x00, 0x28,
- 0x08, 0xd0, 0x01, 0x1c, 0x3f, 0x48, 0x39, 0x4a, 0x00, 0xf0, 0x2e, 0xf8,
- 0x00, 0x28, 0x01, 0xd0, 0x37, 0x49, 0x01, 0x60, 0x3c, 0x48, 0x2d, 0x49,
- 0x2a, 0x1c, 0x3c, 0x4b, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, 0x0f, 0xd1,
- 0x3a, 0x48, 0x29, 0x49, 0x2a, 0x1c, 0x3a, 0x4b, 0x00, 0xf0, 0x1e, 0xf8,
- 0x00, 0x28, 0x07, 0xd1, 0x38, 0x48, 0x25, 0x49, 0x2a, 0x1c, 0x38, 0x4b,
- 0x00, 0xf0, 0x16, 0xf8, 0x00, 0x28, 0x03, 0xd0, 0x36, 0x49, 0x01, 0x60,
- 0x36, 0x49, 0x41, 0x60, 0x00, 0x20, 0x1f, 0x49, 0x00, 0x22, 0xbb, 0x68,
- 0x98, 0x47, 0x4d, 0xe7, 0x0b, 0x78, 0x03, 0x70, 0x01, 0x30, 0x01, 0x31,
- 0x01, 0x3a, 0x00, 0x2a, 0xf8, 0xd1, 0x70, 0x47, 0x00, 0x23, 0xff, 0xe7,
- 0x10, 0xb5, 0x0c, 0x68, 0x84, 0x42, 0x04, 0xd1, 0x00, 0x2b, 0x07, 0xd0,
- 0x4c, 0x68, 0x9c, 0x42, 0x04, 0xd0, 0x02, 0x31, 0x02, 0x3a, 0x00, 0x2a,
- 0xf3, 0xd1, 0x00, 0x21, 0x08, 0x1c, 0x10, 0xbd, 0x88, 0x02, 0x00, 0x00,
- 0x39, 0x2e, 0x35, 0x00, 0xe5, 0x36, 0x00, 0x00, 0x19, 0x09, 0x00, 0x00,
- 0xdd, 0x39, 0x00, 0x00, 0x34, 0x2e, 0x34, 0x00, 0x85, 0x4c, 0x00, 0x00,
- 0x6d, 0x68, 0x00, 0x00, 0x5d, 0x5a, 0x00, 0x00, 0x39, 0x2e, 0x33, 0x00,
- 0x9d, 0x34, 0x00, 0x00, 0x25, 0x09, 0x00, 0x00, 0x69, 0x39, 0x00, 0x00,
- 0x39, 0x2e, 0x33, 0x2e, 0xa5, 0x34, 0x00, 0x00, 0x71, 0x39, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x84, 0x00, 0xc0, 0x02, 0x00, 0x41, 0x54, 0x41, 0x44,
- 0x47, 0x41, 0x42, 0x4b, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20,
- 0x1a, 0x78, 0xff, 0x2a, 0x4f, 0xf0, 0xff, 0x30, 0x00, 0x02, 0x00, 0x00,
- 0x00, 0x20, 0x00, 0x20, 0xf3, 0xdf, 0x90, 0xb5, 0x07, 0x4b, 0x1b, 0x68,
- 0x4f, 0xf0, 0xff, 0x33, 0x11, 0x9a, 0xd3, 0xf1, 0x18, 0xbf, 0x01, 0x20,
- 0x80, 0xb5, 0x00, 0xaf, 0x82, 0xb0, 0x4f, 0xf0, 0xb0, 0xb5, 0x02, 0xaf,
- 0x82, 0xb0, 0x01, 0x28, 0x90, 0xb5, 0x01, 0xaf, 0x84, 0xb0, 0x4f, 0xf0,
- 0x00, 0x4b, 0x18, 0x47, 0x00, 0x00, 0x00, 0x41
+unsigned char limera1n_payload[] = {
+ 0x7f, 0x46, 0x07, 0xe0, 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46,
+ 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46, 0xc0, 0x46, 0x66, 0x48, 0x02, 0x68,
+ 0x66, 0x48, 0x90, 0x42, 0x06, 0xd1, 0x66, 0x49, 0x39, 0x60, 0x66, 0x49,
+ 0x79, 0x60, 0x66, 0x49, 0xb9, 0x60, 0x1c, 0xe0, 0x65, 0x48, 0x90, 0x42,
+ 0x06, 0xd1, 0x65, 0x49, 0x39, 0x60, 0x65, 0x49, 0x79, 0x60, 0x65, 0x49,
+ 0xb9, 0x60, 0x12, 0xe0, 0x64, 0x48, 0x90, 0x42, 0x06, 0xd1, 0x64, 0x49,
+ 0x39, 0x60, 0x64, 0x49, 0x79, 0x60, 0x64, 0x49, 0xb9, 0x60, 0x08, 0xe0,
+ 0x63, 0x48, 0x90, 0x42, 0x05, 0xd1, 0x63, 0x49, 0x39, 0x60, 0x5f, 0x49,
+ 0x79, 0x60, 0x62, 0x49, 0xb9, 0x60, 0x62, 0x48, 0x62, 0x49, 0x3b, 0x68,
+ 0x98, 0x47, 0x62, 0x48, 0x5f, 0x49, 0x4a, 0x68, 0x00, 0xf0, 0x89, 0xf8,
+ 0x00, 0x28, 0xcb, 0xd0, 0x06, 0x1c, 0x5f, 0x48, 0x5b, 0x49, 0x4a, 0x68,
+ 0x00, 0xf0, 0x81, 0xf8, 0x00, 0x28, 0xc3, 0xd0, 0x05, 0x1c, 0x11, 0x20,
+ 0x14, 0x24, 0x29, 0x19, 0x2a, 0x19, 0x30, 0x23, 0x59, 0x4c, 0x00, 0x94,
+ 0x00, 0x24, 0x01, 0x94, 0x00, 0x24, 0x02, 0x94, 0x7c, 0x68, 0xa0, 0x47,
+ 0x11, 0x20, 0x0c, 0x24, 0x31, 0x19, 0x32, 0x19, 0xb3, 0x68, 0x54, 0x4c,
+ 0x00, 0x94, 0x24, 0x24, 0x64, 0x19, 0x01, 0x94, 0x14, 0x24, 0x64, 0x19,
+ 0x02, 0x94, 0x7c, 0x68, 0xa0, 0x47, 0x4a, 0x48, 0x0c, 0x21, 0x89, 0x19,
+ 0xb2, 0x68, 0x15, 0x1c, 0x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0xf8, 0xd1, 0x70, 0x47, 0x00, 0x23,
+ 0xff, 0xe7, 0x10, 0xb5, 0x0c, 0x68, 0x84, 0x42, 0x04, 0xd1, 0x00, 0x2b,
+ 0x07, 0xd0, 0x4c, 0x68, 0x9c, 0x42, 0x04, 0xd0, 0x02, 0x31, 0x02, 0x3a,
+ 0x00, 0x2a, 0xf3, 0xd1, 0x00, 0x21, 0x08, 0x1c, 0x10, 0xbd, 0x00, 0x00,
+ 0x88, 0x02, 0x00, 0x00, 0x39, 0x2e, 0x35, 0x00, 0xe5, 0x36, 0x00, 0x00,
+ 0x19, 0x09, 0x00, 0x00, 0xdd, 0x39, 0x00, 0x00, 0x34, 0x2e, 0x34, 0x00,
+ 0x85, 0x4c, 0x00, 0x00, 0x6d, 0x68, 0x00, 0x00, 0x5d, 0x5a, 0x00, 0x00,
+ 0x39, 0x2e, 0x33, 0x00, 0x9d, 0x34, 0x00, 0x00, 0x25, 0x09, 0x00, 0x00,
+ 0x69, 0x39, 0x00, 0x00, 0x39, 0x2e, 0x33, 0x2e, 0xa5, 0x34, 0x00, 0x00,
+ 0x71, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0xc0, 0x02, 0x00,
+ 0x41, 0x54, 0x41, 0x44, 0x47, 0x41, 0x42, 0x4b, 0x00, 0x02, 0x00, 0x20,
+ 0x00, 0x00, 0x00, 0x20, 0x1a, 0x78, 0xff, 0x2a, 0x4f, 0xf0, 0xff, 0x30,
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0xf3, 0xdf, 0x90, 0xb5,
+ 0x07, 0x4b, 0x1b, 0x68, 0x4f, 0xf0, 0xff, 0x33, 0x11, 0x9a, 0xd3, 0xf1,
+ 0x18, 0xbf, 0x01, 0x20, 0x80, 0xb5, 0x00, 0xaf, 0x82, 0xb0, 0x4f, 0xf0,
+ 0xb0, 0xb5, 0x02, 0xaf, 0x82, 0xb0, 0x01, 0x28, 0x90, 0xb5, 0x01, 0xaf,
+ 0x84, 0xb0, 0x4f, 0xf0, 0x00, 0x4b, 0x18, 0x47, 0x00, 0x00, 0x00, 0x41
};
-
-#endif
+unsigned int limera1n_payload_len = 588;
View
8 payload.mk
@@ -1,3 +1,7 @@
+BASE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
+
+include $(BASE_DIR)/platform.mk
+
XXD = xxd
CROSS = arm-elf-
ARMCC = $(CROSS)gcc
@@ -10,10 +14,14 @@ PAYLOAD_SOURCE = $(PAYLOAD_NAME).S
ARMCFLAGS = -Wa,-mthumb
$(PAYLOAD_TARGET): $(PAYLOAD_SOURCE)
+ifdef PREBUILT_DIR
+ cp $(PREBUILT_DIR)/$(notdir $(PAYLOAD_TARGET)) $(PAYLOAD_TARGET)
+else
# $(ARMCC) -o $(PAYLOAD_NAME)_payload.o -c $(PAYLOAD_SOURCE) $(ARMCFLAGS) $(ARMLDFLAGS)
$(ARMAS) -mthumb -o $(PAYLOAD_NAME)_payload.o $(PAYLOAD_SOURCE)
$(ARMOBJCOPY) -O binary $(PAYLOAD_NAME)_payload.o $(PAYLOAD_NAME).payload
$(XXD) -i $(PAYLOAD_NAME).payload $(PAYLOAD_TARGET)
+endif
all: $(PAYLOAD_TARGET)
View
7 platform.mk
@@ -3,14 +3,19 @@ ifeq ($(UNAME),Darwin)
OS_SHARED_EXT = .dylib
OS_STATIC_EXT = .a
OS_EXEC_EXT =
+ LIBRARIES = $(COMMON_LIBRARIES) $(OSX_LIBRARIES)
else
- ifeq ($(UNAME),MINGW32_NT-5.1)
+ ifeq ($(findstring MINGW,$(UNAME)),MINGW)
OS_SHARED_EXT = .dll
OS_STATIC_EXT = .a
OS_EXEC_EXT = .exe
+ CC := gcc
+ LIBRARIES = $(COMMON_LIBRARIES) $(MINGW_LIBRARIES)
+ PREBUILT_DIR := $(BASE_DIR)/external/Win32
else
OS_SHARED = .so
OS_STATIC_EXT = .a
OS_EXEC_EXT =
+ LIBRARIES = $(COMMON_LIBRARIES) $(LINUX_LIBRARIES)
endif
endif
View
4 syringe/Makefile
@@ -14,8 +14,10 @@ SOURCES = \
PREMADE_OBJECTS = exploits/limera1n.o exploits/steaks4uce.o
-LIBRARIES = usb-1.0 curl z
+OSX_LIBRARIES = usb-1.0
+COMMON_LIBRARIES = curl z
LDFLAGS = -L/opt/local/lib
+CFLAGS = -DCURL_STATICLIB=1
TARGET = syringe
View
45 utilities/tetheredboot.c
@@ -60,7 +60,7 @@ void print_progress(double progress, void* data) {
void usage()
{
- printf("Usage: tetheredboot -i <ibss> -k <kernelcache> [-r <ramdisk>] [-b <bgcolor>] [-l <bootlogo.img3>]\n");
+ printf("Usage: tetheredboot -i <ibss> [-b <ibec>] -k <kernelcache> [-r <ramdisk>] [-c <bgcolor>] [-l <bootlogo.img3>]\n");
exit(0);
}
@@ -73,6 +73,7 @@ int main(int argc, char* argv[]) {
//int index;
const char
*ibssFile = NULL,
+ *ibecFile = NULL,
*kernelcacheFile = NULL,
*ramdiskFile = NULL,
*bgcolor = NULL,
@@ -81,7 +82,7 @@ int main(int argc, char* argv[]) {
opterr = 0;
- while ((c = getopt (argc, argv, "vhi:k:r:l:b:")) != -1)
+ while ((c = getopt (argc, argv, "vhi:b:k:r:l:c:")) != -1)
switch (c)
{
case 'v':
@@ -97,6 +98,13 @@ int main(int argc, char* argv[]) {
}
ibssFile = optarg;
break;
+ case 'b':
+ if (!file_exists(optarg)) {
+ error("Cannot open iBEC file '%s'\n", optarg);
+ return -1;
+ }
+ ibecFile = optarg;
+ break;
case 'k':
if (!file_exists(optarg)) {
error("Cannot open kernelcache file '%s'\n", optarg);
@@ -118,7 +126,7 @@ int main(int argc, char* argv[]) {
}
bootlogo = optarg;
break;
- case 'b':
+ case 'c':
bgcolor = optarg;
break;
default:
@@ -154,14 +162,39 @@ int main(int argc, char* argv[]) {
debug("%s\n", irecv_strerror(ir_error));
return -1;
}
+
+ sleep(10);
+
} else {
return 0;
}
+ if (ibecFile != NULL) {
+ client = irecv_reconnect(client, 10);
+
+ debug("Uploading iBEC %s to device\n", ibecFile);
+ ir_error = irecv_send_file(client, ibecFile, 1);
+ if(ir_error != IRECV_E_SUCCESS) {
+ error("Unable to upload iBEC\n");
+ debug("%s\n", irecv_strerror(ir_error));
+ return -1;
+ }
+
+ sleep(5);
+
+ ir_error = irecv_send_command(client, "go");
+ if(ir_error != IRECV_E_SUCCESS) {
+ error("Unable send the go command\n");
+ return -1;
+ }
+
+ sleep(5);
+ }
+
client = irecv_reconnect(client, 10);
if (ramdiskFile != NULL) {
- debug("Uploading %s to device\n", ramdiskFile);
+ debug("Uploading ramdisk %s to device\n", ramdiskFile);
ir_error = irecv_send_file(client, ramdiskFile, 1);
if(ir_error != IRECV_E_SUCCESS) {
error("Unable to upload ramdisk\n");
@@ -173,13 +206,13 @@ int main(int argc, char* argv[]) {
ir_error = irecv_send_command(client, "ramdisk");
if(ir_error != IRECV_E_SUCCESS) {
- error("Unable send the bootx command\n");
+ error("Unable send the ramdisk command\n");
return -1;
}
}
if (bootlogo != NULL) {
- debug("Uploading %s to device\n", bootlogo);
+ debug("Uploading boot logo %s to device\n", bootlogo);
ir_error = irecv_send_file(client, bootlogo, 1);
if(ir_error != IRECV_E_SUCCESS) {
error("Unable to upload bootlogo\n");
View
4 utilities/utilities.mk
@@ -1,7 +1,9 @@
INCLUDES = ../include
SOURCES = $(TARGET).c
-LIBRARIES = syringe usb-1.0 curl z
+OSX_LIBRARIES = usb-1.0
+MINGW_LIBRARIES = ws2_32 setupapi
+COMMON_LIBRARIES = syringe curl z
LDFLAGS = -L../syringe -L/opt/local/lib
include ../common.mk

0 comments on commit 6ef3cea

Please sign in to comment.