From cbfe6539a5d24d6904b9479255feb20fc2939492 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 11 Apr 2019 17:56:59 +0200 Subject: [PATCH] Check if the TMD is from a WiiU by checking the titleID --- src/de/mas/wiiu/jnus/entities/TMD.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/de/mas/wiiu/jnus/entities/TMD.java b/src/de/mas/wiiu/jnus/entities/TMD.java index cb15e38..a80e74e 100644 --- a/src/de/mas/wiiu/jnus/entities/TMD.java +++ b/src/de/mas/wiiu/jnus/entities/TMD.java @@ -147,6 +147,9 @@ public final class TMD { buffer.position(0x184); long systemVersion = buffer.getLong(); long titleID = buffer.getLong(); + if((titleID & 0x0005000000000000L) != 0x0005000000000000L) { + throw new ParseException("Invalid TMD file. This is not a Wii U TMD", 0); + } int titleType = buffer.getInt(); short groupID = buffer.getShort();