From 9a2746f1f82ca9f000201e27cd9ac08542c131b4 Mon Sep 17 00:00:00 2001 From: Zarh Date: Mon, 9 Sep 2019 23:05:09 +0200 Subject: [PATCH] v0.91 --- ChangeLog.txt | 8 + Makefile | 2 +- data/payload_485C.bin | Bin 0 -> 10936 bytes payload/source/FIRMWARES | 1 + payload/source/Makefile | 3 +- payload/source/symbols.h | 11 + source/data.h | 42 +++ source/firmware.c | 733 +++++++++++++++++++++++++++++++++++++++ source/firmware.h | 17 + source/main.c | 732 +------------------------------------- 10 files changed, 817 insertions(+), 732 deletions(-) create mode 100644 data/payload_485C.bin create mode 100644 payload/source/FIRMWARES create mode 100644 source/data.h create mode 100644 source/firmware.c diff --git a/ChangeLog.txt b/ChangeLog.txt index b40d0df..36dd62c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +v0.91 +-Add : Support fw 4.85C + +v0.90 +-Add : Support fw 4.84C and 4.84D + +Note : Updated by theheroGAC + v0.89 -Add : Support fw 4.83C diff --git a/Makefile b/Makefile index f1ca2a0..e1ae664 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ include $(PSL1GHT)/ppu_rules # SOURCES is a list of directories containing source code # INCLUDES is a list of directories containing extra header files #--------------------------------------------------------------------------------- -VERSION := 0.90 +VERSION := 0.91 NAME := IDPSet TARGET := $(NAME)_v$(VERSION) diff --git a/data/payload_485C.bin b/data/payload_485C.bin new file mode 100644 index 0000000000000000000000000000000000000000..bb581d8ab03a4337693f2c504404e8ba24fbe9ae GIT binary patch literal 10936 zcmbta3s@6p);>c*2sM@{SXr?e1Xom@8Y4KjQRBH`JRMhsTt(Q@TKLb*$ zR$bKU>Q*rnrFiKsTIwAIwcdJ>TI+gcLD`ysuBg~1pv<0cGM}b4H=mv78D{3Z?|IMp z&iBp9I3uU@E3q-4wuKAt+S6f?JrQ_&IIwmGvTSuQ%~k~lTM?w$a$$rm9a3zGpx5ew zVUui%$w^=`B$YO$K<7Y$SrD_3BXTY1V?kdFYFJUrikeo`wqguzI22egCa08@4C6rq z9=4p=q!Pro^ZLWB+-W)%`&Kr;X#&I2r7#a$_P&Q)=ZeDH2_#=0K{wq7+MG# z%M9QtZpnlcEr1`#Fq0p%fdP0wP9xt=F;1#aoB?(X2I#>ph+v&_cfxlQoWym;F)tu7 zYzqK5=)QdjFwyjy9JvKOLRh0Bl8eyj^*nUtAao`N7+>OQjlic0LOtPPO(9wapwER+ zE>l(#-4h@&5AB-)l0ayduGN+dP-~6Ced0s%5#!K#t`lr_M!1dR0dYLWfO4DREuN2fc^?6|0wED$Bajd?Q5|HwYEm_c;4R5Z7l+*maF&}E6@x6lo!067hL59 zZ|?;U@`88pgxk`^`RGVF-sS`A5lp#m>J{ns6dNiMPsMm$^F}B9rT)K%FMm5~v zUA^GXdcnJS!Ml6GqrKn*J>l5Pr(vDqCmB3CA@+`am+}cw2YUI(^AkK5D;0xvs`1>Agxh-r}R)P|9_w z=NQj0%JD&OIOV$1!+7I7;n)Xl_HeOBkEcA0>1+Rgllr)cJ;4)>b7#YT+=Ttuf_c

0aCK`XZ}CxY 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 USG%!Cxv}fr*cZ96|0d7>0>znx82|tP literal 0 HcmV?d00001 diff --git a/payload/source/FIRMWARES b/payload/source/FIRMWARES new file mode 100644 index 0000000..918dd12 --- /dev/null +++ b/payload/source/FIRMWARES @@ -0,0 +1 @@ +PAYLOADS :=421C 421D 430C 430D 431C 440C 441C 441D 446C 446D 450C 450D 453C 453D 455C 455D 460C 465C 465D 470C 470D 475C 475D 476C 476D 478C 478D 480C 480D 481C 481D 482C 482D 483C 484C 484D 485C diff --git a/payload/source/Makefile b/payload/source/Makefile index 5b7b6f2..c9347e1 100644 --- a/payload/source/Makefile +++ b/payload/source/Makefile @@ -15,8 +15,7 @@ ifeq ($(BUILD_TYPE),debug) endif LDFLAGS = -Tldscript.ld -nostartfiles -nostdlib -nodefaultlibs -Wl,--gc-sections -Wl,-Map=$(TARGET)_$@.map -PAYLOADS := 421C 421D 430C 430D 431C 440C 441C 441D 446C 446D 450C 450D 453C 453D 455C 455D 460C \ - 465C 465D 470C 470D 475C 475D 476C 476D 478C 478D 480C 480D 481C 481D 482C 482D 483C 484C 484D +include FIRMWARES define do_payload $(CC) $(ASFLAGS) -DFIRMWARE_$@ -c start.S -o start.S.o diff --git a/payload/source/symbols.h b/payload/source/symbols.h index 3d12f1a..008dbe5 100644 --- a/payload/source/symbols.h +++ b/payload/source/symbols.h @@ -363,4 +363,15 @@ #define GAMEOS_LPAR_SIZE_PTR 0x80000000003A1240ULL #endif +#ifdef FIRMWARE_485C + #define KERNEL_TOC 0x34FBB0 + #define KERNEL_SYMBOL_EXTEND_KSTACK 0x0700A4 + #define KERNEL_SYMBOL_COPY_TO_USER 0x00F86C + #define KERNEL_SYMBOL_MEMSET 0x04D66C + #define KERNEL_SYMBOL_MEMCPY 0x07E92C + #define GAMEOS_LPAR_BASE_PTR 0x800000000037A638ULL + #define GAMEOS_LPAR_SIZE_PTR 0x800000000037A640ULL +#endif + + #endif /* __SYMBOLS_H__ */ diff --git a/source/data.h b/source/data.h new file mode 100644 index 0000000..beb1538 --- /dev/null +++ b/source/data.h @@ -0,0 +1,42 @@ +#ifndef __DATA_H__ +#define __DATA_H__ + +#include "payload_421C_bin.h" +#include "payload_421D_bin.h" +#include "payload_430C_bin.h" +#include "payload_430D_bin.h" +#include "payload_431C_bin.h" +#include "payload_440C_bin.h" +#include "payload_441C_bin.h" +#include "payload_441D_bin.h" +#include "payload_446C_bin.h" +#include "payload_446D_bin.h" +#include "payload_450C_bin.h" +#include "payload_450D_bin.h" +#include "payload_453C_bin.h" +#include "payload_453D_bin.h" +#include "payload_455C_bin.h" +#include "payload_455D_bin.h" +#include "payload_460C_bin.h" +#include "payload_465C_bin.h" +#include "payload_465D_bin.h" +#include "payload_470C_bin.h" +#include "payload_470D_bin.h" +#include "payload_475C_bin.h" +#include "payload_475D_bin.h" +#include "payload_476C_bin.h" +#include "payload_476D_bin.h" +#include "payload_478C_bin.h" +#include "payload_478D_bin.h" +#include "payload_480C_bin.h" +#include "payload_480D_bin.h" +#include "payload_481C_bin.h" +#include "payload_481D_bin.h" +#include "payload_482C_bin.h" +#include "payload_482D_bin.h" +#include "payload_483C_bin.h" +#include "payload_484C_bin.h" +#include "payload_484D_bin.h" +#include "payload_485C_bin.h" + +#endif /* __DATA_H__ */ diff --git a/source/firmware.c b/source/firmware.c new file mode 100644 index 0000000..a649847 --- /dev/null +++ b/source/firmware.c @@ -0,0 +1,733 @@ + +#include +#include "firmware.h" + +#define SUCCESS 1 +#define FAILED 0 + +extern u8 rebug; +extern u64 *payload; +extern size_t payload_size; +extern u32 firmware; +extern u64 TOC_OFFSET; +extern u64 HV_START_OFFSET; +extern u64 HTAB_OFFSET; +extern u64 SYSCALL_TABLE_OFFSET; +extern u64 MMAP_OFFSET1; +extern u64 MMAP_OFFSET2; +extern u64 SPE_OFFSET; +extern u64 OFFSET_1_IDPS; +extern u64 OFFSET_2_IDPS; + +extern int fw_is_rebug(); +extern u64 lv2peek(u64 addr); + +int init_IDPSet() +{ + + OFFSET_1_IDPS = 0; + OFFSET_2_IDPS = 0; + + if(( lv2peek(FW_DATE_OFFSET_421C )==FW_DATE_1_421C) && + ( lv2peek(FW_DATE_OFFSET_421C + 8)==FW_DATE_2_421C) ) + { + firmware = 0x421C; + + TOC_OFFSET = TOC_OFFSET_421C; + HV_START_OFFSET = HV_START_OFFSET_421C; + HTAB_OFFSET = HTAB_OFFSET_421C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_421C; + MMAP_OFFSET1 = MMAP_OFFSET1_421C; + MMAP_OFFSET2 = MMAP_OFFSET2_421C; + SPE_OFFSET = SPE_OFFSET_421C; + OFFSET_1_IDPS = OFFSET_1_IDPS_421C; + OFFSET_2_IDPS = OFFSET_2_IDPS_421C; + + payload_size = payload_421C_bin_size; + payload = (u64 *) payload_421C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_421D )==FW_DATE_1_421D) && + ( lv2peek(FW_DATE_OFFSET_421D + 8)==FW_DATE_2_421D) ) + { + firmware = 0x421D; + + TOC_OFFSET = TOC_OFFSET_421D; + HV_START_OFFSET = HV_START_OFFSET_421D; + HTAB_OFFSET = HTAB_OFFSET_421D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_421D; + MMAP_OFFSET1 = MMAP_OFFSET1_421D; + MMAP_OFFSET2 = MMAP_OFFSET2_421D; + SPE_OFFSET = SPE_OFFSET_421D; + OFFSET_1_IDPS = OFFSET_1_IDPS_421D; + OFFSET_2_IDPS = OFFSET_2_IDPS_421D; + + payload_size = payload_421D_bin_size; + payload = (u64 *) payload_421D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_430C )==FW_DATE_1_430C) && + ( lv2peek(FW_DATE_OFFSET_430C + 8)==FW_DATE_2_430C) ) + { + firmware = 0x430C; + + TOC_OFFSET = TOC_OFFSET_430C; + HV_START_OFFSET = HV_START_OFFSET_430C; + HTAB_OFFSET = HTAB_OFFSET_430C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_430C; + MMAP_OFFSET1 = MMAP_OFFSET1_430C; + MMAP_OFFSET2 = MMAP_OFFSET2_430C; + SPE_OFFSET = SPE_OFFSET_430C; + OFFSET_1_IDPS = OFFSET_1_IDPS_430C; + OFFSET_2_IDPS = OFFSET_2_IDPS_430C; + + payload_size = payload_430C_bin_size; + payload = (u64 *) payload_430C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_430D )==FW_DATE_1_430D) && + ( lv2peek(FW_DATE_OFFSET_430D + 8)==FW_DATE_2_430D) ) + { + firmware = 0x430D; + + TOC_OFFSET = TOC_OFFSET_430D; + HV_START_OFFSET = HV_START_OFFSET_430D; + HTAB_OFFSET = HTAB_OFFSET_430D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_430D; + MMAP_OFFSET1 = MMAP_OFFSET1_430D; + MMAP_OFFSET2 = MMAP_OFFSET2_430D; + SPE_OFFSET = SPE_OFFSET_430D; + OFFSET_1_IDPS = OFFSET_1_IDPS_430D; + OFFSET_2_IDPS = OFFSET_2_IDPS_430D; + + payload_size = payload_430D_bin_size; + payload = (u64 *) payload_430D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_431C )==FW_DATE_1_431C) && + ( lv2peek(FW_DATE_OFFSET_431C + 8)==FW_DATE_2_431C) ) + { + firmware = 0x431C; + + TOC_OFFSET = TOC_OFFSET_431C; + HV_START_OFFSET = HV_START_OFFSET_431C; + HTAB_OFFSET = HTAB_OFFSET_431C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_431C; + MMAP_OFFSET1 = MMAP_OFFSET1_431C; + MMAP_OFFSET2 = MMAP_OFFSET2_431C; + SPE_OFFSET = SPE_OFFSET_431C; + OFFSET_1_IDPS = OFFSET_1_IDPS_431C; + OFFSET_2_IDPS = OFFSET_2_IDPS_431C; + + payload_size = payload_431C_bin_size; + payload = (u64 *) payload_431C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_440C )==FW_DATE_1_440C) && + ( lv2peek(FW_DATE_OFFSET_440C + 8)==FW_DATE_2_440C) ) + { + firmware = 0x440C; + + TOC_OFFSET = TOC_OFFSET_440C; + HV_START_OFFSET = HV_START_OFFSET_440C; + HTAB_OFFSET = HTAB_OFFSET_440C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_440C; + MMAP_OFFSET1 = MMAP_OFFSET1_440C; + MMAP_OFFSET2 = MMAP_OFFSET2_440C; + SPE_OFFSET = SPE_OFFSET_440C; + OFFSET_1_IDPS = OFFSET_1_IDPS_440C; + OFFSET_2_IDPS = OFFSET_2_IDPS_440C; + + payload_size = payload_440C_bin_size; + payload = (u64 *) payload_440C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_441C )==FW_DATE_1_441C) && + ( lv2peek(FW_DATE_OFFSET_441C + 8)==FW_DATE_2_441C) ) + { + firmware = 0x441C; + + TOC_OFFSET = TOC_OFFSET_441C; + HV_START_OFFSET = HV_START_OFFSET_441C; + HTAB_OFFSET = HTAB_OFFSET_441C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_441C; + MMAP_OFFSET1 = MMAP_OFFSET1_441C; + MMAP_OFFSET2 = MMAP_OFFSET2_441C; + SPE_OFFSET = SPE_OFFSET_441C; + OFFSET_1_IDPS = OFFSET_1_IDPS_441C; + OFFSET_2_IDPS = OFFSET_2_IDPS_441C; + + payload_size = payload_441C_bin_size; + payload = (u64 *) payload_441C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_441D )==FW_DATE_1_441D) && + ( lv2peek(FW_DATE_OFFSET_441D + 8)==FW_DATE_2_441D) ) + { + firmware = 0x441D; + + TOC_OFFSET = TOC_OFFSET_441D; + HV_START_OFFSET = HV_START_OFFSET_441D; + HTAB_OFFSET = HTAB_OFFSET_441D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_441D; + MMAP_OFFSET1 = MMAP_OFFSET1_441D; + MMAP_OFFSET2 = MMAP_OFFSET2_441D; + SPE_OFFSET = SPE_OFFSET_441D; + OFFSET_1_IDPS = OFFSET_1_IDPS_441D; + OFFSET_2_IDPS = OFFSET_2_IDPS_441D; + + payload_size = payload_441D_bin_size; + payload = (u64 *) payload_441D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_446C )==FW_DATE_1_446C) && + ( lv2peek(FW_DATE_OFFSET_446C + 8)==FW_DATE_2_446C) ) + { + firmware = 0x446C; + + TOC_OFFSET = TOC_OFFSET_446C; + HV_START_OFFSET = HV_START_OFFSET_446C; + HTAB_OFFSET = HTAB_OFFSET_446C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_446C; + MMAP_OFFSET1 = MMAP_OFFSET1_446C; + MMAP_OFFSET2 = MMAP_OFFSET2_446C; + SPE_OFFSET = SPE_OFFSET_446C; + OFFSET_1_IDPS = OFFSET_1_IDPS_446C; + OFFSET_2_IDPS = OFFSET_2_IDPS_446C; + + payload_size = payload_446C_bin_size; + payload = (u64 *) payload_446C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_446D )==FW_DATE_1_446D) && + ( lv2peek(FW_DATE_OFFSET_446D + 8)==FW_DATE_2_446D) ) + { + firmware = 0x446D; + + TOC_OFFSET = TOC_OFFSET_446D; + HV_START_OFFSET = HV_START_OFFSET_446D; + HTAB_OFFSET = HTAB_OFFSET_446D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_446D; + MMAP_OFFSET1 = MMAP_OFFSET1_446D; + MMAP_OFFSET2 = MMAP_OFFSET2_446D; + SPE_OFFSET = SPE_OFFSET_446D; + OFFSET_1_IDPS = OFFSET_1_IDPS_446D; + OFFSET_2_IDPS = OFFSET_2_IDPS_446D; + + payload_size = payload_446D_bin_size; + payload = (u64 *) payload_446D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_450C )==FW_DATE_1_450C) && + ( lv2peek(FW_DATE_OFFSET_450C + 8)==FW_DATE_2_450C) ) + { + firmware = 0x450C; + + TOC_OFFSET = TOC_OFFSET_450C; + HV_START_OFFSET = HV_START_OFFSET_450C; + HTAB_OFFSET = HTAB_OFFSET_450C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_450C; + MMAP_OFFSET1 = MMAP_OFFSET1_450C; + MMAP_OFFSET2 = MMAP_OFFSET2_450C; + SPE_OFFSET = SPE_OFFSET_450C; + OFFSET_1_IDPS = OFFSET_1_IDPS_450C; + OFFSET_2_IDPS = OFFSET_2_IDPS_450C; + + payload_size = payload_450C_bin_size; + payload = (u64 *) payload_450C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_450D )==FW_DATE_1_450D) && + ( lv2peek(FW_DATE_OFFSET_450D + 8)==FW_DATE_2_450D) ) + { + firmware = 0x450D; + + TOC_OFFSET = TOC_OFFSET_450D; + HV_START_OFFSET = HV_START_OFFSET_450D; + HTAB_OFFSET = HTAB_OFFSET_450D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_450D; + MMAP_OFFSET1 = MMAP_OFFSET1_450D; + MMAP_OFFSET2 = MMAP_OFFSET2_450D; + SPE_OFFSET = SPE_OFFSET_450D; + OFFSET_1_IDPS = OFFSET_1_IDPS_450D; + OFFSET_2_IDPS = OFFSET_2_IDPS_450D; + + payload_size = payload_450D_bin_size; + payload = (u64 *) payload_450D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_453C )==FW_DATE_1_453C) && + ( lv2peek(FW_DATE_OFFSET_453C + 8)==FW_DATE_2_453C) ) + { + firmware = 0x453C; + + TOC_OFFSET = TOC_OFFSET_453C; + HV_START_OFFSET = HV_START_OFFSET_453C; + HTAB_OFFSET = HTAB_OFFSET_453C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_453C; + MMAP_OFFSET1 = MMAP_OFFSET1_453C; + MMAP_OFFSET2 = MMAP_OFFSET2_453C; + SPE_OFFSET = SPE_OFFSET_453C; + OFFSET_1_IDPS = OFFSET_1_IDPS_453C; + OFFSET_2_IDPS = OFFSET_2_IDPS_453C; + + payload_size = payload_453C_bin_size; + payload = (u64 *) payload_453C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_453D )==FW_DATE_1_453D) && + ( lv2peek(FW_DATE_OFFSET_453D + 8)==FW_DATE_2_453D) ) + { + firmware = 0x453D; + + TOC_OFFSET = TOC_OFFSET_453D; + HV_START_OFFSET = HV_START_OFFSET_453D; + HTAB_OFFSET = HTAB_OFFSET_453D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_453D; + MMAP_OFFSET1 = MMAP_OFFSET1_453D; + MMAP_OFFSET2 = MMAP_OFFSET2_453D; + SPE_OFFSET = SPE_OFFSET_453D; + OFFSET_1_IDPS = OFFSET_1_IDPS_453D; + OFFSET_2_IDPS = OFFSET_2_IDPS_453D; + + payload_size = payload_453D_bin_size; + payload = (u64 *) payload_453D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_455C )==FW_DATE_1_455C) && + ( lv2peek(FW_DATE_OFFSET_455C + 8)==FW_DATE_2_455C) ) + { + firmware = 0x455C; + + TOC_OFFSET = TOC_OFFSET_455C; + HV_START_OFFSET = HV_START_OFFSET_455C; + HTAB_OFFSET = HTAB_OFFSET_455C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_455C; + MMAP_OFFSET1 = MMAP_OFFSET1_455C; + MMAP_OFFSET2 = MMAP_OFFSET2_455C; + SPE_OFFSET = SPE_OFFSET_455C; + OFFSET_1_IDPS = OFFSET_1_IDPS_455C; + OFFSET_2_IDPS = OFFSET_2_IDPS_455C; + + payload_size = payload_455C_bin_size; + payload = (u64 *) payload_455C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_455D )==FW_DATE_1_455D) && + ( lv2peek(FW_DATE_OFFSET_455D + 8)==FW_DATE_2_455D) ) + { + firmware = 0x455D; + + TOC_OFFSET = TOC_OFFSET_455D; + HV_START_OFFSET = HV_START_OFFSET_455D; + HTAB_OFFSET = HTAB_OFFSET_455D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_455D; + MMAP_OFFSET1 = MMAP_OFFSET1_455D; + MMAP_OFFSET2 = MMAP_OFFSET2_455D; + SPE_OFFSET = SPE_OFFSET_455D; + OFFSET_1_IDPS = OFFSET_1_IDPS_455D; + OFFSET_2_IDPS = OFFSET_2_IDPS_455D; + + payload_size = payload_455D_bin_size; + payload = (u64 *) payload_455D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_460C )==FW_DATE_1_460C) && + ( lv2peek(FW_DATE_OFFSET_460C + 8)==FW_DATE_2_460C) ) + { + firmware = 0x460C; + + TOC_OFFSET = TOC_OFFSET_460C; + HV_START_OFFSET = HV_START_OFFSET_460C; + HTAB_OFFSET = HTAB_OFFSET_460C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_460C; + MMAP_OFFSET1 = MMAP_OFFSET1_460C; + MMAP_OFFSET2 = MMAP_OFFSET2_460C; + SPE_OFFSET = SPE_OFFSET_460C; + OFFSET_1_IDPS = OFFSET_1_IDPS_460C; + OFFSET_2_IDPS = OFFSET_2_IDPS_460C; + + payload_size = payload_460C_bin_size; + payload = (u64 *) payload_460C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_465C )==FW_DATE_1_465C) && + ( lv2peek(FW_DATE_OFFSET_465C + 8)==FW_DATE_2_465C) ) + { + firmware = 0x465C; + + TOC_OFFSET = TOC_OFFSET_465C; + HV_START_OFFSET = HV_START_OFFSET_465C; + HTAB_OFFSET = HTAB_OFFSET_465C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_465C; + MMAP_OFFSET1 = MMAP_OFFSET1_465C; + MMAP_OFFSET2 = MMAP_OFFSET2_465C; + SPE_OFFSET = SPE_OFFSET_465C; + OFFSET_1_IDPS = OFFSET_1_IDPS_465C; + OFFSET_2_IDPS = OFFSET_2_IDPS_465C; + + payload_size = payload_465C_bin_size; + payload = (u64 *) payload_465C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_465D )==FW_DATE_1_465D) && + ( lv2peek(FW_DATE_OFFSET_465D + 8)==FW_DATE_2_465D) ) + { + firmware = 0x465D; + + TOC_OFFSET = TOC_OFFSET_465D; + HV_START_OFFSET = HV_START_OFFSET_465D; + HTAB_OFFSET = HTAB_OFFSET_465D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_465D; + MMAP_OFFSET1 = MMAP_OFFSET1_465D; + MMAP_OFFSET2 = MMAP_OFFSET2_465D; + SPE_OFFSET = SPE_OFFSET_465D; + OFFSET_1_IDPS = OFFSET_1_IDPS_465D; + OFFSET_2_IDPS = OFFSET_2_IDPS_465D; + + payload_size = payload_465D_bin_size; + payload = (u64 *) payload_465D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_470C )==FW_DATE_1_470C) && + ( lv2peek(FW_DATE_OFFSET_470C + 8)==FW_DATE_2_470C) ) + { + firmware = 0x470C; + + TOC_OFFSET = TOC_OFFSET_470C; + HV_START_OFFSET = HV_START_OFFSET_470C; + HTAB_OFFSET = HTAB_OFFSET_470C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_470C; + MMAP_OFFSET1 = MMAP_OFFSET1_470C; + MMAP_OFFSET2 = MMAP_OFFSET2_470C; + SPE_OFFSET = SPE_OFFSET_470C; + OFFSET_1_IDPS = OFFSET_1_IDPS_470C; + OFFSET_2_IDPS = OFFSET_2_IDPS_470C; + + payload_size = payload_470C_bin_size; + payload = (u64 *) payload_470C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_470D )==FW_DATE_1_470D) && + ( lv2peek(FW_DATE_OFFSET_470D + 8)==FW_DATE_2_470D) ) + { + firmware = 0x470D; + + TOC_OFFSET = TOC_OFFSET_470D; + HV_START_OFFSET = HV_START_OFFSET_470D; + HTAB_OFFSET = HTAB_OFFSET_470D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_470D; + MMAP_OFFSET1 = MMAP_OFFSET1_470D; + MMAP_OFFSET2 = MMAP_OFFSET2_470D; + SPE_OFFSET = SPE_OFFSET_470D; + OFFSET_1_IDPS = OFFSET_1_IDPS_470D; + OFFSET_2_IDPS = OFFSET_2_IDPS_470D; + + payload_size = payload_470D_bin_size; + payload = (u64 *) payload_470D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_475C )==FW_DATE_1_475C) && + ( lv2peek(FW_DATE_OFFSET_475C + 8)==FW_DATE_2_475C) ) + { + firmware = 0x475C; + + TOC_OFFSET = TOC_OFFSET_475C; + HV_START_OFFSET = HV_START_OFFSET_475C; + HTAB_OFFSET = HTAB_OFFSET_475C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_475C; + MMAP_OFFSET1 = MMAP_OFFSET1_475C; + MMAP_OFFSET2 = MMAP_OFFSET2_475C; + SPE_OFFSET = SPE_OFFSET_475C; + OFFSET_1_IDPS = OFFSET_1_IDPS_475C; + OFFSET_2_IDPS = OFFSET_2_IDPS_475C; + + payload_size = payload_475C_bin_size; + payload = (u64 *) payload_475C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_475D )==FW_DATE_1_475D) && + ( lv2peek(FW_DATE_OFFSET_475D + 8)==FW_DATE_2_475D) ) + { + firmware = 0x475D; + + TOC_OFFSET = TOC_OFFSET_475D; + HV_START_OFFSET = HV_START_OFFSET_475D; + HTAB_OFFSET = HTAB_OFFSET_475D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_475D; + MMAP_OFFSET1 = MMAP_OFFSET1_475D; + MMAP_OFFSET2 = MMAP_OFFSET2_475D; + SPE_OFFSET = SPE_OFFSET_475D; + OFFSET_1_IDPS = OFFSET_1_IDPS_475D; + OFFSET_2_IDPS = OFFSET_2_IDPS_475D; + + payload_size = payload_475D_bin_size; + payload = (u64 *) payload_475D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_476C )==FW_DATE_1_476C) && + ( lv2peek(FW_DATE_OFFSET_476C + 8)==FW_DATE_2_476C) ) + { + firmware = 0x476C; + + TOC_OFFSET = TOC_OFFSET_476C; + HV_START_OFFSET = HV_START_OFFSET_476C; + HTAB_OFFSET = HTAB_OFFSET_476C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_476C; + MMAP_OFFSET1 = MMAP_OFFSET1_476C; + MMAP_OFFSET2 = MMAP_OFFSET2_476C; + SPE_OFFSET = SPE_OFFSET_476C; + OFFSET_1_IDPS = OFFSET_1_IDPS_476C; + OFFSET_2_IDPS = OFFSET_2_IDPS_476C; + + payload_size = payload_476C_bin_size; + payload = (u64 *) payload_476C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_476D )==FW_DATE_1_476D) && + ( lv2peek(FW_DATE_OFFSET_476D + 8)==FW_DATE_2_476D) ) + { + firmware = 0x476D; + + TOC_OFFSET = TOC_OFFSET_476D; + HV_START_OFFSET = HV_START_OFFSET_476D; + HTAB_OFFSET = HTAB_OFFSET_476D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_476D; + MMAP_OFFSET1 = MMAP_OFFSET1_476D; + MMAP_OFFSET2 = MMAP_OFFSET2_476D; + SPE_OFFSET = SPE_OFFSET_476D; + OFFSET_1_IDPS = OFFSET_1_IDPS_476D; + OFFSET_2_IDPS = OFFSET_2_IDPS_476D; + + payload_size = payload_476D_bin_size; + payload = (u64 *) payload_476D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_478C )==FW_DATE_1_478C) && + ( lv2peek(FW_DATE_OFFSET_478C + 8)==FW_DATE_2_478C) ) + { + firmware = 0x478C; + + TOC_OFFSET = TOC_OFFSET_478C; + HV_START_OFFSET = HV_START_OFFSET_478C; + HTAB_OFFSET = HTAB_OFFSET_478C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_478C; + MMAP_OFFSET1 = MMAP_OFFSET1_478C; + MMAP_OFFSET2 = MMAP_OFFSET2_478C; + SPE_OFFSET = SPE_OFFSET_478C; + OFFSET_1_IDPS = OFFSET_1_IDPS_478C; + OFFSET_2_IDPS = OFFSET_2_IDPS_478C; + + payload_size = payload_478C_bin_size; + payload = (u64 *) payload_478C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_478D )==FW_DATE_1_478D) && + ( lv2peek(FW_DATE_OFFSET_478D + 8)==FW_DATE_2_478D) ) + { + firmware = 0x478D; + + TOC_OFFSET = TOC_OFFSET_478D; + HV_START_OFFSET = HV_START_OFFSET_478D; + HTAB_OFFSET = HTAB_OFFSET_478D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_478D; + MMAP_OFFSET1 = MMAP_OFFSET1_478D; + MMAP_OFFSET2 = MMAP_OFFSET2_478D; + SPE_OFFSET = SPE_OFFSET_478D; + OFFSET_1_IDPS = OFFSET_1_IDPS_478D; + OFFSET_2_IDPS = OFFSET_2_IDPS_478D; + + payload_size = payload_478D_bin_size; + payload = (u64 *) payload_478D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_480C )==FW_DATE_1_480C) && + ( lv2peek(FW_DATE_OFFSET_480C + 8)==FW_DATE_2_480C) ) + { + firmware = 0x480C; + + TOC_OFFSET = TOC_OFFSET_480C; + HV_START_OFFSET = HV_START_OFFSET_480C; + HTAB_OFFSET = HTAB_OFFSET_480C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_480C; + MMAP_OFFSET1 = MMAP_OFFSET1_480C; + MMAP_OFFSET2 = MMAP_OFFSET2_480C; + SPE_OFFSET = SPE_OFFSET_480C; + OFFSET_1_IDPS = OFFSET_1_IDPS_480C; + OFFSET_2_IDPS = OFFSET_2_IDPS_480C; + + payload_size = payload_480C_bin_size; + payload = (u64 *) payload_480C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_480D )==FW_DATE_1_480D) && + ( lv2peek(FW_DATE_OFFSET_480D + 8)==FW_DATE_2_480D) ) + { + firmware = 0x480D; + + TOC_OFFSET = TOC_OFFSET_480D; + HV_START_OFFSET = HV_START_OFFSET_480D; + HTAB_OFFSET = HTAB_OFFSET_480D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_480D; + MMAP_OFFSET1 = MMAP_OFFSET1_480D; + MMAP_OFFSET2 = MMAP_OFFSET2_480D; + SPE_OFFSET = SPE_OFFSET_480D; + OFFSET_1_IDPS = OFFSET_1_IDPS_480D; + OFFSET_2_IDPS = OFFSET_2_IDPS_480D; + + payload_size = payload_480D_bin_size; + payload = (u64 *) payload_480D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_481C )==FW_DATE_1_481C) && + ( lv2peek(FW_DATE_OFFSET_481C + 8)==FW_DATE_2_481C) ) + { + firmware = 0x481C; + + TOC_OFFSET = TOC_OFFSET_481C; + HV_START_OFFSET = HV_START_OFFSET_481C; + HTAB_OFFSET = HTAB_OFFSET_481C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_481C; + MMAP_OFFSET1 = MMAP_OFFSET1_481C; + MMAP_OFFSET2 = MMAP_OFFSET2_481C; + SPE_OFFSET = SPE_OFFSET_481C; + OFFSET_1_IDPS = OFFSET_1_IDPS_481C; + OFFSET_2_IDPS = OFFSET_2_IDPS_481C; + + payload_size = payload_481C_bin_size; + payload = (u64 *) payload_481C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_481D )==FW_DATE_1_481D) && + ( lv2peek(FW_DATE_OFFSET_481D + 8)==FW_DATE_2_481D) ) + { + firmware = 0x481D; + + TOC_OFFSET = TOC_OFFSET_481D; + HV_START_OFFSET = HV_START_OFFSET_481D; + HTAB_OFFSET = HTAB_OFFSET_481D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_481D; + MMAP_OFFSET1 = MMAP_OFFSET1_481D; + MMAP_OFFSET2 = MMAP_OFFSET2_481D; + SPE_OFFSET = SPE_OFFSET_481D; + OFFSET_1_IDPS = OFFSET_1_IDPS_481D; + OFFSET_2_IDPS = OFFSET_2_IDPS_481D; + + payload_size = payload_481D_bin_size; + payload = (u64 *) payload_481D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_482C )==FW_DATE_1_482C) && + ( lv2peek(FW_DATE_OFFSET_482C + 8)==FW_DATE_2_482C) ) + { + firmware = 0x482C; + + TOC_OFFSET = TOC_OFFSET_482C; + HV_START_OFFSET = HV_START_OFFSET_482C; + HTAB_OFFSET = HTAB_OFFSET_482C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_482C; + MMAP_OFFSET1 = MMAP_OFFSET1_482C; + MMAP_OFFSET2 = MMAP_OFFSET2_482C; + SPE_OFFSET = SPE_OFFSET_482C; + OFFSET_1_IDPS = OFFSET_1_IDPS_482C; + OFFSET_2_IDPS = OFFSET_2_IDPS_482C; + + payload_size = payload_482C_bin_size; + payload = (u64 *) payload_482C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_482D )==FW_DATE_1_482D) && + ( lv2peek(FW_DATE_OFFSET_482D + 8)==FW_DATE_2_482D) ) + { + firmware = 0x482D; + + TOC_OFFSET = TOC_OFFSET_482D; + HV_START_OFFSET = HV_START_OFFSET_482D; + HTAB_OFFSET = HTAB_OFFSET_482D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_482D; + MMAP_OFFSET1 = MMAP_OFFSET1_482D; + MMAP_OFFSET2 = MMAP_OFFSET2_482D; + SPE_OFFSET = SPE_OFFSET_482D; + OFFSET_1_IDPS = OFFSET_1_IDPS_482D; + OFFSET_2_IDPS = OFFSET_2_IDPS_482D; + + payload_size = payload_482D_bin_size; + payload = (u64 *) payload_482D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_483C )==FW_DATE_1_483C) && + ( lv2peek(FW_DATE_OFFSET_483C + 8)==FW_DATE_2_483C) ) + { + firmware = 0x483C; + + TOC_OFFSET = TOC_OFFSET_483C; + HV_START_OFFSET = HV_START_OFFSET_483C; + HTAB_OFFSET = HTAB_OFFSET_483C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_483C; + MMAP_OFFSET1 = MMAP_OFFSET1_483C; + MMAP_OFFSET2 = MMAP_OFFSET2_483C; + SPE_OFFSET = SPE_OFFSET_483C; + OFFSET_1_IDPS = OFFSET_1_IDPS_483C; + OFFSET_2_IDPS = OFFSET_2_IDPS_483C; + + payload_size = payload_483C_bin_size; + payload = (u64 *) payload_483C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_484C )==FW_DATE_1_484C) && + ( lv2peek(FW_DATE_OFFSET_484C + 8)==FW_DATE_2_484C) ) + { + firmware = 0x484C; + + TOC_OFFSET = TOC_OFFSET_484C; + HV_START_OFFSET = HV_START_OFFSET_484C; + HTAB_OFFSET = HTAB_OFFSET_484C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_484C; + MMAP_OFFSET1 = MMAP_OFFSET1_484C; + MMAP_OFFSET2 = MMAP_OFFSET2_484C; + SPE_OFFSET = SPE_OFFSET_484C; + OFFSET_1_IDPS = OFFSET_1_IDPS_484C; + OFFSET_2_IDPS = OFFSET_2_IDPS_484C; + + payload_size = payload_484C_bin_size; + payload = (u64 *) payload_484C_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_484D )==FW_DATE_1_484D) && + ( lv2peek(FW_DATE_OFFSET_484D + 8)==FW_DATE_2_484D) ) + { + firmware = 0x484D; + + TOC_OFFSET = TOC_OFFSET_484D; + HV_START_OFFSET = HV_START_OFFSET_484D; + HTAB_OFFSET = HTAB_OFFSET_484D; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_484D; + MMAP_OFFSET1 = MMAP_OFFSET1_484D; + MMAP_OFFSET2 = MMAP_OFFSET2_484D; + SPE_OFFSET = SPE_OFFSET_484D; + OFFSET_1_IDPS = OFFSET_1_IDPS_484D; + OFFSET_2_IDPS = OFFSET_2_IDPS_484D; + + payload_size = payload_484D_bin_size; + payload = (u64 *) payload_484D_bin; + } else + if(( lv2peek(FW_DATE_OFFSET_485C )==FW_DATE_1_485C) && + ( lv2peek(FW_DATE_OFFSET_485C + 8)==FW_DATE_2_485C) ) + { + firmware = 0x485C; + + TOC_OFFSET = TOC_OFFSET_485C; + HV_START_OFFSET = HV_START_OFFSET_485C; + HTAB_OFFSET = HTAB_OFFSET_485C; + SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_485C; + MMAP_OFFSET1 = MMAP_OFFSET1_485C; + MMAP_OFFSET2 = MMAP_OFFSET2_485C; + SPE_OFFSET = SPE_OFFSET_485C; + OFFSET_1_IDPS = OFFSET_1_IDPS_485C; + OFFSET_2_IDPS = OFFSET_2_IDPS_485C; + + payload_size = payload_485C_bin_size; + payload = (u64 *) payload_485C_bin; + } else + { + u64 n; + for(n=0x350000; n<0x4A0000; n++) { + u64 data = lv2peek(0x8000000000000000ULL + n); + + if(0x350000 < n && n <0x450000) { + if(OFFSET_1_IDPS == 0) { + if(0x0000000100800000 < data && data <0x0000000100900000) + { + OFFSET_1_IDPS = 0x8000000000000000ULL + n; + } + } + } + if(0x450000 < n && n <0x4A0000) { + if(OFFSET_2_IDPS == 0) { + if(0x0000000100800000 < data && data <0x0000000100900000) + { + OFFSET_2_IDPS = 0x8000000000000000ULL + n; + } + } + } + if(OFFSET_1_IDPS != 0) + if(OFFSET_2_IDPS != 0) break; + } + if(OFFSET_1_IDPS == 0 || OFFSET_2_IDPS == 0) return FAILED; + } + + rebug = fw_is_rebug(); + + sysFSStat st; + if(sysLv2FsStat("/dev_hdd0/tmp", &st) != 0) { + sysLv2FsMkdir("/dev_hdd0/tmp", 0777); + } + sysLv2FsChmod("/dev_hdd0/tmp", 0777); + + return SUCCESS; +} diff --git a/source/firmware.h b/source/firmware.h index 624c701..91868f3 100644 --- a/source/firmware.h +++ b/source/firmware.h @@ -1,6 +1,10 @@ #ifndef __FIRMWARE_H__ #define __FIRMWARE_H__ +#include +#include "data.h" + +int init_IDPSet(); #define HTAB_OFFSET_421C 0x2DD244 #define MMAP_OFFSET1_421C 0x2DCA8C @@ -470,4 +474,17 @@ #define OFFSET_1_IDPS_484D 0x8000000000409A30ULL #define OFFSET_2_IDPS_484D 0x800000000049CAF4ULL +#define HTAB_OFFSET_485C 0x2DD70C +#define MMAP_OFFSET1_485C 0x2DCF54 +#define MMAP_OFFSET2_485C 0x2DD284 +#define SPE_OFFSET_485C 0x2F9EB8 +#define HV_START_OFFSET_485C 0x370F28 +#define TOC_OFFSET_485C 0x800000000034FBB0ULL +#define SYSCALL_TABLE_485C 0x8000000000363BE0ULL +#define FW_DATE_OFFSET_485C 0x80000000002FCB68ULL +#define FW_DATE_1_485C 0x323031392F30372FULL +#define FW_DATE_2_485C 0x32332032313A3035ULL +#define OFFSET_1_IDPS_485C 0x80000000003E2E30ULL +#define OFFSET_2_IDPS_485C 0x8000000000474AF4ULL + #endif /* __FIRMWARE_H__ */ diff --git a/source/main.c b/source/main.c index a44abee..3bac8b6 100644 --- a/source/main.c +++ b/source/main.c @@ -42,46 +42,10 @@ #include "indiv.h" #include "aes_omac.h" #include "common.h" +#include "data.h" #include "firmware.h" #include "dumper.h" -#include "payload_421C_bin.h" -#include "payload_421D_bin.h" -#include "payload_430C_bin.h" -#include "payload_430D_bin.h" -#include "payload_431C_bin.h" -#include "payload_440C_bin.h" -#include "payload_441C_bin.h" -#include "payload_441D_bin.h" -#include "payload_446C_bin.h" -#include "payload_446D_bin.h" -#include "payload_450C_bin.h" -#include "payload_450D_bin.h" -#include "payload_453C_bin.h" -#include "payload_453D_bin.h" -#include "payload_455C_bin.h" -#include "payload_455D_bin.h" -#include "payload_460C_bin.h" -#include "payload_465C_bin.h" -#include "payload_465D_bin.h" -#include "payload_470C_bin.h" -#include "payload_470D_bin.h" -#include "payload_475C_bin.h" -#include "payload_475D_bin.h" -#include "payload_476C_bin.h" -#include "payload_476D_bin.h" -#include "payload_478C_bin.h" -#include "payload_478D_bin.h" -#include "payload_480C_bin.h" -#include "payload_480D_bin.h" -#include "payload_481C_bin.h" -#include "payload_481D_bin.h" -#include "payload_482C_bin.h" -#include "payload_482D_bin.h" -#include "payload_483C_bin.h" -#include "payload_484C_bin.h" -#include "payload_484D_bin.h" - #include "NOT_PNG_bin.h" #define FS_S_IFMT 0170000 @@ -249,6 +213,8 @@ int sys_fs_mount(char const* deviceName, char const* deviceFileSystem, char cons } u8 get_units(u8 value) + + { return value - (value >> 4)*0x10; } @@ -419,698 +385,6 @@ int fw_is_rebug() } -int init_IDPSet() -{ - - OFFSET_1_IDPS = 0; - OFFSET_2_IDPS = 0; - - if(( lv2peek(FW_DATE_OFFSET_421C )==FW_DATE_1_421C) && - ( lv2peek(FW_DATE_OFFSET_421C + 8)==FW_DATE_2_421C) ) - { - firmware = 0x421C; - - TOC_OFFSET = TOC_OFFSET_421C; - HV_START_OFFSET = HV_START_OFFSET_421C; - HTAB_OFFSET = HTAB_OFFSET_421C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_421C; - MMAP_OFFSET1 = MMAP_OFFSET1_421C; - MMAP_OFFSET2 = MMAP_OFFSET2_421C; - SPE_OFFSET = SPE_OFFSET_421C; - OFFSET_1_IDPS = OFFSET_1_IDPS_421C; - OFFSET_2_IDPS = OFFSET_2_IDPS_421C; - - payload_size = payload_421C_bin_size; - payload = (u64 *) payload_421C_bin; - } else - if(( lv2peek(FW_DATE_OFFSET_421D )==FW_DATE_1_421D) && - ( lv2peek(FW_DATE_OFFSET_421D + 8)==FW_DATE_2_421D) ) - { - firmware = 0x421D; - - TOC_OFFSET = TOC_OFFSET_421D; - HV_START_OFFSET = HV_START_OFFSET_421D; - HTAB_OFFSET = HTAB_OFFSET_421D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_421D; - MMAP_OFFSET1 = MMAP_OFFSET1_421D; - MMAP_OFFSET2 = MMAP_OFFSET2_421D; - SPE_OFFSET = SPE_OFFSET_421D; - OFFSET_1_IDPS = OFFSET_1_IDPS_421D; - OFFSET_2_IDPS = OFFSET_2_IDPS_421D; - - payload = (u64 *) payload_421D_bin; - payload_size = payload_421D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_430C )==FW_DATE_1_430C) && - ( lv2peek(FW_DATE_OFFSET_430C + 8)==FW_DATE_2_430C) ) - { - firmware = 0x430C; - - TOC_OFFSET = TOC_OFFSET_430C; - HV_START_OFFSET = HV_START_OFFSET_430C; - HTAB_OFFSET = HTAB_OFFSET_430C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_430C; - MMAP_OFFSET1 = MMAP_OFFSET1_430C; - MMAP_OFFSET2 = MMAP_OFFSET2_430C; - SPE_OFFSET = SPE_OFFSET_430C; - OFFSET_1_IDPS = OFFSET_1_IDPS_430C; - OFFSET_2_IDPS = OFFSET_2_IDPS_430C; - - payload = (u64 *) payload_430C_bin; - payload_size = payload_430C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_430D )==FW_DATE_1_430D) && - ( lv2peek(FW_DATE_OFFSET_430D + 8)==FW_DATE_2_430D) ) - { - firmware = 0x430D; - - TOC_OFFSET = TOC_OFFSET_430D; - HV_START_OFFSET = HV_START_OFFSET_430D; - HTAB_OFFSET = HTAB_OFFSET_430D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_430D; - MMAP_OFFSET1 = MMAP_OFFSET1_430D; - MMAP_OFFSET2 = MMAP_OFFSET2_430D; - SPE_OFFSET = SPE_OFFSET_430D; - OFFSET_1_IDPS = OFFSET_1_IDPS_430D; - OFFSET_2_IDPS = OFFSET_2_IDPS_430D; - - payload = (u64 *) payload_430D_bin; - payload_size = payload_430D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_431C )==FW_DATE_1_431C) && - ( lv2peek(FW_DATE_OFFSET_431C + 8)==FW_DATE_2_431C) ) - { - firmware = 0x431C; - - TOC_OFFSET = TOC_OFFSET_431C; - HV_START_OFFSET = HV_START_OFFSET_431C; - HTAB_OFFSET = HTAB_OFFSET_431C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_431C; - MMAP_OFFSET1 = MMAP_OFFSET1_431C; - MMAP_OFFSET2 = MMAP_OFFSET2_431C; - SPE_OFFSET = SPE_OFFSET_431C; - OFFSET_1_IDPS = OFFSET_1_IDPS_431C; - OFFSET_2_IDPS = OFFSET_2_IDPS_431C; - - payload = (u64 *) payload_431C_bin; - payload_size = payload_431C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_440C )==FW_DATE_1_440C) && - ( lv2peek(FW_DATE_OFFSET_440C + 8)==FW_DATE_2_440C) ) - { - firmware = 0x440C; - - TOC_OFFSET = TOC_OFFSET_440C; - HV_START_OFFSET = HV_START_OFFSET_440C; - HTAB_OFFSET = HTAB_OFFSET_440C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_440C; - MMAP_OFFSET1 = MMAP_OFFSET1_440C; - MMAP_OFFSET2 = MMAP_OFFSET2_440C; - SPE_OFFSET = SPE_OFFSET_440C; - OFFSET_1_IDPS = OFFSET_1_IDPS_440C; - OFFSET_2_IDPS = OFFSET_2_IDPS_440C; - - payload = (u64 *) payload_440C_bin; - payload_size = payload_440C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_441C )==FW_DATE_1_441C) && - ( lv2peek(FW_DATE_OFFSET_441C + 8)==FW_DATE_2_441C) ) - { - firmware = 0x441C; - - TOC_OFFSET = TOC_OFFSET_441C; - HV_START_OFFSET = HV_START_OFFSET_441C; - HTAB_OFFSET = HTAB_OFFSET_441C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_441C; - MMAP_OFFSET1 = MMAP_OFFSET1_441C; - MMAP_OFFSET2 = MMAP_OFFSET2_441C; - SPE_OFFSET = SPE_OFFSET_441C; - OFFSET_1_IDPS = OFFSET_1_IDPS_441C; - OFFSET_2_IDPS = OFFSET_2_IDPS_441C; - - payload = (u64 *) payload_441C_bin; - payload_size = payload_441C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_441D )==FW_DATE_1_441D) && - ( lv2peek(FW_DATE_OFFSET_441D + 8)==FW_DATE_2_441D) ) - { - firmware = 0x441D; - - TOC_OFFSET = TOC_OFFSET_441D; - HV_START_OFFSET = HV_START_OFFSET_441D; - HTAB_OFFSET = HTAB_OFFSET_441D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_441D; - MMAP_OFFSET1 = MMAP_OFFSET1_441D; - MMAP_OFFSET2 = MMAP_OFFSET2_441D; - SPE_OFFSET = SPE_OFFSET_441D; - OFFSET_1_IDPS = OFFSET_1_IDPS_441D; - OFFSET_2_IDPS = OFFSET_2_IDPS_441D; - - payload = (u64 *) payload_441D_bin; - payload_size = payload_441D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_446C )==FW_DATE_1_446C) && - ( lv2peek(FW_DATE_OFFSET_446C + 8)==FW_DATE_2_446C) ) - { - firmware = 0x446C; - - TOC_OFFSET = TOC_OFFSET_446C; - HV_START_OFFSET = HV_START_OFFSET_446C; - HTAB_OFFSET = HTAB_OFFSET_446C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_446C; - MMAP_OFFSET1 = MMAP_OFFSET1_446C; - MMAP_OFFSET2 = MMAP_OFFSET2_446C; - SPE_OFFSET = SPE_OFFSET_446C; - OFFSET_1_IDPS = OFFSET_1_IDPS_446C; - OFFSET_2_IDPS = OFFSET_2_IDPS_446C; - - payload = (u64 *) payload_446C_bin; - payload_size = payload_446C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_446D )==FW_DATE_1_446D) && - ( lv2peek(FW_DATE_OFFSET_446D + 8)==FW_DATE_2_446D) ) - { - firmware = 0x446D; - - TOC_OFFSET = TOC_OFFSET_446D; - HV_START_OFFSET = HV_START_OFFSET_446D; - HTAB_OFFSET = HTAB_OFFSET_446D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_446D; - MMAP_OFFSET1 = MMAP_OFFSET1_446D; - MMAP_OFFSET2 = MMAP_OFFSET2_446D; - SPE_OFFSET = SPE_OFFSET_446D; - OFFSET_1_IDPS = OFFSET_1_IDPS_446D; - OFFSET_2_IDPS = OFFSET_2_IDPS_446D; - - payload = (u64 *) payload_446D_bin; - payload_size = payload_446D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_450C )==FW_DATE_1_450C) && - ( lv2peek(FW_DATE_OFFSET_450C + 8)==FW_DATE_2_450C) ) - { - firmware = 0x450C; - - TOC_OFFSET = TOC_OFFSET_450C; - HV_START_OFFSET = HV_START_OFFSET_450C; - HTAB_OFFSET = HTAB_OFFSET_450C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_450C; - MMAP_OFFSET1 = MMAP_OFFSET1_450C; - MMAP_OFFSET2 = MMAP_OFFSET2_450C; - SPE_OFFSET = SPE_OFFSET_450C; - OFFSET_1_IDPS = OFFSET_1_IDPS_450C; - OFFSET_2_IDPS = OFFSET_2_IDPS_450C; - - payload = (u64 *) payload_450C_bin; - payload_size = payload_450C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_450D )==FW_DATE_1_450D) && - ( lv2peek(FW_DATE_OFFSET_450D + 8)==FW_DATE_2_450D) ) - { - firmware = 0x450D; - - TOC_OFFSET = TOC_OFFSET_450D; - HV_START_OFFSET = HV_START_OFFSET_450D; - HTAB_OFFSET = HTAB_OFFSET_450D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_450D; - MMAP_OFFSET1 = MMAP_OFFSET1_450D; - MMAP_OFFSET2 = MMAP_OFFSET2_450D; - SPE_OFFSET = SPE_OFFSET_450D; - OFFSET_1_IDPS = OFFSET_1_IDPS_450D; - OFFSET_2_IDPS = OFFSET_2_IDPS_450D; - - payload = (u64 *) payload_450D_bin; - payload_size = payload_450D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_453C )==FW_DATE_1_453C) && - ( lv2peek(FW_DATE_OFFSET_453C + 8)==FW_DATE_2_453C) ) - { - firmware = 0x453C; - - TOC_OFFSET = TOC_OFFSET_453C; - HV_START_OFFSET = HV_START_OFFSET_453C; - HTAB_OFFSET = HTAB_OFFSET_453C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_453C; - MMAP_OFFSET1 = MMAP_OFFSET1_453C; - MMAP_OFFSET2 = MMAP_OFFSET2_453C; - SPE_OFFSET = SPE_OFFSET_453C; - OFFSET_1_IDPS = OFFSET_1_IDPS_453C; - OFFSET_2_IDPS = OFFSET_2_IDPS_453C; - - payload = (u64 *) payload_453C_bin; - payload_size = payload_453C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_453D )==FW_DATE_1_453D) && - ( lv2peek(FW_DATE_OFFSET_453D + 8)==FW_DATE_2_453D) ) - { - firmware = 0x453D; - - TOC_OFFSET = TOC_OFFSET_453D; - HV_START_OFFSET = HV_START_OFFSET_453D; - HTAB_OFFSET = HTAB_OFFSET_453D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_453D; - MMAP_OFFSET1 = MMAP_OFFSET1_453D; - MMAP_OFFSET2 = MMAP_OFFSET2_453D; - SPE_OFFSET = SPE_OFFSET_453D; - OFFSET_1_IDPS = OFFSET_1_IDPS_453D; - OFFSET_2_IDPS = OFFSET_2_IDPS_453D; - - payload = (u64 *) payload_453D_bin; - payload_size = payload_453D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_455C )==FW_DATE_1_455C) && - ( lv2peek(FW_DATE_OFFSET_455C + 8)==FW_DATE_2_455C) ) - { - firmware = 0x455C; - - TOC_OFFSET = TOC_OFFSET_455C; - HV_START_OFFSET = HV_START_OFFSET_455C; - HTAB_OFFSET = HTAB_OFFSET_455C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_455C; - MMAP_OFFSET1 = MMAP_OFFSET1_455C; - MMAP_OFFSET2 = MMAP_OFFSET2_455C; - SPE_OFFSET = SPE_OFFSET_455C; - OFFSET_1_IDPS = OFFSET_1_IDPS_455C; - OFFSET_2_IDPS = OFFSET_2_IDPS_455C; - - payload = (u64 *) payload_455C_bin; - payload_size = payload_455C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_455D )==FW_DATE_1_455D) && - ( lv2peek(FW_DATE_OFFSET_455D + 8)==FW_DATE_2_455D) ) - { - firmware = 0x455D; - - TOC_OFFSET = TOC_OFFSET_455D; - HV_START_OFFSET = HV_START_OFFSET_455D; - HTAB_OFFSET = HTAB_OFFSET_455D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_455D; - MMAP_OFFSET1 = MMAP_OFFSET1_455D; - MMAP_OFFSET2 = MMAP_OFFSET2_455D; - SPE_OFFSET = SPE_OFFSET_455D; - OFFSET_1_IDPS = OFFSET_1_IDPS_455D; - OFFSET_2_IDPS = OFFSET_2_IDPS_455D; - - payload = (u64 *) payload_455D_bin; - payload_size = payload_455D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_460C )==FW_DATE_1_460C) && - ( lv2peek(FW_DATE_OFFSET_460C + 8)==FW_DATE_2_460C) ) - { - firmware = 0x460C; - - TOC_OFFSET = TOC_OFFSET_460C; - HV_START_OFFSET = HV_START_OFFSET_460C; - HTAB_OFFSET = HTAB_OFFSET_460C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_460C; - MMAP_OFFSET1 = MMAP_OFFSET1_460C; - MMAP_OFFSET2 = MMAP_OFFSET2_460C; - SPE_OFFSET = SPE_OFFSET_460C; - OFFSET_1_IDPS = OFFSET_1_IDPS_460C; - OFFSET_2_IDPS = OFFSET_2_IDPS_460C; - - payload = (u64 *) payload_460C_bin; - payload_size = payload_460C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_465D )==FW_DATE_1_465D) && - ( lv2peek(FW_DATE_OFFSET_465D + 8)==FW_DATE_2_465D) ) - { - firmware = 0x465D; - - TOC_OFFSET = TOC_OFFSET_465D; - HV_START_OFFSET = HV_START_OFFSET_465D; - HTAB_OFFSET = HTAB_OFFSET_465D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_465D; - MMAP_OFFSET1 = MMAP_OFFSET1_465D; - MMAP_OFFSET2 = MMAP_OFFSET2_465D; - SPE_OFFSET = SPE_OFFSET_465D; - OFFSET_1_IDPS = OFFSET_1_IDPS_465D; - OFFSET_2_IDPS = OFFSET_2_IDPS_465D; - - payload = (u64 *) payload_465D_bin; - payload_size = payload_465D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_465C )==FW_DATE_1_465C) && - ( lv2peek(FW_DATE_OFFSET_465C + 8)==FW_DATE_2_465C) ) - { - firmware = 0x465C; - - TOC_OFFSET = TOC_OFFSET_465C; - HV_START_OFFSET = HV_START_OFFSET_465C; - HTAB_OFFSET = HTAB_OFFSET_465C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_465C; - MMAP_OFFSET1 = MMAP_OFFSET1_465C; - MMAP_OFFSET2 = MMAP_OFFSET2_465C; - SPE_OFFSET = SPE_OFFSET_465C; - OFFSET_1_IDPS = OFFSET_1_IDPS_465C; - OFFSET_2_IDPS = OFFSET_2_IDPS_465C; - - payload = (u64 *) payload_465C_bin; - payload_size = payload_465C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_470C )==FW_DATE_1_470C) && - ( lv2peek(FW_DATE_OFFSET_470C + 8)==FW_DATE_2_470C) ) - { - firmware = 0x470C; - - TOC_OFFSET = TOC_OFFSET_470C; - HV_START_OFFSET = HV_START_OFFSET_470C; - HTAB_OFFSET = HTAB_OFFSET_470C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_470C; - MMAP_OFFSET1 = MMAP_OFFSET1_470C; - MMAP_OFFSET2 = MMAP_OFFSET2_470C; - SPE_OFFSET = SPE_OFFSET_470C; - OFFSET_1_IDPS = OFFSET_1_IDPS_470C; - OFFSET_2_IDPS = OFFSET_2_IDPS_470C; - - payload = (u64 *) payload_470C_bin; - payload_size = payload_470C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_470D )==FW_DATE_1_470D) && - ( lv2peek(FW_DATE_OFFSET_470D + 8)==FW_DATE_2_470D) ) - { - firmware = 0x470D; - - TOC_OFFSET = TOC_OFFSET_470D; - HV_START_OFFSET = HV_START_OFFSET_470D; - HTAB_OFFSET = HTAB_OFFSET_470D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_470D; - MMAP_OFFSET1 = MMAP_OFFSET1_470D; - MMAP_OFFSET2 = MMAP_OFFSET2_470D; - SPE_OFFSET = SPE_OFFSET_470D; - OFFSET_1_IDPS = OFFSET_1_IDPS_470D; - OFFSET_2_IDPS = OFFSET_2_IDPS_470D; - - payload = (u64 *) payload_470D_bin; - payload_size = payload_470D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_475C )==FW_DATE_1_475C) && - ( lv2peek(FW_DATE_OFFSET_475C + 8)==FW_DATE_2_475C) ) - { - firmware = 0x475C; - - TOC_OFFSET = TOC_OFFSET_475C; - HV_START_OFFSET = HV_START_OFFSET_475C; - HTAB_OFFSET = HTAB_OFFSET_475C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_475C; - MMAP_OFFSET1 = MMAP_OFFSET1_475C; - MMAP_OFFSET2 = MMAP_OFFSET2_475C; - SPE_OFFSET = SPE_OFFSET_475C; - OFFSET_1_IDPS = OFFSET_1_IDPS_475C; - OFFSET_2_IDPS = OFFSET_2_IDPS_475C; - - payload = (u64 *) payload_475C_bin; - payload_size = payload_475C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_475D )==FW_DATE_1_475D) && - ( lv2peek(FW_DATE_OFFSET_475D + 8)==FW_DATE_2_475D) ) - { - firmware = 0x475D; - - TOC_OFFSET = TOC_OFFSET_475D; - HV_START_OFFSET = HV_START_OFFSET_475D; - HTAB_OFFSET = HTAB_OFFSET_475D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_475D; - MMAP_OFFSET1 = MMAP_OFFSET1_475D; - MMAP_OFFSET2 = MMAP_OFFSET2_475D; - SPE_OFFSET = SPE_OFFSET_475D; - OFFSET_1_IDPS = OFFSET_1_IDPS_475D; - OFFSET_2_IDPS = OFFSET_2_IDPS_475D; - - payload = (u64 *) payload_475D_bin; - payload_size = payload_475D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_476C )==FW_DATE_1_476C) && - ( lv2peek(FW_DATE_OFFSET_476C + 8)==FW_DATE_2_476C) ) - { - firmware = 0x476C; - - TOC_OFFSET = TOC_OFFSET_476C; - HV_START_OFFSET = HV_START_OFFSET_476C; - HTAB_OFFSET = HTAB_OFFSET_476C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_476C; - MMAP_OFFSET1 = MMAP_OFFSET1_476C; - MMAP_OFFSET2 = MMAP_OFFSET2_476C; - SPE_OFFSET = SPE_OFFSET_476C; - OFFSET_1_IDPS = OFFSET_1_IDPS_476C; - OFFSET_2_IDPS = OFFSET_2_IDPS_476C; - - payload = (u64 *) payload_476C_bin; - payload_size = payload_476C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_476D )==FW_DATE_1_476D) && - ( lv2peek(FW_DATE_OFFSET_476D + 8)==FW_DATE_2_476D) ) - { - firmware = 0x476D; - - TOC_OFFSET = TOC_OFFSET_476D; - HV_START_OFFSET = HV_START_OFFSET_476D; - HTAB_OFFSET = HTAB_OFFSET_476D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_476D; - MMAP_OFFSET1 = MMAP_OFFSET1_476D; - MMAP_OFFSET2 = MMAP_OFFSET2_476D; - SPE_OFFSET = SPE_OFFSET_476D; - OFFSET_1_IDPS = OFFSET_1_IDPS_476D; - OFFSET_2_IDPS = OFFSET_2_IDPS_476D; - - payload = (u64 *) payload_476D_bin; - payload_size = payload_476D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_478C )==FW_DATE_1_478C) && - ( lv2peek(FW_DATE_OFFSET_478C + 8)==FW_DATE_2_478C) ) - { - firmware = 0x478C; - - TOC_OFFSET = TOC_OFFSET_478C; - HV_START_OFFSET = HV_START_OFFSET_478C; - HTAB_OFFSET = HTAB_OFFSET_478C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_478C; - MMAP_OFFSET1 = MMAP_OFFSET1_478C; - MMAP_OFFSET2 = MMAP_OFFSET2_478C; - SPE_OFFSET = SPE_OFFSET_478C; - OFFSET_1_IDPS = OFFSET_1_IDPS_478C; - OFFSET_2_IDPS = OFFSET_2_IDPS_478C; - - payload = (u64 *) payload_478C_bin; - payload_size = payload_478C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_478D )==FW_DATE_1_478D) && - ( lv2peek(FW_DATE_OFFSET_478D + 8)==FW_DATE_2_478D) ) - { - firmware = 0x478D; - - TOC_OFFSET = TOC_OFFSET_478D; - HV_START_OFFSET = HV_START_OFFSET_478D; - HTAB_OFFSET = HTAB_OFFSET_478D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_478D; - MMAP_OFFSET1 = MMAP_OFFSET1_478D; - MMAP_OFFSET2 = MMAP_OFFSET2_478D; - SPE_OFFSET = SPE_OFFSET_478D; - OFFSET_1_IDPS = OFFSET_1_IDPS_478D; - OFFSET_2_IDPS = OFFSET_2_IDPS_478D; - - payload = (u64 *) payload_478D_bin; - payload_size = payload_478D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_480C )==FW_DATE_1_480C) && - ( lv2peek(FW_DATE_OFFSET_480C + 8)==FW_DATE_2_480C) ) - { - firmware = 0x480C; - - TOC_OFFSET = TOC_OFFSET_480C; - HV_START_OFFSET = HV_START_OFFSET_480C; - HTAB_OFFSET = HTAB_OFFSET_480C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_480C; - MMAP_OFFSET1 = MMAP_OFFSET1_480C; - MMAP_OFFSET2 = MMAP_OFFSET2_480C; - SPE_OFFSET = SPE_OFFSET_480C; - OFFSET_1_IDPS = OFFSET_1_IDPS_480C; - OFFSET_2_IDPS = OFFSET_2_IDPS_480C; - - payload = (u64 *) payload_480C_bin; - payload_size = payload_480C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_480D )==FW_DATE_1_480D) && - ( lv2peek(FW_DATE_OFFSET_480D + 8)==FW_DATE_2_480D) ) - { - firmware = 0x480D; - - TOC_OFFSET = TOC_OFFSET_480D; - HV_START_OFFSET = HV_START_OFFSET_480D; - HTAB_OFFSET = HTAB_OFFSET_480D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_480D; - MMAP_OFFSET1 = MMAP_OFFSET1_480D; - MMAP_OFFSET2 = MMAP_OFFSET2_480D; - SPE_OFFSET = SPE_OFFSET_480D; - OFFSET_1_IDPS = OFFSET_1_IDPS_480D; - OFFSET_2_IDPS = OFFSET_2_IDPS_480D; - - payload = (u64 *) payload_480D_bin; - payload_size = payload_480D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_481C )==FW_DATE_1_481C) && - ( lv2peek(FW_DATE_OFFSET_481C + 8)==FW_DATE_2_481C) ) - { - firmware = 0x481C; - - TOC_OFFSET = TOC_OFFSET_481C; - HV_START_OFFSET = HV_START_OFFSET_481C; - HTAB_OFFSET = HTAB_OFFSET_481C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_481C; - MMAP_OFFSET1 = MMAP_OFFSET1_481C; - MMAP_OFFSET2 = MMAP_OFFSET2_481C; - SPE_OFFSET = SPE_OFFSET_481C; - OFFSET_1_IDPS = OFFSET_1_IDPS_481C; - OFFSET_2_IDPS = OFFSET_2_IDPS_481C; - - payload = (u64 *) payload_481C_bin; - payload_size = payload_481C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_481D )==FW_DATE_1_481D) && - ( lv2peek(FW_DATE_OFFSET_481D + 8)==FW_DATE_2_481D) ) - { - firmware = 0x481D; - - TOC_OFFSET = TOC_OFFSET_481D; - HV_START_OFFSET = HV_START_OFFSET_481D; - HTAB_OFFSET = HTAB_OFFSET_481D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_481D; - MMAP_OFFSET1 = MMAP_OFFSET1_481D; - MMAP_OFFSET2 = MMAP_OFFSET2_481D; - SPE_OFFSET = SPE_OFFSET_481D; - OFFSET_1_IDPS = OFFSET_1_IDPS_481D; - OFFSET_2_IDPS = OFFSET_2_IDPS_481D; - - payload = (u64 *) payload_481D_bin; - payload_size = payload_481D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_482C )==FW_DATE_1_482C) && - ( lv2peek(FW_DATE_OFFSET_482C + 8)==FW_DATE_2_482C) ) - { - firmware = 0x482C; - - TOC_OFFSET = TOC_OFFSET_482C; - HV_START_OFFSET = HV_START_OFFSET_482C; - HTAB_OFFSET = HTAB_OFFSET_482C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_482C; - MMAP_OFFSET1 = MMAP_OFFSET1_482C; - MMAP_OFFSET2 = MMAP_OFFSET2_482C; - SPE_OFFSET = SPE_OFFSET_482C; - OFFSET_1_IDPS = OFFSET_1_IDPS_482C; - OFFSET_2_IDPS = OFFSET_2_IDPS_482C; - - payload = (u64 *) payload_482C_bin; - payload_size = payload_482C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_482D )==FW_DATE_1_482D) && - ( lv2peek(FW_DATE_OFFSET_482D + 8)==FW_DATE_2_482D) ) - { - firmware = 0x482D; - - TOC_OFFSET = TOC_OFFSET_482D; - HV_START_OFFSET = HV_START_OFFSET_482D; - HTAB_OFFSET = HTAB_OFFSET_482D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_482D; - MMAP_OFFSET1 = MMAP_OFFSET1_482D; - MMAP_OFFSET2 = MMAP_OFFSET2_482D; - SPE_OFFSET = SPE_OFFSET_482D; - OFFSET_1_IDPS = OFFSET_1_IDPS_482D; - OFFSET_2_IDPS = OFFSET_2_IDPS_482D; - - payload = (u64 *) payload_482D_bin; - payload_size = payload_482D_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_483C )==FW_DATE_1_483C) && - ( lv2peek(FW_DATE_OFFSET_483C + 8)==FW_DATE_2_483C) ) - { - firmware = 0x483C; - - TOC_OFFSET = TOC_OFFSET_483C; - HV_START_OFFSET = HV_START_OFFSET_483C; - HTAB_OFFSET = HTAB_OFFSET_483C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_483C; - MMAP_OFFSET1 = MMAP_OFFSET1_483C; - MMAP_OFFSET2 = MMAP_OFFSET2_483C; - SPE_OFFSET = SPE_OFFSET_483C; - OFFSET_1_IDPS = OFFSET_1_IDPS_483C; - OFFSET_2_IDPS = OFFSET_2_IDPS_483C; - - payload = (u64 *) payload_483C_bin; - payload_size = payload_483C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_484C )==FW_DATE_1_484C) && - ( lv2peek(FW_DATE_OFFSET_484C + 8)==FW_DATE_2_484C) ) - { - firmware = 0x484C; - - TOC_OFFSET = TOC_OFFSET_484C; - HV_START_OFFSET = HV_START_OFFSET_484C; - HTAB_OFFSET = HTAB_OFFSET_484C; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_484C; - MMAP_OFFSET1 = MMAP_OFFSET1_484C; - MMAP_OFFSET2 = MMAP_OFFSET2_484C; - SPE_OFFSET = SPE_OFFSET_484C; - OFFSET_1_IDPS = OFFSET_1_IDPS_484C; - OFFSET_2_IDPS = OFFSET_2_IDPS_484C; - - payload = (u64 *) payload_484C_bin; - payload_size = payload_484C_bin_size; - } else - if(( lv2peek(FW_DATE_OFFSET_484D )==FW_DATE_1_484D) && - ( lv2peek(FW_DATE_OFFSET_484D + 8)==FW_DATE_2_484D) ) - { - firmware = 0x484D; - - TOC_OFFSET = TOC_OFFSET_484D; - HV_START_OFFSET = HV_START_OFFSET_484D; - HTAB_OFFSET = HTAB_OFFSET_484D; - SYSCALL_TABLE_OFFSET = SYSCALL_TABLE_484D; - MMAP_OFFSET1 = MMAP_OFFSET1_484D; - MMAP_OFFSET2 = MMAP_OFFSET2_484D; - SPE_OFFSET = SPE_OFFSET_484D; - OFFSET_1_IDPS = OFFSET_1_IDPS_484D; - OFFSET_2_IDPS = OFFSET_2_IDPS_484D; - - payload = (u64 *) payload_484D_bin; - payload_size = payload_484D_bin_size; - } - else { // firmware inconnu - u64 n; - for(n=0x350000; n<0x4A0000; n++) { - u64 data = lv2peek(0x8000000000000000ULL + n); - - if(0x350000 < n && n <0x450000) { - if(OFFSET_1_IDPS == 0) { - if(0x0000000100800000 < data && data <0x0000000100900000) //PS3 IDPS - { - OFFSET_1_IDPS = 0x8000000000000000ULL + n; - } - } - } - if(0x450000 < n && n <0x4A0000) { - if(OFFSET_2_IDPS == 0) { - if(0x0000000100800000 < data && data <0x0000000100900000) //PS3 IDPS - { - OFFSET_2_IDPS = 0x8000000000000000ULL + n; - } - } - } - if(OFFSET_1_IDPS != 0) - if(OFFSET_2_IDPS != 0) break; - } - if(OFFSET_1_IDPS == 0 || OFFSET_2_IDPS == 0) return FAILED; - } - - rebug = fw_is_rebug(); - - sysFSStat st; - if(sysLv2FsStat("/dev_hdd0/tmp", &st) != 0) { - sysLv2FsMkdir("/dev_hdd0/tmp", 0777); - } - sysLv2FsChmod("/dev_hdd0/tmp", FS_S_IFDIR | 0777); - - return SUCCESS; -} - int eid0_is_CEX() { u32 sourceR, read;