chovy-sign/GameBuilder/VersionKey/ActRifMethod.cs

27 lines
805 B
C#
Raw Normal View History

2023-04-16 19:48:32 +00:00
using GameBuilder.Psp;
using Org.BouncyCastle.Asn1.Pkcs;
using PspCrypto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GameBuilder.VersionKey
{
public class ActRifMethod
{
public static NpDrmInfo GetVersionKey(byte[] actDat, byte[] licenseDat, byte[] consoleId, int keyType)
{
byte[] versionKey = new byte[0x10];
SceNpDrm.SetPSID(consoleId);
SceNpDrm.sceNpDrmGetVersionKey(versionKey, actDat, licenseDat, keyType);
2023-04-16 22:14:13 +00:00
SceNpDrm.Aid = BitConverter.ToUInt64(licenseDat, 0x8);
2023-04-16 19:48:32 +00:00
2023-04-16 22:14:13 +00:00
string contentId = Encoding.UTF8.GetString(licenseDat, 0x10, 0x24);
2023-04-16 19:48:32 +00:00
return new NpDrmInfo(versionKey, contentId, keyType);
}
}
}