Пример #1
0
static int lv2_patch_storage_355(void)
{
    install_new_poke();
    if (!map_lv1()) {
        remove_new_poke();
        return -1;
    }

    //search bin "5F 6F 66 5F 70 72 6F 64  75 63 74 5F 6D 6F 64 65" to find
    // LV2 enable syscall storage
    save_lv2_storage_patch= peekq(0x80000000002D7820ULL);
    save_lv1_storage_patches[0] = peekq(HV_BASE + 0x16f3b8);
    save_lv1_storage_patches[1] = peekq(HV_BASE + 0x16f3dc);
    save_lv1_storage_patches[2] = peekq(HV_BASE + 0x16f454);
    save_lv1_storage_patches[3] = peekq(HV_BASE + 0x16f45c);

    int n;
    for(n = 0; n < 20; n++) {
        pokeq32(0x80000000002D7820ULL, 0x40000000);
        pokeq7(HV_BASE + 0x16f3b8, 0x7f83e37860000000ULL);
        pokeq7(HV_BASE + 0x16f3dc, 0x7f85e37838600001ULL);
        pokeq7(HV_BASE + 0x16f454, 0x7f84e3783be00001ULL);
        pokeq7(HV_BASE + 0x16f45c, 0x9be1007038600000ULL);
        usleep(5000);
    }
    
    remove_new_poke(); /* restore pokes */
        
    unmap_lv1();
    is_patched = 1;

    return 0;
}
Пример #2
0
static int lv2_unpatch_storage_355(void)
{
    if(!is_patched) return -1;

    install_new_poke();
    if (!map_lv1()) {
        remove_new_poke();
        return -2;
    }

    //search bin "5F 6F 66 5F 70 72 6F 64  75 63 74 5F 6D 6F 64 65" to find
    // LV2 disable syscall storage

    int n;
    for(n = 0; n < 20; n++) {
        pokeq(0x80000000002D7820ULL, save_lv2_storage_patch);

        pokeq7(HV_BASE + 0x16f3b8, save_lv1_storage_patches[0]);
        pokeq7(HV_BASE + 0x16f3dc, save_lv1_storage_patches[1]);
        pokeq7(HV_BASE + 0x16f454, save_lv1_storage_patches[2]);
        pokeq7(HV_BASE + 0x16f45c, save_lv1_storage_patches[3]);
        usleep(5000);
    }

    remove_new_poke(); /* restore pokes */
        
    unmap_lv1();

    return 0;
}
Пример #3
0
static int lv2_unpatch_storage_341(void)
{
    if(!is_patched) return -1;

    install_new_poke();
    if (!map_lv1()) {
        remove_new_poke();
        return -1;
    }

    //search bin "5F 6F 66 5F 70 72 6F 64  75 63 74 5F 6D 6F 64 65" to find
    // LV2 disable syscall storage

    int n;
    for(n = 0; n < 20; n++) {
        pokeq(0x80000000002CF880ULL, save_lv2_storage_patch);

        lv1_poke(0x16f3b8ULL, save_lv1_storage_patches[0]);
        lv1_poke(0x16f3dcULL, save_lv1_storage_patches[1]);
        lv1_poke(0x16f454ULL, save_lv1_storage_patches[2]);
        lv1_poke(0x16f45cULL, save_lv1_storage_patches[3]);
        usleep(5000);
    }

    remove_new_poke();
    unmap_lv1();

    return 0;

}
Пример #4
0
int main(int argc, char *argv[]) {
	debug_wait_for_client();
	
	PRINTF("installing new poke syscall\n");
	install_new_poke();
	
	PRINTF("mapping lv1\n");
	if (!map_lv1()) {
		remove_new_poke();
		exit(0);
	}
	
	PRINTF("patching lv2 mem protection\n");
	patch_lv2_protection();
	
	/* PRINTF("unmapping lv1\n");
	unmap_lv1();
	
	PRINTF("installing syscall 36\n");
	install_syscall_36();
	
	PRINTF("installing vsh_open hook\n");
	install_vsh_open_hook();	
	
	PRINTF("installing misc lv2 patches\n");
	install_lv2_patches(); */
	
	PRINTF("removing new poke syscall\n");
	remove_new_poke();
	
	PRINTF("done, exiting\n");
	return 0;
}
Пример #5
0
int unpatch_lv1_ss_services(void)
{
	if(c_firmware==3.55f)
	{
		install_new_poke();

		// Try to map lv1
		if (!map_lv1())
		{
			remove_new_poke();
			return -1;
		}

		lv1poke(0x0016f3b8, 0x7f83e378f8010098ULL);
		lv1poke(0x0016f3dc, 0x7f85e3784bfff0e5ULL);
		lv1poke(0x0016f454, 0x7f84e37838a10070ULL);
		lv1poke(0x0016f45c, 0x9be1007048005fa5ULL);

		remove_new_poke();

		// unmap lv1
		unmap_lv1();
	}
	else
	if((c_firmware>=4.75f) && (deh_mode))
	{
		if(lv1peek2( 0x177A60) == 0x7f83e37860000000ULL)
		{
			lv1poke2( 0x177A60, 0x7f83e378f8010098ULL);
			lv1poke2( 0x177A84, 0x7f85e3784bfff0e5ULL);
			lv1poke2( 0x177AFC, 0x7f84e37838a10070ULL);
			lv1poke2( 0x177B04, 0x9be1007048006065ULL);
		}
	}
	else
	if(c_firmware==4.21f)
	{
		if(lv1peek2( 0x16f758) == 0x7f83e37860000000ULL)
		{
			lv1poke2( 0x16f758, 0x7f83e378f8010098ULL);
			lv1poke2( 0x16F77C, 0x7f85e3784bfff0e5ULL);
			lv1poke2( 0x16F7F4, 0x7f84e37838a10070ULL);
			lv1poke2( 0x16F7FC, 0x9be1007048006065ULL);
		}
	}
	else
	if(c_firmware>=4.30f)
	{
		if(lv1peek2( 0x16FA60) == 0x7f83e37860000000ULL)
		{
			lv1poke2( 0x16FA60, 0x7f83e378f8010098ULL);
			lv1poke2( 0x16FA84, 0x7f85e3784bfff0e5ULL);
			lv1poke2( 0x16FAFC, 0x7f84e37838a10070ULL);
			lv1poke2( 0x16FB04, 0x9be1007048006065ULL);
		}
	}
	return 0;
}
Пример #6
0
u64 peek_lv1(u64 _addr)
{
	//if(dex_mode && c_firmware==4.21f) { return 0; }
	//if(bdisk_mode && c_firmware>=4.21f) { return 0; }

	if
	((rex_compatible==0) && (c_firmware==3.55f || c_firmware==3.41f))
	{
		u64 _offset = (_addr & 0xFFFFFFFFFFFFF000ULL);
		install_new_poke();
		lv1_355_undocumented_function_114(_offset, HV_PAGE_SIZE, HV_SIZE, &mmap_lpar_addr);
		mm_355_map_lpar_memory_region(mmap_lpar_addr, HV_BASE, HV_SIZE, HV_PAGE_SIZE, 0);

		u64 ret = Lv2Syscall1(6, HV_BASE + (_addr - _offset));

		remove_new_poke();
		lv1_355_undocumented_function_115(mmap_lpar_addr);
		return ret;
	}
	else
	{
		u64 ret = Lv2Syscall1(8, _addr);
		return ret;
	}
}
Пример #7
0
void poke_lv1(u64 _addr, u64 _val)
{
	//if(dex_mode && c_firmware==4.21f) return;
	//if(bdisk_mode && c_firmware>=4.21f) return;

	if((rex_compatible==0) && (c_firmware==3.55f || c_firmware==3.41f))
	{
		u64 _offset = (_addr & 0xFFFFFFFFFFFFF000ULL);
		install_new_poke();
		lv1_355_undocumented_function_114(_offset, HV_PAGE_SIZE, HV_SIZE, &mmap_lpar_addr);
		mm_355_map_lpar_memory_region(mmap_lpar_addr, HV_BASE, HV_SIZE, HV_PAGE_SIZE, 0);

		Lv2Syscall2(7, HV_BASE + (_addr - _offset), _val);

		remove_new_poke();
		lv1_355_undocumented_function_115(mmap_lpar_addr);
	}
	else
	{
		Lv2Syscall2(9, _addr, _val);
	}
}
Пример #8
0
void remove_payload_exploit(void)
{
    /* restore syscall */
    remove_new_poke();
}
Пример #9
0
void load_payload(void)
{
    char *ptr, *ptr2;
    unsigned long long addr, value;
    int patches = 0;

#ifdef USE_MEMCPY_SYSCALL
    /* This does not work on some PS3s */
    pokeq(NEW_POKE_SYSCALL_ADDR, 0x4800000428250000ULL);
    pokeq(NEW_POKE_SYSCALL_ADDR + 8, 0x4182001438a5ffffULL);
    pokeq(NEW_POKE_SYSCALL_ADDR + 16, 0x7cc428ae7cc329aeULL);
    pokeq(NEW_POKE_SYSCALL_ADDR + 24, 0x4bffffec4e800020ULL);

#ifdef WITH_PL3
    system_call_3(NEW_POKE_SYSCALL, 0x800000000000ef48ULL, (unsigned long long) &&_binary_payload_pl3_payload_bin_start,
                  (uint64_t) & _binary_payload_pl3_payload_bin_size);
#else
    system_call_3(new_poke_syscall, 0x80000000002be4a0ULL,
                  (unsigned long long) &_binary_payload_syscall36_payload_bin_start,
                  (uint64_t) & _binary_payload_syscall36_payload_bin_size);
#endif

    /* restore syscall */
    remove_new_poke();
    pokeq(NEW_POKE_SYSCALL_ADDR + 16, 0xebc2fe287c7f1b78);
    pokeq(NEW_POKE_SYSCALL_ADDR + 24, 0x3860032dfba100e8);
#else
    /* WARNING!! It supports only payload with a size multiple of 4 */
    uint32_t i;

#ifdef WITH_PL3
    uint64_t *pl64 = (uint64_t *) (uint64_t) & _binary_payload_pl3_payload_bin_start;
    for (i = 0; i < (uint64_t) & _binary_payload_pl3_payload_bin_size / sizeof(uint64_t); i++) {
        pokeq(0x800000000000ef48ULL + i * sizeof(uint64_t), *pl64++);
    }
    if ((uint64_t) & _binary_payload_pl3_payload_bin_size % sizeof(uint64_t)) {
        pokeq32(0x800000000000ef48ULL + i * sizeof(uint64_t), (uint32_t) * pl64);
    }
#else
    uint64_t *pl64 = (uint64_t *) (uint64_t) & _binary_payload_syscall36_payload_bin_start;

    for (i = 0; i < (uint64_t) & _binary_payload_syscall36_payload_bin_size / sizeof(uint64_t); i++) {
        pokeq(0x80000000002be4a0ULL + i * sizeof(uint64_t), *pl64++);
    }
    if ((uint64_t) & _binary_payload_syscall36_payload_bin_size % sizeof(uint64_t)) {
        pokeq(0x80000000002be4a0ULL + i * sizeof(uint64_t), (uint32_t) * pl64);
    }
#endif
#endif

#ifdef WITH_PL3
    char *tmp = strtok((char *) &_binary_payload_pl3_patch_txt_start, "\n");
#else
    char *tmp = strtok((char *) &_binary_payload_syscall36_patch_txt_start, "\n");
#endif

    do {
        ptr = strchr(tmp, '#');
        if (ptr)
            *ptr = 0;
        ptr = tmp;

        while (*ptr == ' ' || *ptr == '\t')
            ptr++;
        if (!strchr("0123456789abcdefABCDEF", *ptr))
            continue;
        addr = strtoull(ptr, &ptr, 16);
        if (*ptr != ':')
            continue;
        else
            ptr++;
        while (*ptr == ' ' || *ptr == '\t')
            ptr++;
        if (!strchr("0123456789abcdefABCDEF", *ptr))
            continue;
        ptr2 = ptr;
        value = strtoull(ptr, &ptr, 16);

        patches++;

        if (ptr - ptr2 == 8) {
            _poke32(addr, value);
        } else if (ptr - ptr2 == 16) {
            _poke(addr, value);
        } else
            patches--;
    }
    while ((tmp = strtok(NULL, "\n")));
}
Пример #10
0
void install_bootos()
{
	char ts[400];

	uint64_t lv2_kernel_filename_offset = 0;
	int found = 0;
	int i;

	xputs("Mapping LV1...");
	install_new_poke();
	if (!map_lv1()) {
		xputs("Cannot map LV1!");
		return;
	}

	/* First try quickscanning the PS3_LPAR kernel filename */
	if (QUICK_SCAN) {
		xputs
		    ("Quickscanning LV1 PS3_LPAR kernel filename at known offsets...");
		found = 0;
		for (i = 0; i < NBELMS(s_known_platforms); i++) {
			if (lv1_peek(s_known_platforms[i].offset) ==
			    0x2F666C682F6F732FULL
			    && lv1_peek(s_known_platforms[i].offset + 8) ==
			    0x6C76325F6B65726EULL) {
				lv2_kernel_filename_offset =
				    s_known_platforms[i].offset;
				found = 1;
				break;
			}
		}
	}
	if (!found) {
		uint64_t q1 = 0;
		uint64_t q2 = 0;
		uint64_t ten = 0;
		for (i = 0; i < HV_SIZE; i += 8) {
			if (10 * ten > HV_SIZE) {
				snprintf(ts, sizeof(ts),
					 "Scanning LV1 PS3_LPAR kernel filename on full LV1 "
					 "address space... %08llX %02d%%",
					 i & 0xFFFFFFFFULL,
					 (int)(i * (uint64_t) 100 / HV_SIZE));
				xputs(ts);
				ten -= HV_SIZE / 10;
			}
			q2 = lv1_peek(i);
			if (q1 == 0x2F666C682F6F732FULL
			    && q2 == 0x6C76325F6B65726EULL) {
				lv2_kernel_filename_offset = i - 8;
				found = 1;
				break;
			}
			q1 = q2;
			ten += 8;
		}
	}
	xputs("Unmapping LV1...");
	unmap_lv1();
	remove_new_poke();

	if (!found) {
		xputs("No LV1 PS3_LPAR kernel filename found.");
		return;
	}

	snprintf(ts, sizeof(ts),
		 "LV1 PS3_LPAR kernel filename offset at %08llX.",
		 lv2_kernel_filename_offset & 0xFFFFFFFFULL);
	xputs(ts);
	found = 0;
	for (i = 0; i < NBELMS(s_known_platforms); i++) {
		if (lv2_kernel_filename_offset == s_known_platforms[i].offset) {
			snprintf(ts, sizeof(ts),
				 "Detected a PS3 %s running FW %s",
				 s_known_platforms[i].type,
				 s_known_platforms[i].fw);
			xputs(ts);
			found = 1;
			break;
		}
	}
	if (!found) {
		xputs
		    ("Please report your PS3 model, its firmware version and the offset found.");
	}
	// Lv2Patcher works on mapped memory for lv1, and doesn't account for base offset (1<<63)
	lv2_kernel_filename_offset += HV_BASE;
	lv2_kernel_filename_offset &= 0xFFFFFFFFULL;

	if (Lv2Syscall8
	    (837, (u64) "CELL_FS_IOS:BUILTIN_FLSH1", (u64) "CELL_FS_FAT",
	     (u64) "/dev_rwflash", 0, 0, 0, 0, 0)) {
		xputs("Flash remap failed!");
	}
	xputs("Reading BootOS...");
	FILE *f = fopen("/dev_hdd0/game/LNX000001/USRDIR/bootos.bin", "r");
	if (!f) {
		xputs("Cannot open BootOS binary!");
		return;
	}
	size_t sz, sz1;
	u8 *data = (u8 *) read_file(f, &sz);
	if (!data) {
		xputs("Cannot read BootOS binary!");
		fclose(f);
		return;
	}
	unlink("/dev_rwflash/lv2_kernel.self");

	FILE *g = fopen("/dev_rwflash/lv2_kernel.self", "w");
	if (!g) {
		fclose(f);
		xputs("Cannot open flash!");
		return;
	}
	sz1 = sz;
	while (sz > 0) {
		sprintf(ts, "Writing BootOS: %02d%%",
			(int)((sz1 - sz) * 100 / sz1));
		xputs(ts);
		if (sz >= CHUNK) {
			fwrite(data + (sz1 - sz), CHUNK, 1, g);
			sz -= CHUNK;
		} else {
			fwrite(data + (sz1 - sz), sz, 1, g);
			sz = 0;
		}
	}
	fclose(f);
	fclose(g);

	xputs("Adding \"Linux\" entry...");
	f = fopen("/dev_hdd0/game/LV2000000/USRDIR/linux.txt", "w");
	if (!f) {
		xputs("Cannot add a new patchset to LV2 patcher!");
		return;
	}
	fputs("# Linux\nlv1en\n", f);
	fprintf(f, "%08lX: 2f6c6f63616c5f73\n", lv2_kernel_filename_offset);
	fprintf(f, "%08lX: 7973302f6c76325f\n", lv2_kernel_filename_offset + 8);
	fprintf(f, "%08lX: 6b65726e656c2e73\n",
		lv2_kernel_filename_offset + 16);
	fprintf(f, "%08lX: 656c6600\n", lv2_kernel_filename_offset + 24);
	fprintf(f, "%08lX: 000000000000001b\n",
		lv2_kernel_filename_offset + 0x120);
	fputs("lv1dis\n", f);
	fputs("panic\n", f);
	fclose(f);

	xputs("Creating kboot configuration file...");
	f = fopen("/dev_hdd0/kboot.conf", "w");
	fputs
	    ("Install Debian GNU/Linux=http://ftp.debian.org/debian/dists/squeeze/main/installer-powerpc/current/images/powerpc64/netboot/vmlinux initrd=http://ftp.debian.org/debian/dists/squeeze/main/installer-powerpc/current/images/powerpc64/netboot/initrd.gz preseed/url=http://boot.khore.org/mod/preseed.cfg auto=true interface=auto priority=critical\n",
	     f);
	fclose(f);

	/*
	   xputs("Creating 10G file...");
	   f = fopen("/dev_hdd0/linux.img", "w");
	   data = malloc(1 << 20);
	   for(i = 0; i < 10240; i++)
	   fwrite(data, 1 << 20, 1, f);
	   fclose(f);
	   free(data);
	 */

	xputs("All done.");
	xputs("Please run the LV2 patcher.");
	xputs("");
}
Пример #11
0
void generic_patches()
{
	//Remove Lv2 memory protection
	if(c_firmware==3.55f)
	{
		install_new_poke();
		if (!map_lv1_355()) { remove_new_poke(); return; }
		Lv2Syscall2(7, HV_BASE + HV_OFFSET +  0, 0x0000000000000001ULL);
		Lv2Syscall2(7, HV_BASE + HV_OFFSET +  8, 0xe0d251b556c59f05ULL);
		Lv2Syscall2(7, HV_BASE + HV_OFFSET + 16, 0xc232fcad552c80d7ULL);
		Lv2Syscall2(7, HV_BASE + HV_OFFSET + 24, 0x65140cd200000000ULL);
		unmap_lv1_355();
		remove_new_poke();
	}
	if(c_firmware==4.21f)
	{
		Lv2Syscall2(9, HV_START_OFFSET_421 +  0, 0x0000000000000001ULL);
		Lv2Syscall2(9, HV_START_OFFSET_421 +  8, 0xe0d251b556c59f05ULL);
		Lv2Syscall2(9, HV_START_OFFSET_421 + 16, 0xc232fcad552c80d7ULL);
		Lv2Syscall2(9, HV_START_OFFSET_421 + 24, 0x65140cd200000000ULL);
	}
	
	if( (c_firmware>=4.30f && c_firmware<=4.53f) )
	{
		Lv2Syscall2(9, HV_START_OFFSET_430 +  0, 0x0000000000000001ULL);
		Lv2Syscall2(9, HV_START_OFFSET_430 +  8, 0xe0d251b556c59f05ULL);
		Lv2Syscall2(9, HV_START_OFFSET_430 + 16, 0xc232fcad552c80d7ULL);
		Lv2Syscall2(9, HV_START_OFFSET_430 + 24, 0x65140cd200000000ULL);
	}

	if( (c_firmware>=4.55f && c_firmware<=4.78f) )
	{
		Lv2Syscall2(9, HV_START_OFFSET_455 +  0, 0x0000000000000001ULL);
		Lv2Syscall2(9, HV_START_OFFSET_455 +  8, 0xe0d251b556c59f05ULL);
		Lv2Syscall2(9, HV_START_OFFSET_455 + 16, 0xc232fcad552c80d7ULL);
		Lv2Syscall2(9, HV_START_OFFSET_455 + 24, 0x65140cd200000000ULL);
	}

	if(!dex_mode)
	{
		if(c_firmware==3.55f)
		{
			Lv2Syscall2(7, 0x8000000000055EA0ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000055F64ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000055F10ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000055F18ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000007AF64ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000007AF78ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.21f)
		{
			Lv2Syscall2(7, 0x8000000000057020ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x80000000000570E4ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000057090ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000057098ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005AA54ULL, 0x2F83000060000000ULL ); // fix 80010009 error
			Lv2Syscall2(7, 0x800000000005AA68ULL, 0x2F83000060000000ULL ); // fix 80010019 error
		}

		if(c_firmware==4.30f)
		{
			Lv2Syscall2(7, 0x8000000000057170ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000057234ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x80000000000571E0ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x80000000000571E8ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005ABA4ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005ABB8ULL, 0x2F83000060000000ULL );
		}


		if(c_firmware==4.31f)
		{
			Lv2Syscall2(7, 0x8000000000057174ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005723CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error

			Lv2Syscall2(7, 0x80000000000571E8ULL, 0x600000002F840004ULL );
			Lv2Syscall2(7, 0x80000000000571F0ULL, 0x48000098E8629870ULL );
			Lv2Syscall2(7, 0x800000000005ABACULL, 0x60000000E8610188ULL );
			Lv2Syscall2(7, 0x800000000005ABA0ULL, 0x600000005463063EULL );

		}

		if(c_firmware==4.40f)
		{
			Lv2Syscall2(7, 0x80000000000560BCULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056180ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error +C4
			Lv2Syscall2(7, 0x800000000005612CULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056134ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x8000000000059AF0ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000059B04ULL, 0x2F83000060000000ULL );
		}
		
#define pokeq(a, b)		(Lv2Syscall2(7, a, b))
		
		if(c_firmware==4.41f)
		{
			Lv2Syscall2(7, 0x80000000000560C0ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056184ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000056130ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056138ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x8000000000059AF4ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000059B08ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.46f)
		{
			Lv2Syscall2(7, 0x80000000000560C0ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056184ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000056130ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056138ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x8000000000059AF4ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000059B08ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.50f)
		{
			Lv2Syscall2(7, 0x80000000000560BCULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056180ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x800000000005612CULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056134ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x8000000000059AF0ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000059B04ULL, 0x2F83000060000000ULL );
		}
		
		
		if(c_firmware==4.53f)
		{
			Lv2Syscall2(7, 0x80000000000560C0ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056184ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000056130ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056138ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x8000000000059AF4ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000059B08ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.55f)
		{
			Lv2Syscall2(7, 0x8000000000056380ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056444ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x80000000000563F0ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x80000000000563F8ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005A2ECULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005A300ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.60f)
		{
			Lv2Syscall2(7, 0x8000000000056588ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005664CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x80000000000565F8ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056600ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005A654ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005A668ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.65f || c_firmware==4.66f)
		{
			Lv2Syscall2(7, 0x800000000005658CULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056650ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x80000000000565FCULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056604ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005A658ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005A66CULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000056230ULL, 0x386000012F830000ULL ); // ignore LIC.DAT check			
		}
		if(c_firmware==4.70f)
		{
			Lv2Syscall2(7, 0x8000000000056588ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005664CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x80000000000565F8ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000056600ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005A6DCULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005A6F0ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005622CULL, 0x386000012F830000ULL ); // ignore LIC.DAT check			
		}
		if(c_firmware==4.75f || c_firmware==4.76f || c_firmware==4.78f)
		{
			Lv2Syscall2(7, 0x800000000005658CULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000056650ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x80000000000565FCULL, 0x419E00D860000000ULL ); // Original: 0x419E00D8419D00C0ULL
			Lv2Syscall2(7, 0x8000000000056604ULL, 0x2F84000448000098ULL ); // Original: 0x2F840004409C0048ULL //PATCH_JUMP
			Lv2Syscall2(7, 0x800000000005A6E0ULL, 0x2F83000060000000ULL ); // fix 80010009 error  Original: 0x2F830000419E00ACULL
			Lv2Syscall2(7, 0x800000000005A6F4ULL, 0x2F83000060000000ULL ); // fix 80010009 error  Original: 0x2F830000419E00ACULL
			Lv2Syscall2(7, 0x8000000000056230ULL, 0x386000012F830000ULL ); // ignore LIC.DAT check			
		}
	}
	else if (dex_mode)
	{ //DEX

		if(c_firmware==3.55f)
		{
			Lv2Syscall2(7, 0x800000000005978CULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000059850ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x80000000000597FCULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059804ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000007EF5CULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000007EF70ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.21f)
		{
			Lv2Syscall2(7, 0x800000000005A938ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005A9FCULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x800000000005A9A8ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x800000000005A9B0ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005E36CULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005E380ULL, 0x2F83000060000000ULL );
		}
		
		if(c_firmware==4.30f)
		{
			Lv2Syscall2(7, 0x800000000005AA88ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005AB4CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x800000000005AAF8ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x800000000005AB00ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005E4BCULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005E4D0ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.41f)
		{
			Lv2Syscall2(7, 0x80000000000599D8ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000059A9CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059A48ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059A50ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005D40CULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005D420ULL, 0x2F83000060000000ULL );

		}

		if(c_firmware==4.46f)
		{
			Lv2Syscall2(7, 0x80000000000599D8ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000059A9CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059A48ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059A50ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005D40CULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005D420ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.50f)
		{
			Lv2Syscall2(7, 0x8000000000059A8CULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000059B50ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059AFCULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059B04ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005D4C0ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005D4D4ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.53f)
		{
			Lv2Syscall2(7, 0x8000000000059A90ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000059B54ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059B00ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059B08ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005D4C4ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005D4D8ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.55f)
		{
			Lv2Syscall2(7, 0x8000000000059D50ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x8000000000059E14ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059DC0ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059DC8ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005DCB8ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005DCD0ULL, 0x2F83000060000000ULL );
		}

		if(c_firmware==4.60f)
		{
			Lv2Syscall2(7, 0x8000000000059F58ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005A01CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059FC8ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059FD0ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005E020ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005E038ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000059BFCULL, 0x386000012F830000ULL ); // ignore LIC.DAT check

		}

		if(c_firmware==4.65f || c_firmware==4.66f)
		{			
			Lv2Syscall2(7, 0x8000000000059F5CULL, 0x63FF003D60000000ULL ); // fix 8001003D error  Original: 0x63FF003D419EFFD4ULL
			Lv2Syscall2(7, 0x800000000005A020ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error  Original: 0x3FE0800163FF003EULL
			Lv2Syscall2(7, 0x8000000000059FCCULL, 0x419E00D860000000ULL ); // Original: 0x419E00D8419D00C0ULL
			Lv2Syscall2(7, 0x8000000000059FD4ULL, 0x2F84000448000098ULL ); // Original: 0x2F840004409C0048ULL //PATCH_JUMP
			Lv2Syscall2(7, 0x800000000005E028ULL, 0x2F83000060000000ULL ); // fix 80010009 error  Original: 0x2F830000419E00ACULL
			Lv2Syscall2(7, 0x800000000005E03CULL, 0x2F83000060000000ULL ); // fix 80010009 error  Original: 0x2F830000419E00ACULL
			Lv2Syscall2(7, 0x8000000000059C00ULL, 0x386000012F830000ULL ); // ignore LIC.DAT check
        }

		if(c_firmware==4.70f)
		{		
			Lv2Syscall2(7, 0x8000000000059F58ULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005A01CULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059FC8ULL, 0x419E00D860000000ULL );
			Lv2Syscall2(7, 0x8000000000059FD0ULL, 0x2F84000448000098ULL );
			Lv2Syscall2(7, 0x800000000005E0ACULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x800000000005E0C0ULL, 0x2F83000060000000ULL );
			Lv2Syscall2(7, 0x8000000000059BFCULL, 0x386000012F830000ULL ); // ignore LIC.DAT check		
		}

		if(c_firmware==4.75f || c_firmware==4.76f || c_firmware==4.78f)
		{		
			Lv2Syscall2(7, 0x80000000000595FCULL, 0x63FF003D60000000ULL ); // fix 8001003D error
			Lv2Syscall2(7, 0x800000000005A020ULL, 0x3FE080013BE00000ULL ); // fix 8001003E error
			Lv2Syscall2(7, 0x8000000000059FCCULL, 0x419E00D860000000ULL ); // Original: 0x419E00D8419D00C0ULL
			Lv2Syscall2(7, 0x8000000000059FD4ULL, 0x2F84000448000098ULL ); // Original: 0x2F840004409C0048ULL //PATCH_JUMP
			Lv2Syscall2(7, 0x800000000005E0B0ULL, 0x2F83000060000000ULL ); // fix 80010009 error  Original: 0x2F830000419E00ACULL
			Lv2Syscall2(7, 0x800000000005E0C4ULL, 0x2F83000060000000ULL ); // fix 80010009 error  Original: 0x2F830000419E00ACULL
			Lv2Syscall2(7, 0x8000000000059C00ULL, 0x386000012F830000ULL ); // ignore LIC.DAT check			
		}
	}
}