• Home
  • Downloads
  • EBOOT Fixes
  • Forums
  • New Posts
  • Register
    • Welcome, Register Now! 
    • Premium VIP Membership
    • PS3 Sticky
      • PS3 CFW & MFW
      • PS3 Debug Firmware
      • PS3 Decrypted PSN Links for CFW
      • PS3 Downloads
      • PS3 EBOOT.BIN Original File Links
      • PS3 Firmware
      • PS3 Game Releases List
      • PS3 Guides & Tutorials
      • PS3 Hacking Guides and Tutorials
      • PS3 Hacks & JailBreak
      • PS3 Help & Support
      • PS3 JailBreak Game Compatibility List
      • PS3 JB2 / True Blue (TB) Game Links
      • PS3 multiMAN Updates
      • PS3 Resources
      • PS3 Reviews
      • PS3 Save Files Repository
      • PS3 Themes
      • PS3 Trophies List
      • PS3 Videos
      • PS Vita Trophies List
    • Quick Links
      • Affiliates
      • Contact Us
      • FAQ
      • Post News
      • Site Rules
      • Tag Cloud
 

ReActPSN PS3 RAP2RIF .RAP to .RIF File Converter is Released

Category: PS3 Hacks & JailBreak  By: flatz - (ps3news.com)
Tags: reactpsn ps3 rap2rif rap2rif ps3 rap file converter ps3 rif file converter ps3 hacks

65w ago - Following up on the previous ReActPSN v2.20 release, I have recently created a small PS3 RAP2RIF converter application for converting .RAP files from ReActPSN to .RIF file format.

Download: ReActPSN PS3 RAP2RIF .RAP to .RIF File Converter

It is based on a my own research.

Place it to the ps3tools directory along with other tools and then place your idps and act.dat files to appropriate folders.

This tool will generate .rif file that you should copy to your exdata/ folder. Then you can unself a corresponding NPDRM file.

Have fun.

Finally, from flatz comes the source code for RAP2RIF and RAP2RIFKey below:

RAP2RIF: pastie.org/private/yltlfwubsz8w5pyhmojyfg

// (c) flatz

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "common.h"
#include "tools.h"

static const u8 rif_header[16] = {
	0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02
};

static const u8 rif_footer[16] = {
	0x00, 0x00, 0x01, 0x2F, 0x41, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const u8 rif_junk = 0x11;

static int load_from_file(const char *name, u8 *data, u32 length);
static int rap_to_klicensee(u8 *rap_key, u8 *klicensee);

int main(int argc, char *argv[])
{
	struct keylist *klist = NULL;
	struct rif *rif = NULL;
	struct actdat *actdat = NULL;
	FILE *fp = NULL;
	int i;

	u8 rap_key[16];
	u8 klicensee[16];
	u8 content_id[48];
	u8 padding[16];
	u8 rif_key[16];
	u8 enc_const[16];
	u8 dec_actdat[16];
	u8 signature[40];
	u32 actdat_key_index;

	const char *p1;
	const char *p2;

	if (argc < 3) {
		fail("usage: rap2rif <rap file> <rif file>");
		goto fail;
	}

	klist = keys_get(KEY_NPDRM);
	if (klist == NULL) {
		fail("no key found");
		goto fail;
	}

    actdat = actdat_get();
	if (actdat == NULL) {
		fail("unable to load act.dat");
		goto fail;
	}

	if (load_from_file(argv[1], rap_key, sizeof(rap_key)) < 0) {
		fail("unable to load rap file");
		goto fail;
	}

	memset(content_id, 0, sizeof(content_id));
	p1 = strrchr(argv[1], '/');
	if (p1 == NULL)
		p1 = strrchr(argv[1], '\\');
	else
		++p1;
	if (p1 == NULL)
		p1 = argv[1];
	else
		++p1;
	p2 = strrchr(argv[1], '.');
	if (p1 == NULL || p2 == NULL || *(p1 + 1) == '\0' || p2 < p1) {
		fail("unable to get content ID");
		goto fail;
	}
	strncpy(content_id, p1, p2 - p1);

	memset(klicensee, 0, sizeof(klicensee));
	rap_to_klicensee(rap_key, klicensee);

	memset(padding, 0, sizeof(padding));
	memset(rif_key, 0, sizeof(rif_key));

	actdat_key_index = 0;
	wbe32(padding + sizeof(padding) - sizeof(actdat_key_index), actdat_key_index);

	aes128_enc(klist->idps->key, klist->npdrm_const->key, enc_const);
	aes128(enc_const, &actdat->keyTable[actdat_key_index * 16], dec_actdat);
	aes128_enc(klist->rif->key, padding, padding);
	aes128_enc(dec_actdat, klicensee, rif_key);

	memset(signature, rif_junk, sizeof(signature));

	fp = fopen(argv[2], "wb");
	if (fp == NULL) {
		fail("unable to create rif file");
		goto fail;
	}
	fwrite(rif_header, sizeof(rif_header), 1, fp);
	fwrite(content_id, sizeof(content_id), 1, fp);
	fwrite(padding, sizeof(padding), 1, fp);
	fwrite(rif_key, sizeof(rif_key), 1, fp);
	fwrite(rif_footer, sizeof(rif_footer), 1, fp);
	fwrite(signature, sizeof(signature), 1, fp);
	fclose(fp);

	return 0;

fail:
	if (fp != NULL) {
		fclose(fp);
	}

	if (actdat != NULL) {
		free(actdat);
	}

	if (klist != NULL) {
		if (klist->keys != NULL)
			free(klist->keys);
		free(klist);
	}

	return 0;
}

static int load_from_file(const char *path, u8 *data, u32 length)
{
	FILE *fp = NULL;
	u32 read;
	int ret = -1;
	fp = fopen(path, "rb");
	if (fp == NULL)
		goto fail;
	read = fread(data, length, 1, fp);
	if (read != 1)
		goto fail;
	ret = 0;
fail:
	if (fp != NULL)
		fclose(fp);
	return ret;
}

static int rap_to_klicensee(u8 *rap_key, u8 *klicensee)
{
	static u8 rap_initial_key[16] = {
		0x86, 0x9F, 0x77, 0x45, 0xC1, 0x3F, 0xD8, 0x90, 0xCC, 0xF2, 0x91, 0x88, 0xE3, 0xCC, 0x3E, 0xDF
	};
	static u8 pbox[16] = {
		0x0C, 0x03, 0x06, 0x04, 0x01, 0x0B, 0x0F, 0x08, 0x02, 0x07, 0x00, 0x05, 0x0A, 0x0E, 0x0D, 0x09
	};
	static u8 e1[16] = {
		0xA9, 0x3E, 0x1F, 0xD6, 0x7C, 0x55, 0xA3, 0x29, 0xB7, 0x5F, 0xDD, 0xA6, 0x2A, 0x95, 0xC7, 0xA5
	};
	static u8 e2[16] = {
		0x67, 0xD4, 0x5D, 0xA3, 0x29, 0x6D, 0x00, 0x6A, 0x4E, 0x7C, 0x53, 0x7B, 0xF5, 0x53, 0x8C, 0x74
	};

	int round_num;
	int i;

	u8 key[16];
	aes128(rap_initial_key, rap_key, key);

	for (round_num = 0; round_num < 5; ++round_num) {
		for (i = 0; i < 16; ++i) {
			int p = pbox[i];
			key[p] ^= e1[p];
		}
		for (i = 15; i >= 1; --i) {
			int p = pbox[i];
			int pp = pbox[i - 1];
			key[p] ^= key[pp];
		}
		int o = 0;
		for (i = 0; i < 16; ++i) {
			int p = pbox[i];
			u8 kc = key[p] - o;
			u8 ec2 = e2[p];
			if (o != 1 || kc != 0xFF) {
				o = kc < ec2 ? 1 : 0;
				key[p] = kc - ec2;
			} else if (kc == 0xFF) {
				key[p] = kc - ec2;
			} else {
				key[p] = kc;
			}
		}
	}

	memcpy(klicensee, key, sizeof(key));
	return 0;
}
RAP2RIFKey: pastie.org/private/pmnmsnqg6zbfnk9xactbw

// (c) flatz

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "common.h"
#include "tools.h"

static int load_from_file(const char *name, u8 *data, u32 length);
static int rap_to_klicensee(u8 *rap_key, u8 *klicensee);

int main(int argc, char *argv[])
{
	struct keylist *klist = NULL;
	struct rif *rif = NULL;
	FILE *fp = NULL;
	int i;

	u8 rap_key[16];
	u8 klicensee[16];

	if (argc < 3) {
		printf("usage: rap2rifkey <rap file> <rif key file>\n");
		return 0;
	}

	klist = keys_get(KEY_NPDRM);
	if (klist == NULL) {
		fail("no key found");
		goto fail;
	}

	if (load_from_file(argv[1], rap_key, sizeof(rap_key)) < 0) {
		fail("unable to load rap file");
		goto fail;
	}

	memset(klicensee, 0, sizeof(klicensee));
	rap_to_klicensee(rap_key, klicensee);

	fp = fopen(argv[2], "wb");
	if (fp == NULL) {
		fail("unable to create rif key file");
		goto fail;
	}
	fwrite(klicensee, sizeof(klicensee), 1, fp);
	fclose(fp);

	return 0;

fail:
	if (fp != NULL) {
		fclose(fp);
	}

	if (klist != NULL) {
		if (klist->keys != NULL)
			free(klist->keys);
		free(klist);
	}

	return 0;
}

static int load_from_file(const char *path, u8 *data, u32 length)
{
	FILE *fp = NULL;
	u32 read;
	int ret = -1;
	fp = fopen(path, "rb");
	if (fp == NULL)
		goto fail;
	read = fread(data, length, 1, fp);
	if (read != 1)
		goto fail;
	ret = 0;
fail:
	if (fp != NULL)
		fclose(fp);
	return ret;
}

static int rap_to_klicensee(u8 *rap_key, u8 *klicensee)
{
	static u8 rap_initial_key[16] = {
		0x86, 0x9F, 0x77, 0x45, 0xC1, 0x3F, 0xD8, 0x90, 0xCC, 0xF2, 0x91, 0x88, 0xE3, 0xCC, 0x3E, 0xDF
	};
	static u8 pbox[16] = {
		0x0C, 0x03, 0x06, 0x04, 0x01, 0x0B, 0x0F, 0x08, 0x02, 0x07, 0x00, 0x05, 0x0A, 0x0E, 0x0D, 0x09
	};
	static u8 e1[16] = {
		0xA9, 0x3E, 0x1F, 0xD6, 0x7C, 0x55, 0xA3, 0x29, 0xB7, 0x5F, 0xDD, 0xA6, 0x2A, 0x95, 0xC7, 0xA5
	};
	static u8 e2[16] = {
		0x67, 0xD4, 0x5D, 0xA3, 0x29, 0x6D, 0x00, 0x6A, 0x4E, 0x7C, 0x53, 0x7B, 0xF5, 0x53, 0x8C, 0x74
	};

	int round_num;
	int i;

	u8 key[16];
	aes128(rap_initial_key, rap_key, key);

	for (round_num = 0; round_num < 5; ++round_num) {
		for (i = 0; i < 16; ++i) {
			int p = pbox[i];
			key[p] ^= e1[p];
		}
		for (i = 15; i >= 1; --i) {
			int p = pbox[i];
			int pp = pbox[i - 1];
			key[p] ^= key[pp];
		}
		int o = 0;
		for (i = 0; i < 16; ++i) {
			int p = pbox[i];
			u8 kc = key[p] - o;
			u8 ec2 = e2[p];
			if (o != 1 || kc != 0xFF) {
				o = kc < ec2 ? 1 : 0;
				key[p] = kc - ec2;
			} else if (kc == 0xFF) {
				key[p] = kc - ec2;
			} else {
				key[p] = kc;
			}
		}
	}

	memcpy(klicensee, key, sizeof(key));
	return 0;
}
Finally, from sorg: Addition to FLAG_0x20: Hash in header for metadata is still valid. Just hash all pieces of metadata




Stay tuned for more PS3 Hacks and PS3 CFW news, follow us on Twitter and be sure to drop by the PS3 Hacks and PS3 Custom Firmware Forums for the latest PlayStation 3 scene updates and homebrew releases!

Comments 6 Comments - Go to Forum Thread »

Errors

The following errors occurred with your submission

Okay

Quick Reply Quick Reply

  • Decrease Size
    Increase Size
  • Wrap [QUOTE] tags around selected text
Posting Quick Reply - Please Wait Posting Quick Reply - Please Wait
XxUnkn0wnxX's Avatar
#6 - XxUnkn0wnxX - 8w ago
Reply
here is a mirror for RIF2RAP Edit by BlackDeath: http://www.mediafire.com/?kqrutfy963ap6bv

jmleolgq's Avatar
#5 - jmleolgq - 27w ago
Reply
The lastest MM supports idps displaying.

Turn the MutiMan mode to XMB, select [Settings] -> [System Information].

BerserkLeon's Avatar
#4 - BerserkLeon - 27w ago
Reply
seems to work with the rifs reactpsn 2.23 wouldn't turn to raps. thanks

PS3 News's Avatar
#3 - PS3 News - 27w ago
Reply
Following up on RenPKG and RAP2RIF, PlayStation 3 homebrew developer Eslab has now made available RIF2RAP which no longer requires users to downgrade their PS3 console to 3.55 to export the RAP files.

Download: http://rghost.net/42146311 / http://rghost.net/42172983 (Mirror) / http://www37.zippyshare.com/v/78271578/file.html (Mirror #2) / http://rghost.net/42155555 / http://www.mediafire.com/?kqrutfy963ap6bv (Mirror) by BlackDeath / http://rghost.net/42158954 by Anxietic

With this application, it is now possible to convert RIF files on the PlayStation 3 console to RAP files.

From mikufans: Hello, recently my friend released a tool: rif2rap. It does help those who want to share the rap. And there is no need to downgrade the PS3 concole to 3.55 to export the rap. Just run this rif2rap.exe, and get the rap.

Tested OK by some of my friends. The Tutorial is so easy that no need to explain here.

The program is written by Eslab. Enjoy!!

Q: How to get my act.dat?
A: PS3 file path: dev_hdd0/home/00000X/exdata

Q: How to get my idps?
A: Dump your PS3 flash, and visit ps3devwiki.com/wiki/IDPS (see below) You don't need to downgrade your console. The lastest MM supports flash dump.

IDPS

The IDPS is a 16 byte value that contains console specific information. Exactly what information this stores is not completely known.

Structure


00000000 00 00 00 01 00 89 00 0B 14 00 EF DD CA 25 52 66 .....‰....�%Rf
^^ ^^
Target ID PS3 Model type
6th byte represents your Target ID

8th byte represents your PS3 Model

The IDPS can be found in EID0 and EID5, see Flash (NAND @ 0x80870 / NOR @ 0x2F070)

Displayed under setting information on MultiMan or on registry/application_persistent file inside PlayStation Store folder (as DeviceID).

Q: How to import the rap?
A: Install the ReActPsn 2.23.pkg, tested OK on 4.30CFW V2.03

From the ReadMe File: Your console's IDPS named idps is in the exdata file folder. Your act.dat is also in the exdata file folder.

The usage:


rif2rap
or
rif2rap
From BlackDeath: I have created a little "batch-version"... Just copy all *.rif files in the folder and run convert_all_rif2rap.exe (of course u have to place your act.dat and idps in exdata folder)

It's just a quick version, feel free to test. Maybe it's useful for those like me, with many *.rif files. kudos to Eslab for this nice rif2rap tool.

From Anxietic: Is that get_IDPS app able to be ported to 4.21? if so would remove the need to downgrade to get it. I signed it for 4.20+, try, maybe it works.

From snkysnake02 followed by haz367: I say over complicated not in literary terms. In mm you gota load then load fileos then do this then do that, by the time ya make it through those steps I already have mine with 2 clicks

1. Boot toolbox
2. Click dump nand / nor flash

Less steps ie. Less complex do you follow now LOL ^_^

From there on 4.xx CFW's to get ur IDPS as a file (all "idps dumpers" are not working properly on 4.xx)

• open the NOR or NAND dump with HxD workshop
• click CTRL+E or click "edit-select block"
• paste the idps - OFFSETS below into the 2 boxes
• enter

Start offset - End offset
NOR: 2f070 - 2F07F = IDPS
NAND: 80870 - 8087F = IDPS

1)

• rightclick the IDPS and copy the line or just do CTLR+C
• create new file
• CTRL+B or paste write the IDPS into new file
• save the new file as "idps" without any extension!! > not idps.txt etc...

2) or write down the IDPS from Multiman - system settings

• write into "new file" with HxD
• save as "idps"
• result looks like this with your OWN IDPS

Finally, c/p your "act.dat" and "idps" in the exdata folder and convert your rifs to raps: rap2rif, rif2rap

From oakhead69: ReActPSN needs RAP files to work. These can be created on CFW 3.55 by reactPSN from the rif files that are present in your exdata folder. i.e. it performs a RIF2RAP for you. Problem is reactPSN will not do this on CFW 4.xx, hence you need to use this program to do it for you.

More information so that you can understand this if you are interested: In order for reactPSN to work the PS3 needs to be able to decrypt locally licensed EDAT files. In order to do this it needs a number of keys, the main 2 that we are interested in are the devKLic and the keyFromRif. The devKLic is either a known hard coded key in the F/W this is the case for PSX, PS2, PSP, minis, Demos and others.

For DLC, updates, PSN games this key is in the application executable (e.g. BOOT.BIN). The other key the keyFromRif is what the RAP file provides. The other 2 keys it needs are the EDATKEY and the EDATHASH, there are =V4 versions of these. I have tired to keep this simple, hope it helps. It is also needed as you say to make games etc work with out reactPSN. In order to convert an EDAT file from locally licensed to free the same keys are needed as described above.

From Asure: You can use rap2rif to create valid RIF files from a RAP file.. So there's no need for ReactPSN at this stage, the rif files are generated on your PC. And yes, this requires a valid ACT.DAT and IDPS to reactivate them. But, they can be any act/idps files you want to activate them against.

I had a similar problem before, but you need a fully activated act.dat for this to work. It works best when you grab the act.dat of a new (dummy) account that you create on your CFW system, and downloaded a free game/demo with.

You can't use an account that you have content on, which is shared on PS3's. Also you can't put back the act.dat (let's say we ftp a copy out) after deactivating the PS3/account. Sony will delete it from your system when you sign in with it.

In my case i was referring to rap2rif, with a PS3 cfw that act.dat was created by connecting to PSN using an original account that signed in. This account was already active on two PS3's. It didn't get all the data from Sony, so it could not be used. I created an extra dummy account and signed in with it, bought a free add-on, then it was good to go. (with idps, rap2rif, etc.)



More PlayStation 3 News...

catalinnc's Avatar
#2 - catalinnc - 56w ago
Reply
thanks a lot for this amazing tool... how about a rif2rap tool (using act.dat, idps and .rif)

Page 1 of 2 12›LAST »

Related PS3 News and PS3 CFW Hacks or JailBreak Articles

• PS3 EDAT Devklic Bruteforcer v1.0 / v1.1 By JjKkYu is Released
• MAME 0125 (Multiple Arcade Machine Emulator) for PS3 Release 1 Out
• PS3 Game List by Nullptr PlayStation 3 Homebrew App is Released
• MultiMAN v04.40.00 PS3 Server and Showtime Edition Updates Out
• ScummVM 1.6.0 PlayStation 3 Emulator Updated, +4 to Engines
• PSN Tool v1.0 and PSN Tool Creator v1.0 to Combat PSN Bans Arrive
Affiliates  NewsNow  Privacy  PS3 CFW & MFW  PS3 Hacks & JailBreak  PS3 Reviews  PS3 Videos  © 2013 PlayStation 3 News

PlayStation 3 Links

• Contact Us E-Mail
• PS3 Affiliates
• PS3 CFW & MFW
• PS3 Debug Firmware
• PS3 Decrypted PSN Links for CFW
• PS3 Downloads
• PS3 EBOOT.BIN Original File Links
• PS3 Firmware
• PS3 Game Releases List
• PS3 Guides & Tutorials
• PS3 Hacking Guides and Tutorials
• PS3 Hacks & JailBreak
• PS3 Help & Support
• PS3 JailBreak Game Compatibility List
• PS3 JB2 / True Blue (TB) Game Links
• PS3 multiMAN Updates
• PS3 News Forums
• PS3 News Site FAQ
• PS3 News Site Advertising FAQ
• PS3 News Site Posting FAQ
• PS3 News Site Privacy FAQ
• PS3 News Site Rules
• PS3 News Site Tag Cloud
• PS3 News Site Terms
• PS3 Resources
• PS3 Reviews
• PS3 Save Files Repository
• PS3 Themes
• PS3 Trophies List
• PS3 Videos
• PS Vita Trophies List

PlayStation 3 News Discussions
Introductions: Hello Everyone, I'm New at PS3News.com! - 15m ago

polotrigger's Avatar
Quote Hey Y'all! PoLo here! I've been very interested in jailbreaking my ps3 but did not have the free time before. Now, I do so be it! I wanted the freedom...
By polotrigger with
 7173 Comments »
Sony PlayStation Store PS3 and PSN Updates for June 18, 2013 - 27m ago

elser1's Avatar
Quote our update is thursday aus time. it should be there though the usa and eu plus are different games often. we may get something else on occasions. i c...
By elser1 with
 3 Comments »
Rogero CEX PS3 Custom Firmware (CFW) v4.21 is Now Released! - 58m ago

Vaare's Avatar
Quote I am trying to upgrade my Rogero 3.55 to 4.41/4.40 through the XMB and each time it seems to complete install, then it comes back with "The data ...
By Vaare with
 1603 Comments »
Video: XBox One Next-Generation Console Unveiled by Microsoft - 1h ago

imtoodvs's Avatar
Quote hey, just found this out on Facebook, of all places: news.xbox.com/2013/06/update Last week at E3, the excitement, creativity and future of our ind...
By imtoodvs with
 12 Comments »

Latest PlayStation 3 Trophies
Dungeons & Dragons: Daggerdale: The Big Stick
Dungeons & Dragons: Daggerdale: Four of a Kind
Dungeons & Dragons: Daggerdale: Man at Arms
Dungeons & Dragons: Daggerdale: Solid Gold

Latest PlayStation Vita Trophies
Jak II (Vita): The Collectationator!
Jak II (Vita): The Collectivist
Jak II (Vita): The Collector
Jak II (Vita): Head Master

Latest PlayStation 3 Releases
Le Tour De France 2013 PS3-STRiKE - 06-18-2013
MotoGP 13 PS3-COLLATERAL - 06-17-2013
Remember Me USA PS3-ANTiDOTE - 06-17-2013
The Last of Us ASiA MULTi3 PS3-Kirin - 06-14-2013

Latest PlayStation 3 Themes
The Last of Us PS3 Theme - 06-14-2013
God Of War 3 (Unofficial V1/V2) PS3 Theme - 06-12-2013
Heavy Rain (Official) Dynamic PS3 Theme - 06-11-2013
PlayStation Classic PS3 Theme - 06-11-2013
  • Contact Us
  • -
  • PS3 News