PSPReverse / PSPTool

Display, extract, and manipulate PSP firmware inside UEFI images
GNU General Public License v3.0
612 stars 62 forks source link

info loss with commit/revision `e963896` #35

Closed orangecms closed 3 years ago

orangecms commented 3 years ago

Compared to three commits prior to e963896, some information in the --json output changed; parts seem lost, others added, for example:

--- A3MSTX_3.60.psp0.json       2021-11-15 23:51:38.574662042 +0100
+++ A3MSTX_3.60.psp1.json       2021-11-15 23:51:24.877849820 +0100
@@ -8,19 +8,12 @@
       {
         "index": 0,
         "address": 692224,
-        "size": 1435262658,
+        "size": 576,
         "sectionType": "AMD_PUBLIC_KEY~0x0",
-        "magic": "",
-        "version": "0.0.0.0",
-        "info": [
-          "legacy Header"
-        ],
-        "md5": "D41D",
-        "sizes": {
-          "signed": 1435262402,
-          "uncompressed": 0,
-          "packed": 0
-        }
+        "magic": "C25D",
+        "version": "",
+        "info": [],
+        "md5": "EA44"
       },
       {
         "index": 1,
@@ -30,7 +23,8 @@
         "magic": "",
         "version": "0.5.0.45",
         "info": [
-          "legacy Header"
+          "signed(C25D)",
+          "legacy header"
         ],
         "md5": "D41D",
         "sizes": {
@@ -48,7 +42,7 @@
         "version": "0.0.0.0",
         "info": [
           "compressed",
-          "legacy Header"
+          "legacy header"
         ],
         "md5": "D41D",
         "sizes": {

in another place:

@@ -160,19 +149,12 @@
       {
         "index": 10,
         "address": 724992,
-        "size": 1435262658,
+        "size": 832,
         "sectionType": "PSP_BOOT_TIME_TRUSTLETS_KEY~0xd",
-        "magic": "",
-        "version": "0.0.0.0",
-        "info": [
-          "legacy Header"
-        ],
-        "md5": "D41D",
-        "sizes": {
-          "signed": 1435262402,
-          "uncompressed": 0,
-          "packed": 0
-        }
+        "magic": "0483",
+        "version": "",
+        "info": [],
+        "md5": "FC16"
       },
       {
         "index": 11,

and another:

@@ -757,9 +762,11 @@
         "magic": "",
         "version": "0.0.0.0",
         "info": [
-          "compressed"
+          "compressed",
+          "signed(60BB)",
+          "verified"
         ],
-        "md5": "E309",
+        "md5": "4702",
         "sizes": {
           "signed": 261888,
           "uncompressed": 261888,
@@ -774,9 +781,11 @@
         "magic": "$PS1",
         "version": "0.8.0.60",
         "info": [
-          "compressed"
+          "compressed",
+          "signed(60BB)",
+          "verified"
         ],
-        "md5": "FF4B",
+        "md5": "7950",
         "sizes": {
           "signed": 7872,
           "uncompressed": 7872,

However, the total output size got bigger (in this example, before: 76100 bytes, after: 80470 bytes).

Is that a bug fix, or is something just really weird and fishy?

orangecms commented 3 years ago

Looking at the actual content, it does seem to make more sense now, e.g., they key size 576 sounds more reasonable than 1435262658 (more than a gigabyte, very unlikely!).

Did I mess that up first? Indeed, checking out just before my other 4 commits, the outputs look much more similar again.

So I'm closing this; sorry for the fuzz. I'm definitely not a Python dev. :upside_down_face:

cwerling commented 3 years ago

No worries :)