Permalink
Browse files

Adding standalone mode for payloads and symbols for 3.55

  • Loading branch information...
1 parent e10bf98 commit 44aed27539f535fa14d77994d6dff1b1069a212f @kakaroto committed Feb 27, 2011
Showing with 95 additions and 8 deletions.
  1. +20 −3 Makefile
  2. +62 −1 firmware_symbols.h.S
  3. +2 −0 memory_patching.h.S
  4. +4 −1 memory_patching_res.h.S
  5. +7 −3 pl3.h.S
View
@@ -23,25 +23,39 @@ FW_PAYLOADS = \
payload_trace_all_sc_calls.bin \
payload_trace_vuart.bin
+STANDALONE_FIRMWARES = 3.55
+STANDALONE_PAYLOADS = \
+ default_payload.bin \
+ payload_no_unauth_syscall.bin
+
FIRMWARES_2=$(SUPPORTED_FIRMWARES:2.%=2_%)
FIRMWARES=$(FIRMWARES_2:3.%=3_%)
FW_PAYLOADS_EXT = $(foreach fw,$(FIRMWARES), \
$(foreach pl,$(FW_PAYLOADS),$(pl:%.bin=%_$(fw).bin)))
-ALL_PAYLOADS = $(PAYLOADS) $(FW_PAYLOADS_EXT)
+
+ST_FIRMWARES=$(STANDALONE_FIRMWARES:3.%=3_%)
+STANDALONE_PAYLOADS_EXT = $(foreach fw,$(ST_FIRMWARES), \
+ $(foreach pl,$(STANDALONE_PAYLOADS),$(pl:%.bin=%_$(fw).bin)))
+
+SIZE_LIMITED_PAYLOADS = $(PAYLOADS) $(FW_PAYLOADS_EXT)
+ALL_PAYLOADS = $(SIZE_LIMITED_PAYLOADS) $(STANDALONE_PAYLOADS_EXT)
HEADERS = $(ALL_PAYLOADS:%.bin=%.h)
MAX_PAYLOAD_SIZE=4064
all: tools $(ALL_PAYLOADS) $(HEADERS) check_sizes
+ echo "PAYLOADS: $(ALL_PAYLOADS)"
+ echo "ST_PAYLOADS: $(STANDALONE_PAYLOADS_EXT)"
+ echo "HEADERS: $(HEADERS)"
tools:
$(MAKE) -C tools
$(B2HTARGET): tools
@true
-check_sizes: $(ALL_PAYLOADS)
+check_sizes: $(SIZE_LIMITED_PAYLOADS)
@error=0; \
for f in $+; do \
size=`ls -l $$f | awk '{print $$5}'`; \
@@ -101,7 +115,10 @@ $(ALL_PAYLOADS): *.h.S config.h
$(PPU_CC) $(PPU_CFLAGS) -DFIRMWARE_3_41 -c $< -o $@
%_3_41_kiosk.o : %.S
- $(PPU_CC) $(PPU_CFLAGS) -DFIRMWARE_3_41 -DKIOSK -c $< -o $@
+ $(PPU_CC) $(PPU_CFLAGS) -DFIRMWARE_3_41 -DKIOSK -c $< -o $@
+
+%_3_55.o : %.S
+ $(PPU_CC) $(PPU_CFLAGS) -DFIRMWARE_3_55 -DSTANDALONE -c $< -o $@
%.o : %.S
$(PPU_CC) $(PPU_CFLAGS) -c $< -o $@
View
@@ -16,7 +16,68 @@
#ifndef __FIRMWARE_SYMBOLS_H_S__
#define __FIRMWARE_SYMBOLS_H_S__
-#ifdef FIRMWARE_3_41
+#ifdef FIRMWARE_3_55
+
+// TOC at 0x330540
+// Shell code addr
+
+/* Common Symbols */
+
+#define memcpy 0x7c3a4
+#define memset 0x4e4d8
+#define strcpy 0x4e684
+#define strncmp 0x4E6D8
+#define strlen 0x4E6AC
+#define pathdup_from_user 0x18DC68
+#define copy_from_user 0xf8c0
+#define copy_to_user 0xf6a4
+#define alloc_and_copy_from_user 0x18DE28
+#define strdup_from_user 0x192B8C
+#define alloc 0x60B78
+#define free 0x60FB4
+
+#define syscall_table 0x346570
+#define memory_patch_func 0x1c34c
+#define patch_func1 0x323C
+#define patch_func1_offset 0x34
+#define patch_func2 0x7A7C4
+#define patch_func2_offset 0x2C
+#define patch_func3 0x2B3274 // hooked_open
+#define patch_func3_offset 0x24
+#define patch_func4 0x79D80
+#define patch_func4_offset 0x118
+#define patch_func5 0xE7F0
+#define patch_func5_offset 0x0
+#define patch_func6 0x24DC4
+#define patch_func6_offset 0x80
+#define patch_func7 0xC1DA4 // syscall_512
+#define patch_func7_offset 0x2C
+#define patch_func8 0x55D20 //lv2open update patch
+#define patch_func8_offset1 0xA4 //lv2open update patch
+#define patch_func8_offset2 0x208 //lv2open update patch
+#define patch_func9 0x7AB90 // must upgrade error
+#define patch_func9_offset 0x3EC
+#define patch_syscall_func 0x297db0
+#define patch_data1 0x3c2f00
+#define rtoc_entry_1 0x1030
+#define rtoc_entry_2 -0x5B80
+
+#define lv2_printf 0x29285C
+#define lv2_printf_null 0x2972CC
+#define hvsc107_1 0xFC3C
+#define hvsc107_2 0xFCD0
+#define hvsc107_3 0xFB0C
+
+// Payload bases
+//#define MEM_BASE2 0xECF0
+#define MEM_BASE2 0xEF48
+
+#define RESIDENT_AREA_MAXSIZE 1452
+
+// Standalone payload, does not need file patching
+#define STANDALONE
+
+#elif defined(FIRMWARE_3_41)
/* Common Symbols */
#define memcpy 0x7c01c
View
@@ -106,6 +106,7 @@ loc_4d4:
mr %r3, %r29
mr %r4, %r30
BRANCH_ABSOLUTE(%r6, memory_patch_func)
+#ifndef STANDALONE
mr %r29, %r31
LOADI_LABEL2(%r29, counter)
lwz %r3, 0(%r29)
@@ -152,6 +153,7 @@ loc_574:
stw %r4, 0(%r3)
addi %r5, %r5, 8
b loc_574
+#endif
loc_594:
li %r3, 0
ld %r27, 0x78(%r1)
View
@@ -17,7 +17,8 @@
#define __MEMORY_PATCHING_RES_H_S__
DEFINE_FUNC_PTR(memory_patching)
-
+
+#ifndef STANDALONE
counter:
.long 0
@@ -52,4 +53,6 @@ memory_patch_table_4:
PATCH_DATA(elf4_data + 12, 0x6f6f7400)
.long 0
+#endif /* !STANDALONE */
+
#endif /* __MEMORY_PATCHING_RES_H_S__ */
View
10 pl3.h.S
@@ -19,10 +19,14 @@
#define PAGE_SIZE 0x1000
-#ifdef USE_JIG
-#define PAYLOAD_OFFSET_IN_PAGE 0x20
+#ifdef STANDALONE
+# define PAYLOAD_OFFSET_IN_PAGE 0
#else
-#define PAYLOAD_OFFSET_IN_PAGE 0x38
+# ifdef USE_JIG
+# define PAYLOAD_OFFSET_IN_PAGE 0x20
+# else
+# define PAYLOAD_OFFSET_IN_PAGE 0x38
+# endif
#endif
#define RESIDENT_AREA_OFFSET (resident_area_start)

0 comments on commit 44aed27

Please sign in to comment.