Skip to content

Commit 8518af2

Browse files
committed
MEA v1.48.0 r118
v1.48.0 Added CSME 12 FWUpdate Type support Fixed issues under rare circumstances r118 CSME 12.0.0.1069_CON_H_XX_PRD_FWU CSME 12.0.0.1062_CON_H_XX_PRD_EXTR CSME 12.0.0.1059_CON_H_XX_PRD_EXTR CSME 12.0.0.1046_CON_H_XX_PRD_EXTR CSME 11.8.50.3460_CON_H_D0_PRD_RGN CSME 11.8.50.3460_COR_H_D0_PRD_RGN CSME 11.8.50.3460_CON_LP_C0_YPDM_PRD_RGN CSME 11.8.50.3460_CON_LP_C0_NPDM_PRD_RGN CSME 11.8.50.3434_CON_LP_C0_NPDM_PRD_EXTR ME 10.0.57.3000_5MB_PRD_RGN ME 9.1.43.3004_5MB_PRD_RGN TXE 1.1.0.1115_1.375MB_MD_PRD_RGN
1 parent ebe4be0 commit 8518af2

File tree

4 files changed

+86
-48
lines changed

4 files changed

+86
-48
lines changed

Changelog DB.txt

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
r118
2+
3+
CSME 12.0.0.1069_CON_H_XX_PRD_FWU
4+
CSME 12.0.0.1062_CON_H_XX_PRD_EXTR
5+
CSME 12.0.0.1059_CON_H_XX_PRD_EXTR
6+
CSME 12.0.0.1046_CON_H_XX_PRD_EXTR
7+
CSME 11.8.50.3460_CON_H_D0_PRD_RGN
8+
CSME 11.8.50.3460_COR_H_D0_PRD_RGN
9+
CSME 11.8.50.3460_CON_LP_C0_YPDM_PRD_RGN
10+
CSME 11.8.50.3460_CON_LP_C0_NPDM_PRD_RGN
11+
CSME 11.8.50.3434_CON_LP_C0_NPDM_PRD_EXTR
12+
ME 10.0.57.3000_5MB_PRD_RGN
13+
ME 9.1.43.3004_5MB_PRD_RGN
14+
TXE 1.1.0.1115_1.375MB_MD_PRD_RGN
15+
116
r117
217

318
CSTXE 4.0.0.1245_Bx_PRD_EXTR

Changelog MEA.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v1.48.0 r118
2+
3+
Added CSME 12 FWUpdate Type support
4+
Fixed issues under rare circumstances
5+
16
v1.46.1 r117
27

38
Fixed crashes under rare circumstances

MEA.dat

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
*** ME Analyzer Engine Firmware Repository Database ***
2-
*** Revision r117 (2018-03-15 , 14:04) ***
2+
*** Revision r118 (2018-04-04 , 19:04) ***
33

44
*** Converged Security Management Engine (CSME) ***
55

66
*** Version_SKU_Stepping_Release_Type_FTPR-RSASIG-SHA256 ***
77
*** 11 LP: Version_SKU_Stepping_Release_PDM_Type_FTPR-RSASIG-SHA256 ***
88

9-
12.0.0.1069_CON_H_XX_PRD_EXTR_93CCF1C009833026583B72B433B1E5990FB5FC043C7FA54C1A13BF5F67440742
9+
12.0.0.1069_CON_H_XX_PRD_FWU_93CCF1C009833026583B72B433B1E5990FB5FC043C7FA54C1A13BF5F67440742
1010
12.0.0.1062_CON_H_XX_PRD_EXTR_A0D154336EC76A703A4D3AD943AD654A4F98A2DFE2EFB687F23969A4B7AEECD8
1111
12.0.0.1059_CON_H_XX_PRD_EXTR_28E5178B8C42FC077A5382F8827549935ABBBD51447EADA52262423E01C27FF9
1212
12.0.0.1046_CON_H_XX_PRD_EXTR_5DBD89037027C5E56A0FCEEDFFD08476FFDD82B24E246145D55D7CD440145F35
@@ -49,11 +49,16 @@
4949

5050

5151

52+
11.8.50.3460_CON_H_D0_PRD_RGN_A94BB4D7B8BCDA9028073BB28E6A9241160FDBBE3C4C4AF871108DEBB9EACC96
53+
11.8.50.3460_COR_H_D0_PRD_RGN_76D90A361FBD5879C74E85FDFCD6D4E7D3A621E5FC08AA1F74422E711F8A2DFC
54+
11.8.50.3460_CON_LP_C0_YPDM_PRD_RGN_EE786679066CD94815B625293F90B270A7F2758FC35EA3E18ED29A6A675E768C
55+
11.8.50.3460_CON_LP_C0_NPDM_PRD_RGN_096CA94F608B33FAFF816667BADD2DDC12A14FEF00811C6A81BCB97B66C21A55
5256
11.8.50.3448_CON_H_D0_PRD_RGN_E5EDF7BC7D0AE2C9322D1068353BDD9F28677F379E7C9B59FDA5C39C9792C19D
5357
11.8.50.3448_COR_H_D0_PRD_RGN_035A4563269885B05F49CC84CED713FD847F919D38D81BCD80189AEF5C66E490
5458
11.8.50.3448_CON_LP_C0_NPDM_PRD_RGN_F64A773E2FB3506059F246B7F36C45A5DD0BB9378516214918F63F9D657E99CA
5559
11.8.50.3448_COR_LP_C0_NPDM_PRD_RGN_3045D59873088880655B7E3139B51013AB1E26A62845C09A4D65F36D43983A15
5660
11.8.50.3434_CON_H_D0_PRD_RGN_00F4D0F2E817A5341514F5396C8C9B6E36A863C3AEDF3D5ADDE20255B3D7E213
61+
11.8.50.3434_CON_LP_C0_NPDM_PRD_EXTR_DCC9F1B9DE2F223C6EE9EBAC2E89ED423F0EF1D27A39B0FBAE99B946E8E5949B
5762
11.8.50.3434_COR_H_D0_PRD_RGN_9B7506F2DAB217A8151274E7607DC3C2AF6D4135C22509600A201D5F46546A77
5863
11.8.50.3426_CON_H_D0_PRD_RGN_4A1F249755365323BF437C6BBEC5B02079723B04F7ECD7A836D9A3DD17B8A625
5964
11.8.50.3426_COR_H_D0_PRD_RGN_119E0F2043E408D3DE1C182B0638D42DCD6CA3332FA4F99358B47B8E238012C1
@@ -73,6 +78,9 @@
7378
11.8.50.3399_CON_LP_C0_NPDM_PRD_RGN_4858AFF359E1FB38FAD666CEE9FFA1AC2355BF22345AA47677BCD5204FF3F971
7479
11.8.50.3399_COR_LP_C0_NPDM_PRD_RGN_2141C8CE33DB5461944F1E7451451061629E2EDEC3C82D7BD1E572AF197A1647
7580

81+
11.8.50.3460_CON_H_D0_PRE_RGN_159665A03485EEB8FA676B31DA9FFCBA50AD3D45B6E6B30BCCACAA18CF2F3ACE
82+
11.8.50.3460_CON_LP_C0_YPDM_PRE_RGN_E184F5EC2EB80BD46E93FDACAD82A482F23670E5CDFF8352826B9A6E84396FD7
83+
11.8.50.3460_CON_LP_C0_NPDM_PRE_RGN_5E72E856AEF1E7AFC82F49A0A569258D1896C4FB0C2E07E585706BF3B2F15E42
7684
11.8.50.3425_CON_H_D0_PRE_RGN_1B111EDCC6076215747B47E98641F13D586C01AFE50335BFC0499027EE10AC09
7785
11.8.50.3425_COR_H_D0_PRE_RGN_DC87EEE5E68F61C72B54631D3F17B1841E178C98C5499B455C3D0281B36D6A42
7886
11.8.50.3425_CON_LP_C0_YPDM_PRE_RGN_6E8DFF491F494745CC7E99EB7BF6669CE9FA7E15C538CA91558362D209C6E70B
@@ -453,6 +461,7 @@
453461

454462
*** Version_SKU_Release_Type_FTPR-RSASIG-SHA256 ***
455463

464+
10.0.57.3000_5MB_PRD_RGN_1FD7E2F3EDFCB2C71671184F40EC58E5DFA3D4B7B7CEC1C2B9E65D8611621B93
456465
10.0.56.3002_5MB_PRD_RGN_B789391F874A0DBA9E2074E820A97A8DD601CD96579ECE0B170B6D810BFBF1BF
457466
10.0.55.3000_5MB_PRD_RGN_A0E3560FB1BFA1309921CD4AF08CF31A7BE44EF29F357E26C7C1B6A5EE81BEB0
458467
10.0.55.3000_1.5MB_PRD_RGN_D418CC190395C50D074FF034DF18F6C58EA433E06A0A6135A31D4069761AB021
@@ -558,6 +567,7 @@
558567
9.6.0.1038_1.5MB_PRD_RGN_9BBD9D873D68476A98ED2220CD45924546D842EE899B582179AE64D0F2BC50E3
559568
9.6.0.1038_1.5MB_PRE_RGN_58F86C7B5C9C66097F125C93902540171F30522F598D393411A8673157CAA5C7
560569

570+
9.1.43.3004_5MB_PRD_RGN_A1E39417FD8038419010A96BB0CBD9A412BEFB01CAFEB280B58A8BC77D06AB12
561571
9.1.42.3002_5MB_PRD_RGN_5E16EBED9EDBDE1DECBB7B4633BDE6AEDF4C21688BB7570EC1177F2E0148638A
562572
9.1.41.3024_5MB_PRD_RGN_3446D876C988705042C463DA946CEB8626128345C96DA0AA567E69310F153B1A
563573
9.1.40.1000_5MB_PRD_RGN_D7FFD7FA4CD0FAB55A6D0FCA867F33660547B0D404EF1586560C4AD45F2B5195
@@ -1317,7 +1327,7 @@
13171327
1.1.1.1120_1.375MB_MD_PRD_RGN_4183661EF48354F89778ADFA7045EF23BD0E2F84D63064D772C1BA5970550CF2
13181328
1.1.1.1120_1.375MB_IT_PRD_EXTR_5C55B24E1E11C546128F27595DEEFE8EDC2932CD9B0143CC6B34F447626181DB
13191329
1.1.1.1115_1.375MB_MD_PRD_RGN_B8D210F5C91B836AD85CB3494C36B05A20A2C070F1B2DBA083D79997ADFF0BBB
1320-
1.1.0.1115_1.375MB_MD_PRD_EXTR_8FF64D0A0C17E5313513F32BCC16721481E69CDE98F7F6A580311783E6E72141
1330+
1.1.0.1115_1.375MB_MD_PRD_RGN_8FF64D0A0C17E5313513F32BCC16721481E69CDE98F7F6A580311783E6E72141
13211331
1.1.0.1113_1.375MB_MD_PRD_RGN_045ECCA8BE2296BA8BCEAEFDB0988CBC96FD80B37DB998A484DD3CC15B3FB1B5
13221332
1.1.0.1113_1.375MB_IT_PRD_EXTR_EADAF0642A81588F44CAED20659DEAA5607FFAE13FDA0439C8287DA49BFA6503
13231333
1.1.0.1106_1.375MB_MD_PRD_EXTR_E786953BBFBA1E20F05BAC4E6C772728F6AF83D1330B11BF7CD754DDCAE592BC
@@ -1784,20 +1794,20 @@ Latest_CSME_1121_CORH__11.21.50.1451
17841794
Latest_CSME_1111_CONH__11.11.50.1436
17851795
Latest_CSME_1111_CORH__11.11.50.1422
17861796
Latest_CSME_1111_SLMH__11.11.0.0000
1787-
Latest_CSME_118_CONH__11.8.50.3448
1788-
Latest_CSME_118_CORH__11.8.50.3448
1789-
Latest_CSME_118_CONLP__11.8.50.3448
1797+
Latest_CSME_118_CONH__11.8.50.3460
1798+
Latest_CSME_118_CORH__11.8.50.3460
1799+
Latest_CSME_118_CONLP__11.8.50.3460
17901800
Latest_CSME_118_CORLP__11.8.50.3448
17911801
Latest_CSME_118_SLMH__11.8.50.3425
17921802
Latest_CSME_118_SLMLP__11.8.50.3425
17931803
Latest_ME_100_1.5MB__10.0.55.3000
1794-
Latest_ME_100_5MB__10.0.56.3002
1804+
Latest_ME_100_5MB__10.0.57.3000
17951805
Latest_ME_100_SLM__10.0.35.1012
17961806
Latest_ME_95_1.5MB__9.5.60.1952
17971807
Latest_ME_95_5MB__9.5.62.3002
17981808
Latest_ME_95_SLM__9.5.4.1856
17991809
Latest_ME_91_1.5MB__9.1.37.1002
1800-
Latest_ME_91_5MB__9.1.42.3002
1810+
Latest_ME_91_5MB__9.1.43.3004
18011811
Latest_ME_90_1.5MB__9.0.31.1487
18021812
Latest_ME_90_5MB__9.0.31.3488
18031813
Latest_ME_8_1.5MB__8.1.70.1590

MEA.py

+48-40
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Copyright (C) 2014-2018 Plato Mavropoulos
77
"""
88

9-
title = 'ME Analyzer v1.46.1'
9+
title = 'ME Analyzer v1.48.0'
1010

1111
import os
1212
import re
@@ -3059,8 +3059,8 @@ def cse_unpack(fpt_part_all, bpdt_part_all, fw_type, file_end, fpt_start, fpt_ch
30593059

30603060
print(col_y + '\n--> Stored $FPT %s Partition "%s" [0x%0.6X - 0x%0.6X]' % (part_type, part_name, part_start, part_end) + col_e)
30613061

3062-
if part[0] in [b'UTOK',b'STKN',b'OEMP'] :
3063-
ext_print,x1 = key_anl(mod_fname, [], part_name, [variant, major, minor, hotfix, build]) # Retrieve & Store UTOK/STKN/OEMP Extension Info
3062+
if part[0] in [b'UTOK',b'STKN'] :
3063+
ext_print,x1 = key_anl(mod_fname, [], part_name, [variant, major, minor, hotfix, build]) # Retrieve & Store UTOK/STKN Extension Info
30643064

30653065
# Print Manifest/Metadata/Key Extension Info
30663066
for index in range(0, len(ext_print), 2) : # Only Name (index), skip Info (index + 1)
@@ -3120,8 +3120,8 @@ def cse_unpack(fpt_part_all, bpdt_part_all, fw_type, file_end, fpt_start, fpt_ch
31203120

31213121
print(col_y + '\n--> Stored BPDT %s Partition "%s" [0x%0.6X - 0x%0.6X]' % (part_order, part_name, part_start, part_end) + col_e)
31223122

3123-
if part[0] in ['UTOK','OEMP'] :
3124-
ext_print,x1 = key_anl(mod_fname, [], part_name, [variant, major, minor, hotfix, build]) # Retrieve & Store UTOK/OEMP Extension Info
3123+
if part[0] in ['UTOK'] :
3124+
ext_print,x1 = key_anl(mod_fname, [], part_name, [variant, major, minor, hotfix, build]) # Retrieve & Store UTOK Extension Info
31253125

31263126
# Print Manifest/Metadata/Key Extension Info
31273127
for index in range(0, len(ext_print), 2) : # Only Name (index), skip Info (index + 1)
@@ -3305,7 +3305,7 @@ def ext_anl(input_type, input_offset, file_end, var_ver) :
33053305
hdr_rev_tag = '' # CSE Extension Header Revision Tag
33063306
mod_rev_tag = '' # CSE Extension Module Revision Tag
33073307

3308-
if ((variant,major) == ('CSME',12) and (minor,hotfix,build) not in [(0,0,7070),(0,0,7075)]) or dnx_version == 2 :
3308+
if ((variant,major) == ('CSME',12) and not ((minor,hotfix) == (0,0) and build >= 7000)) or dnx_version == 2 :
33093309
if ext_tag in ext_tag_rev_hdr : hdr_rev_tag = '_R2'
33103310
if ext_tag in ext_tag_rev_mod : mod_rev_tag = '_R2'
33113311
else :
@@ -4225,7 +4225,7 @@ def key_anl(mod_fname, ext_print, mod_name, var_ver) :
42254225
hdr_rev_tag = '' # CSE Extension Header Revision Tag
42264226
mod_rev_tag = '' # CSE Extension Module Revision Tag
42274227

4228-
if (variant,major) == ('CSME',12) and (minor,hotfix,build) not in [(0,0,7070),(0,0,7075)] :
4228+
if (variant,major) == ('CSME',12) and not ((minor,hotfix) == (0,0) and build >= 7000) :
42294229
if ext_tag in ext_tag_rev_hdr : hdr_rev_tag = '_R2'
42304230
if ext_tag in ext_tag_rev_mod : mod_rev_tag = '_R2'
42314231
else :
@@ -4610,6 +4610,7 @@ def uefi_find(file_in, uf_path) :
46104610
header count 0C111D82A3D0F74CAEF3E28088491704 {0}\n\
46114611
header count 6E1F582C87B1AA4696E72081098D6413 {0}\n\
46124612
header count 8226C7591C5C22479F25B26F4275BFEF {0}\n\
4613+
header count 9D3EF263DA5F5E419C2A64C4E2A6ECE8 {0}\n\
46134614
".format(file_in).replace(' ', '')
46144615

46154616
try :
@@ -4693,15 +4694,16 @@ def fovd_clean(fovdtype) :
46934694
def fw_types(fw_type) :
46944695
type_db = 'NaN'
46954696

4696-
if variant in ['SPS','CSSPS'] and (fw_type == "Region" or fw_type == "Region, Stock" or fw_type == "Region, Extracted") : # SPS --> Region (EXTR at DB)
4697-
fw_type = "Region"
4698-
type_db = "EXTR"
4699-
elif fw_type == "Region, Extracted" : type_db = "EXTR"
4700-
elif fw_type == "Region, Stock" or fw_type == "Region" : type_db = "RGN"
4701-
elif fw_type == "Update" : type_db = "UPD"
4702-
elif fw_type == "Operational" : type_db = "OPR"
4703-
elif fw_type == "Recovery" : type_db = "REC"
4704-
elif fw_type == "Unknown" : type_db = "UNK"
4697+
if variant in ['SPS','CSSPS'] and fw_type in ['Region','Region, Stock','Region, Extracted'] : # SPS --> Region (EXTR at DB)
4698+
fw_type = 'Region'
4699+
type_db = 'EXTR'
4700+
elif fw_type == 'Region, Extracted' : type_db = 'EXTR'
4701+
elif fw_type == 'Region, FWUpdate' : type_db = 'FWU'
4702+
elif fw_type == 'Region, Stock' or fw_type == 'Region' : type_db = 'RGN'
4703+
elif fw_type == 'Update' : type_db = 'UPD'
4704+
elif fw_type == 'Operational' : type_db = 'OPR'
4705+
elif fw_type == 'Recovery' : type_db = 'REC'
4706+
elif fw_type == 'Unknown' : type_db = 'UNK'
47054707

47064708
return fw_type, type_db
47074709

@@ -5103,6 +5105,7 @@ def mass_scan(f_path) :
51035105
me11_sku_anl = False
51045106
me11_ker_msg = False
51055107
can_search_db = True
5108+
fpt_chk_null = False
51065109
fpt_chk_fail = False
51075110
fpt_num_fail = False
51085111
cse_lt_exist = False
@@ -5473,7 +5476,7 @@ def mass_scan(f_path) :
54735476
else :
54745477
p_empty = 'No'
54755478

5476-
if p_empty == 'No' :
5479+
if p_empty == 'No' and p_offset_spi < file_end :
54775480
# Get CSE Partition Instance ID
54785481
cse_in_id,x1,x2 = cse_part_inid(reading, p_offset_spi, ext_dict)
54795482
cse_in_id_str = '%0.4X' % cse_in_id
@@ -5517,11 +5520,11 @@ def mass_scan(f_path) :
55175520
fpt_romb_found = True
55185521
if p_offset_spi != 0 and p_size != 0 : fpt_romb_used = True
55195522

5520-
# CSME12+ FWUpdate tool requires PMC firmware (PMCP, EXTR not RGN)
5523+
# CSME12+ FWUpdate tool requires PMC firmware (PMCP)
55215524
if p_name == 'PMCP' and p_empty == 'No' : fwu_pmcp_found = True
55225525

5523-
# Detect if CSE firmware has OEM/ODM Unlock Token (UTOK/STKN/OEMP)
5524-
if p_name in ('UTOK','STKN','OEMP') and reading[p_offset_spi:p_offset_spi + 0x10] != b'\xFF' * 0x10 : utok_found = True
5526+
# Detect if CSE firmware has OEM/ODM Unlock Token (UTOK/STKN)
5527+
if p_name in ('UTOK','STKN') and p_offset_spi < file_end and reading[p_offset_spi:p_offset_spi + 0x10] != b'\xFF' * 0x10 : utok_found = True
55255528

55265529
if 0 < p_offset_spi < p_max_size and 0 < p_size < p_max_size : eng_fw_end = p_offset_spi + p_size
55275530
else : eng_fw_end = p_max_size
@@ -5609,7 +5612,7 @@ def mass_scan(f_path) :
56095612
if p_type in bpdt_dict : p_name = bpdt_dict[p_type]
56105613
else : p_name = 'Unknown'
56115614

5612-
if p_empty == 'No' :
5615+
if p_empty == 'No' and p_offset_spi < file_end :
56135616
# Get CSE Partition Instance ID
56145617
cse_in_id,x1,x2 = cse_part_inid(reading, p_offset_spi, ext_dict)
56155618

@@ -5626,7 +5629,7 @@ def mass_scan(f_path) :
56265629

56275630
pt_dbpdt.add_row([p_name,'%0.2d' % p_type,'Primary',p_offset_print,p_size_print,p_end_print,'%0.4X' % cse_in_id,p_empty])
56285631

5629-
if p_type == 5 and p_empty == 'No' : # Secondary BPDT (S-BPDT)
5632+
if p_type == 5 and p_empty == 'No' and p_offset_spi < file_end : # Secondary BPDT (S-BPDT)
56305633
init_s_bpdt_ver = int.from_bytes(reading[start_fw_start_match + 0x6:start_fw_start_match + 0x8], 'little') # BPDT Version
56315634
if init_s_bpdt_ver == 2 : s_bpdt_hdr = get_struct(reading, p_offset_spi, BPDT_Header_2)
56325635
else : s_bpdt_hdr = get_struct(reading, p_offset_spi, BPDT_Header)
@@ -5683,7 +5686,7 @@ def mass_scan(f_path) :
56835686
bpdt_part_all.append([p_name, p_offset_spi, p_offset_spi + p_size, p_type, p_empty, 'Primary', cse_in_id])
56845687

56855688
# Adjust Manifest Header to Recovery section based on BPDT
5686-
if p_type == 2 and p_empty == 'No' : # CSE_BUP
5689+
if p_type == 2 and p_empty == 'No' and p_offset_spi < file_end : # CSE_BUP
56875690
# Only if partition exists at file (counter-example: sole IFWI etc)
56885691
# noinspection PyTypeChecker
56895692
if p_offset_spi + p_size <= file_end :
@@ -5699,9 +5702,9 @@ def mass_scan(f_path) :
56995702
# Show BPDT Partition info on demand (-dfpt)
57005703
if param.fpt_disp : print('%s\n' % pt_dbpdt)
57015704

5702-
# Detect if CSE firmware has OEM/ODM Unlock Token (UTOK/STKN/OEMP)
5705+
# Detect if CSE firmware has OEM/ODM Unlock Token (UTOK/STKN)
57035706
for part in bpdt_part_all :
5704-
if part[0] in ('UTOK','STKN','OEMP') and reading[part[1]:part[1] + 0x10] != b'\xFF' * 0x10 : utok_found = True
5707+
if part[0] in ('UTOK','STKN') and reading[part[1]:part[1] + 0x10] != b'\xFF' * 0x10 : utok_found = True
57055708

57065709
# Detect BPDT partition overlaps
57075710
for part in bpdt_part_all :
@@ -5757,8 +5760,10 @@ def mass_scan(f_path) :
57575760
fpt_chk_calc = '0x%0.2X' % ((0x100 - chk_sum & 0xFF) & 0xFF)
57585761
if fpt_chk_calc != fpt_chk_file: fpt_chk_fail = True
57595762

5760-
# CSME12+, CSTXE3+, CSSPS5+ EXTR checksum from FIT is a placeholder (0x00), ignore
5761-
if fpt_chk_fail and fpt_chk_file == '0x00' and variant in ['CSME','CSTXE','CSSPS'] : fpt_chk_fail = False
5763+
# CSME12+ & CSTXE EXTR checksum from FIT is a placeholder (0x00), ignore
5764+
if ((variant == 'CSME' and major >= 12) or variant == 'CSTXE') and fpt_chk_file == '0x00' :
5765+
fpt_chk_null = True
5766+
fpt_chk_fail = False
57625767

57635768
# Check SPS3 $FPT Checksum validity (from Lordkag's UEFIStrip)
57645769
if variant == 'SPS' and major == 3 :
@@ -6013,7 +6018,7 @@ def mass_scan(f_path) :
60136018
elif rgn_exist : # SPS 1-3 have their own firmware Types
60146019
if variant == 'SPS' : fw_type = 'Region' # SPS is built manually so EXTR
60156020
elif variant == 'ME' and (2 <= major <= 7) :
6016-
# Check 1, FOVD section
6021+
# Check 1, FOVD partition
60176022
if (major > 2 and not fovd_clean('new')) or (major == 2 and not fovd_clean('old')) : fw_type = 'Region, Extracted'
60186023
else :
60196024
# Check 2, EFFS/NVKR strings
@@ -6023,12 +6028,16 @@ def mass_scan(f_path) :
60236028
else : fw_type = 'Region, Extracted'
60246029
elif major in [2,3] : fw_type_fix = True # ME2-Only Fix 1, ME3-Only Fix 1
60256030
else : fw_type = 'Region, Stock'
6026-
elif (variant in ['ME','CSME'] and 8 <= major <= 12) or variant == 'TXE' or (variant == 'CSSPS' and major == 4) :
6031+
elif (variant == 'ME' and major >= 8) or variant in ['CSME','CSTXE','CSSPS','TXE'] :
60276032
# Check 1, FITC Version
6028-
if fpt_hdr.FitBuild == 0 or fpt_hdr.FitBuild == 65535 : # 0000/FFFF --> clean ME/TXE
6033+
if fpt_hdr.FitBuild in [0,65535] : # 0000/FFFF --> clean CS(ME)/CS(TXE)
60296034
fw_type = 'Region, Stock'
6030-
# Check 2, FOVD section
6035+
6036+
# Check 2, FOVD partition
60316037
if not fovd_clean('new') : fw_type = 'Region, Extracted'
6038+
6039+
# Check 3, CSTXE FIT temporarily/placeholder $FPT Header and Checksum
6040+
if reading[fpt_start:fpt_start + 0x10] + reading[fpt_start + 0x1C:fpt_start + 0x30] == b'\xFF' * 0x24 : fw_type = 'Region, Extracted'
60326041
else :
60336042
# Get FIT/FITC version used to build the image
60346043
fitc_ver_found = True
@@ -6037,11 +6046,9 @@ def mass_scan(f_path) :
60376046
fitc_minor = fpt_hdr.FitMinor
60386047
fitc_hotfix = fpt_hdr.FitHotfix
60396048
fitc_build = fpt_hdr.FitBuild
6040-
elif variant == 'CSME' or variant == 'CSTXE' or variant == 'CSSPS' :
6041-
# Extracted are created by FIT temporarily, placeholder $FPT header and checksum
6042-
if reading[fpt_start:fpt_start + 0x10] + reading[fpt_start + 0x1C:fpt_start + 0x30] + \
6043-
reading[fpt_start + 0x1B:fpt_start + 0x1C] == b'\xFF' * 0x24 + b'\x00' : fw_type = 'Region, Extracted'
6044-
else : fw_type = 'Region, Stock'
6049+
6050+
# Check 4, CSME12+ FIT FWUpdate image
6051+
if reading[fpt_start:fpt_start + 0x10] == b'\xFF' * 0x10 and fwu_pmcp_found and not fpt_chk_null : fw_type = 'Region, FWUpdate'
60456052
else :
60466053
fw_type = 'Update' # No Region detected, Update
60476054

@@ -6058,7 +6065,6 @@ def mass_scan(f_path) :
60586065
# Detect Firmware Release (Production, Pre-Production, ROM-Bypass, Other)
60596066
mn2_flags_pvbit,mn2_flags_reserved,mn2_flags_pre,mn2_flags_debug = mn2_ftpr_hdr.get_flags()
60606067
rel_signed = ['Production', 'Debug'][mn2_flags_debug]
6061-
#rel_flag = ['PRD', 'PRE'][mn2_flags_pre] # Set only at ME9-10
60626068

60636069
# Check for ROM-Bypass entry at $FPT
60646070
if rgn_exist and fpt_romb_found :
@@ -6857,6 +6863,7 @@ def mass_scan(f_path) :
68576863
name_db = "%s.%s.%s.%s_%s_%s_%s" % (major, minor, hotfix, build, sku_db, rel_db, type_db) # The re-created filename without extension
68586864
name_db_rgn = "%s.%s.%s.%s_%s_%s_RGN_%s" % (major, minor, hotfix, build, sku_db, rel_db, rsa_sig_hash) # The equivalent RGN filename
68596865
name_db_extr = "%s.%s.%s.%s_%s_%s_EXTR_%s" % (major, minor, hotfix, build, sku_db, rel_db, rsa_sig_hash) # The equivalent EXTR filename
6866+
name_db_fwu = "%s.%s.%s.%s_%s_%s_FWU_%s" % (major, minor, hotfix, build, sku_db, rel_db, rsa_sig_hash) # The equivalent FWU filename
68606867
elif variant in ['CSSPS','SPS'] and sku != 'NaN' :
68616868
name_db = "%s.%s.%s.%s_%s_%s_%s" % ("{0:02d}".format(major), "{0:02d}".format(minor), "{0:02d}".format(hotfix), "{0:03d}".format(build), sku_db, rel_db, type_db)
68626869
name_db_rgn = "%s.%s.%s.%s_%s_%s_RGN_%s" % ("{0:02d}".format(major), "{0:02d}".format(minor), "{0:02d}".format(hotfix), "{0:03d}".format(build), sku_db, rel_db, rsa_sig_hash)
@@ -6881,9 +6888,10 @@ def mass_scan(f_path) :
68816888
if len(line) < 2 or line[:3] == '***' :
68826889
continue # Skip empty lines or comments
68836890
else : # Search the re-created file name without extension at the database
6884-
if name_db_hash in line : fw_in_db_found = "Yes" # Known firmware, nothing new
6885-
if type_db == 'EXTR' and name_db_rgn in line :
6886-
rgn_over_extr_found = True # Same firmware found at database but RGN instead of imported EXTR, so nothing new
6891+
if name_db_hash in line : fw_in_db_found = 'Yes' # Known firmware, nothing new
6892+
if (type_db == 'EXTR' and (name_db_rgn in line or (variant == 'CSME' and major >= 12 and name_db_fwu in line))) or \
6893+
(type_db == 'FWU' and name_db_rgn in line) :
6894+
rgn_over_extr_found = True # Same firmware found but of preferred type (RGN > FWU > EXTR), nothing new
68876895
fw_in_db_found = 'Yes'
68886896
# Only for ME8+ or ME7 non-PRD or ME6.0 IGN
68896897
if type_db == 'UPD' and ((variant in ['ME','CSME'] and (major > 7 or (major == 7 and release != 'Production') or

0 commit comments

Comments
 (0)