Skip to content

Commit 39ac328

Browse files
authored
MCE v1.0.3 & DB r4
v1.0.3 Added ability to type input filename or filepath at Intro Improved handling of non-standard filename characters Improved handling of file errors during Mass scan Updated Microcode Repository Database to r4 r4 cpu000406C4_plat01_ver0000040C_date18-04-2016 cpu000406C4_plat01_ver0000040B_date22-03-2016 cpu00030672_plat0C_ver00000213_date13-06-2013 cpu000206A6_plat12_ver90030028_date24-09-2010 cpu000106C2_plat04_ver00000203_date24-01-2008 cpu000106C1_plat01_ver00000108_date01-11-2007 cpu00000F32_plat0D_ver00000006_date09-10-2003 cpu00000F25_plat02_ver0000000B_date27-05-2003 cpu000F0F00_nb00000000_sb00000000_rev0000_ver00000005_date21-06-2002 cpu00000F11_nb00000000_sb00000000_rev0000_ver00000015_date21-06-2002
1 parent fe56294 commit 39ac328

File tree

4 files changed

+72
-14
lines changed

4 files changed

+72
-14
lines changed

Changelog DB.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
r4
2+
3+
cpu000406C4_plat01_ver0000040C_date18-04-2016
4+
cpu000406C4_plat01_ver0000040B_date22-03-2016
5+
cpu00030672_plat0C_ver00000213_date13-06-2013
6+
cpu000206A6_plat12_ver90030028_date24-09-2010
7+
cpu000106C2_plat04_ver00000203_date24-01-2008
8+
cpu000106C1_plat01_ver00000108_date01-11-2007
9+
cpu00000F32_plat0D_ver00000006_date09-10-2003
10+
cpu00000F25_plat02_ver0000000B_date27-05-2003
11+
cpu000F0F00_nb00000000_sb00000000_rev0000_ver00000005_date21-06-2002
12+
cpu00000F11_nb00000000_sb00000000_rev0000_ver00000015_date21-06-2002
13+
114
r3
215

316
cpu000506C9_plat01_ver0000001C_date28-07-2016

Changelog MCE.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v1.0.3
2+
3+
Added ability to type input filename or filepath at Intro
4+
Improved handling of non-standard filename characters
5+
Improved handling of file errors during Mass scan
6+
Updated Microcode Repository Database to r4
7+
18
v1.0.2
29

310
Fixed issue that caused no deletion of temporary files

MCE.dat

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
*** MC Extractor Microcode Repository Database ***
2-
*** Revision r3 (05/09/2016 , 20:30) ***
2+
*** Revision r4 (11/09/2016 , 00:31) ***
33

4-
*** INTEL (1309) ***
4+
*** INTEL (1317) ***
55

66
CPUID + PLATFORM + VERSION + MMDDYYYY + SIZE + CHECKSUM
77

8+
00000F25000000020000000B0527200300000800367A0C30
9+
00000F320000000D00000006100920030000080027C250C9
10+
000106C100000001000001081101200700001400CA586D26
11+
000106C2000000040000020301242008000014001D0E372A
12+
000206A60000001290030028092420100000280061B02B84
13+
000306720000000C00000213061320130000CC00D5669609
14+
000406C4000000010000040C0418201600010C008BDA20BB
15+
000406C4000000010000040B0322201600010C00C59B7D0B
816
000506E300000036000000A20727201600017C0040CCCB9A
917
000806E9000000C00000002A06062016000174007980EED7
1018
000506C9000000010000001A0630201600003C0081ACE854
@@ -1315,10 +1323,12 @@ CPUID + PLATFORM + VERSION + MMDDYYYY + SIZE + CHECKSUM
13151323
0002065500000092000000030901201100000800C50ABFD4
13161324
00000F6500000004000000070426200600000400B1D162E2
13171325

1318-
*** AMD (154) ***
1326+
*** AMD (156) ***
13191327

13201328
CPUID + NBDEVID + SBDEVID + NBSBREV + VERSION + MMDDYYYY + SIZE + CHKBODY + CHKMC
13211329

1330+
00000F110000000000000000000000000000001506212002000003C067A0BB83439C20EB
1331+
000F0F000000000000000000000000000000000506212002000003C0CA0CEC4F25F61C56
13221332
00700F000000000000000000000000000700002A1218201200000D600000000000F61E8F
13231333
00700F010000000000000000000000000700010B0709201300000D6000000000E325D033
13241334
00700F010000000000000000000000000700010F0219201400000D6000000000EBB9EFA6

MCE.py

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'''
2-
MC Extractor v1.0.2.0
2+
MC Extractor v1.0.3.0
33
Copyright (C) 2016 Plato Mavropoulos
44
Based on UEFIStrip v7.8.2 by Lordkag
55
'''
66

7-
title = 'MC Extractor v1.0.2'
7+
title = 'MC Extractor v1.0.3'
88

99
import sys
1010
import re
@@ -447,20 +447,30 @@ def mce_hdr() :
447447

448448
def init_file(in_file,orig_file,temp) :
449449
mc_file_name = ''
450+
450451
if not os.path.isfile(in_file) :
451452
if any(p in in_file for p in param.all) : return ('continue','continue')
452-
print(col_red + "\nError" + col_end + ", file %s was not found!\n" % in_file)
453-
mce_exit(1)
453+
454+
print(col_red + "\nError" + col_end + ", file %s was not found!\n" % ascii(in_file))
455+
456+
if not param.mass_scan : mce_exit(1)
457+
else : return ('continue','continue')
454458

455459
with open(in_file, 'rb') as work_file : reading = work_file.read()
456460

457461
if not temp :
458-
if not param.mce_extr : print("\nFile: %s\n" % os.path.basename(in_file))
462+
if not param.mce_extr : print("\nFile: %s\n" % ascii(os.path.basename(in_file)))
459463
if param.print_file : mc_file_name = '__%s' % os.path.basename(in_file)
460464
else :
461465
if param.print_file : mc_file_name = '__%s' % os.path.basename(orig_file)
462466

463467
return (reading,mc_file_name)
468+
469+
# Force string to be printed as ASCII, ignore errors
470+
def ascii(string) :
471+
# Input string is bare and only for printing (no open(), no Colorama etc)
472+
ascii_str = (str((string).encode('ascii', 'ignore'))).strip("b'")
473+
return ascii_str
464474

465475
def mass_scan(f_path) :
466476
mass_files = []
@@ -490,18 +500,36 @@ def mass_scan(f_path) :
490500
if not param.skip_intro :
491501
mce_hdr()
492502

493-
print("\nWelcome to Intel, AMD & VIA Microcode Extractor\n\nPress Enter to skip or input -? to list options\n")
503+
print("\nWelcome to Intel, AMD & VIA Microcode Extractor\n")
494504

495505
arg_num = len(sys.argv)
496506

497-
if arg_num == 2 : print("\nFile: " + col_green + "%s" % os.path.basename(sys.argv[1]) + col_end)
498-
elif arg_num > 2 : print("\nFiles: " + col_yellow + "Multiple" + col_end)
499-
else : print("\nFile: " + col_magenta + "None" + col_end)
507+
if arg_num == 2 :
508+
print("Press Enter to skip or input -? to list options\n")
509+
print("\nFile: " + col_green + "%s" % ascii(os.path.basename(sys.argv[1])) + col_end)
510+
elif arg_num > 2 :
511+
print("Press Enter to skip or input -? to list options\n")
512+
print("\nFiles: " + col_yellow + "Multiple" + col_end)
513+
else :
514+
print('Input a filename or "filepath" or press Enter to list options\n')
515+
print("\nFile: " + col_magenta + "None" + col_end)
500516

501517
input_var = input('\nOption(s): ')
502518

519+
# Anything quoted ("") is taken as one (file paths etc)
520+
input_var = re.split(''' (?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', input_var.strip())
521+
503522
# Get MCE Parameters based on given Options
504-
param = MCE_Param(input_var.strip().split())
523+
param = MCE_Param(input_var)
524+
525+
# Non valid parameters are treated as files
526+
if input_var[0] != "" :
527+
for i in input_var:
528+
if i not in param.all :
529+
(sys.argv).append(i.strip('"'))
530+
531+
# Re-enumerate parameter input
532+
arg_num = len(sys.argv)
505533

506534
os.system('cls')
507535

@@ -518,7 +546,7 @@ def mass_scan(f_path) :
518546
in_path = input('\nType the full folder path : ')
519547
source = mass_scan(in_path)
520548
else :
521-
source = sys.argv[1:]
549+
source = sys.argv[1:] # Skip script/executable
522550

523551
# Check if DB exists
524552
if not os.path.isfile(db_path) :

0 commit comments

Comments
 (0)