Beispiel #1
0
void ControlInfo::Load(vfsStream& f)
{
	type = Read32(f);
	size = Read32(f);
	next = Read64(f);

	if (type == 1)
	{
		control_flags.ctrl_flag1 = Read32(f);
		control_flags.unknown1 = Read32(f);
		control_flags.unknown2 = Read32(f);
		control_flags.unknown3 = Read32(f);
		control_flags.unknown4 = Read32(f);
		control_flags.unknown5 = Read32(f);
		control_flags.unknown6 = Read32(f);
		control_flags.unknown7 = Read32(f);
	}
	else if (type == 2)
	{
		if (size == 0x30)
		{
			f.Read(file_digest_30.digest, 20);
			file_digest_30.unknown = Read64(f);
		}
		else if (size == 0x40)
		{
			f.Read(file_digest_40.digest1, 20);
			f.Read(file_digest_40.digest2, 20);
			file_digest_40.unknown = Read64(f);
		}
	}
	else if (type == 3)
	{
		npdrm.magic = Read32(f);
		npdrm.unknown1 = Read32(f);
		npdrm.license = Read32(f);
		npdrm.type = Read32(f);
		f.Read(npdrm.content_id, 48);
		f.Read(npdrm.digest, 16);
		f.Read(npdrm.invdigest, 16);
		f.Read(npdrm.xordigest, 16);
		npdrm.unknown2 = Read64(f);
		npdrm.unknown3 = Read64(f);
	}
}
Beispiel #2
0
	static char ReadCharNN(vfsStream& f)
	{
		char c;
		while(!f.Eof())
		{
			f.Read(&c, 1);
			if(c != 0) break;
		}
			
		return c;
	}
Beispiel #3
0
	static void GoToNN(vfsStream& f)
	{
		while(!f.Eof())
		{
			char c;
			f.Read(&c, 1);
			if(c != 0)
			{
				f.Seek(f.Tell() - 1);
				break;
			}
		}
	}
Beispiel #4
0
	static char ReadChar(vfsStream& f)
	{
		char c;
		f.Read(&c, 1);
		return c;
	}
Beispiel #5
0
void Elf32_Phdr::LoadLE(vfsStream& f)
{
	f.Read(this, sizeof(*this));
}
Beispiel #6
0
__forceinline u64 Read64LE(vfsStream& f)
{
	u64 ret;
	f.Read(&ret, sizeof(ret));
	return ret;
}
Beispiel #7
0
void Signature::Load(vfsStream& f)
{
	f.Read(r, 21);
	f.Read(s, 21);
	f.Read(padding, 6);
}
Beispiel #8
0
void SectionHash::Load(vfsStream& f)
{
	f.Read(sha1, 20);
	f.Read(padding, 12);
	f.Read(hmac_key, 64);
}
Beispiel #9
0
__forceinline u32 Read32LE(vfsStream& f)
{
	u32 ret;
	f.Read(&ret, sizeof(ret));
	return ret;
}
Beispiel #10
0
__forceinline u16 Read16LE(vfsStream& f)
{
	u16 ret;
	f.Read(&ret, sizeof(ret));
	return ret;
}
Beispiel #11
0
__forceinline u64 Read64(vfsStream& f)
{
	be_t<u64> ret;
	f.Read(&ret, sizeof(ret));
	return ret;
}
Beispiel #12
0
__forceinline u32 Read32(vfsStream& f)
{
	be_t<u32> ret;
	f.Read(&ret, sizeof(ret));
	return ret;
}
Beispiel #13
0
__forceinline u16 Read16(vfsStream& f)
{
	be_t<u16> ret;
	f.Read(&ret, sizeof(ret));
	return ret;
}
Beispiel #14
0
__forceinline u8 Read8(vfsStream& f)
{
	u8 ret;
	f.Read(&ret, sizeof(ret));
	return ret;
}