Beispiel #1
0
 public static NPD createNPD(byte[] npd)
 {
     NPD npd2 = new NPD();
     ConversionUtils.arraycopy(npd, 0, npd2.magic, 0L, 4);
     npd2.version = ConversionUtils.be32(npd, 4);
     npd2.license = ConversionUtils.be32(npd, 8);
     npd2.type = ConversionUtils.be32(npd, 12);
     ConversionUtils.arraycopy(npd, 0x10, npd2.content_id, 0L, 0x30);
     ConversionUtils.arraycopy(npd, 0x40, npd2.digest, 0L, 0x10);
     ConversionUtils.arraycopy(npd, 80, npd2.titleHash, 0L, 0x10);
     ConversionUtils.arraycopy(npd, 0x60, npd2.devHash, 0L, 0x10);
     npd2.unknown3 = ConversionUtils.be64(npd, 0x70);
     npd2.unknown4 = ConversionUtils.be64(npd, 120);
     if (!npd2.validate())
     {
         npd2 = null;
     }
     return npd2;
 }
Beispiel #2
0
        public static NPD createNPD(byte[] npd)
        {
            NPD result = new NPD();

            ConversionUtils.arraycopy(npd, 0, result.magic, 0, 4);
            result.version = ConversionUtils.be32(npd, 4);
            result.license = ConversionUtils.be32(npd, 8);
            result.type    = ConversionUtils.be32(npd, 0xC);
            ConversionUtils.arraycopy(npd, 0x10, result.content_id, 0, 0x30);
            ConversionUtils.arraycopy(npd, 0x40, result.digest, 0, 0x10);
            ConversionUtils.arraycopy(npd, 0x50, result.titleHash, 0, 0x10);
            ConversionUtils.arraycopy(npd, 0x60, result.devHash, 0, 0x10);
            result.unknown3 = ConversionUtils.be64(npd, 0x70);
            result.unknown4 = ConversionUtils.be64(npd, 0x78);
            if (!result.validate())
            {
                result = null;
            }
            return(result);
        }
Beispiel #3
0
        public static NPD createNPD(byte[] npd)
        {
            NPD npd2 = new NPD();

            ConversionUtils.arraycopy(npd, 0, npd2.magic, 0L, 4);
            npd2.version = ConversionUtils.be32(npd, 4);
            npd2.license = ConversionUtils.be32(npd, 8);
            npd2.type    = ConversionUtils.be32(npd, 12);
            ConversionUtils.arraycopy(npd, 0x10, npd2.content_id, 0L, 0x30);
            ConversionUtils.arraycopy(npd, 0x40, npd2.digest, 0L, 0x10);
            ConversionUtils.arraycopy(npd, 80, npd2.titleHash, 0L, 0x10);
            ConversionUtils.arraycopy(npd, 0x60, npd2.devHash, 0L, 0x10);
            npd2.unknown3 = ConversionUtils.be64(npd, 0x70);
            npd2.unknown4 = ConversionUtils.be64(npd, 120);
            if (!npd2.validate())
            {
                npd2 = null;
            }
            return(npd2);
        }