From 52048d9a429dc0ec7fda6e9a996733597ee468fb Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Wed, 13 Dec 2023 21:43:17 -0500 Subject: [PATCH] Don't crash on older code directory versions Team ID wasn't added until 0x20200, so check that to make sure it's available first. --- ldid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldid.cpp b/ldid.cpp index cc9a7f2..a300a07 100644 --- a/ldid.cpp +++ b/ldid.cpp @@ -3903,7 +3903,7 @@ int main(int argc, char *argv[]) { PKCS7_free(p7); } - if (Swap(directory->teamIDOffset) > 0) + if (Swap(directory->version) >= 0x20200 && Swap(directory->teamIDOffset) > 0) printf("TeamIdentifier=%s\n", blob + best->second.offset + Swap(directory->teamIDOffset)); else printf("TeamIdentifier=not set\n");