mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-27 01:44:15 +01:00
Use NRO0 verification instead of ASET verification
This commit is contained in:
parent
012b1df5d8
commit
07fb87b441
@ -73,24 +73,10 @@ public class NroMeta {
|
|||||||
public static boolean verifyFile(String file) {
|
public static boolean verifyFile(String file) {
|
||||||
try {
|
try {
|
||||||
RandomAccessFile f = new RandomAccessFile(file, "r");
|
RandomAccessFile f = new RandomAccessFile(file, "r");
|
||||||
f.seek(0x18); // Skip to NroHeader.size
|
f.seek(0x10); // Skip to NroHeader.magic
|
||||||
int asetOffset = Integer.reverseBytes(f.readInt());
|
|
||||||
f.seek(asetOffset); // Skip to the offset specified by NroHeader.size
|
|
||||||
byte[] buffer = new byte[4];
|
byte[] buffer = new byte[4];
|
||||||
f.read(buffer);
|
f.read(buffer);
|
||||||
if (!(new String(buffer).equals("ASET")))
|
if (!(new String(buffer).equals("NRO0")))
|
||||||
return false;
|
|
||||||
|
|
||||||
f.skipBytes(0x4);
|
|
||||||
long iconOffset = Long.reverseBytes(f.readLong());
|
|
||||||
int iconSize = Integer.reverseBytes(f.readInt());
|
|
||||||
if (iconOffset == 0 || iconSize == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
f.seek(asetOffset + 0x18);
|
|
||||||
long nacpOffset = Long.reverseBytes(f.readLong());
|
|
||||||
long nacpSize = Long.reverseBytes(f.readLong());
|
|
||||||
if (nacpOffset == 0 || nacpSize == 0)
|
|
||||||
return false;
|
return false;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user