Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacintoshKeyboardHacking

macrumors newbie
Original poster
Aug 21, 2024
11
2
Hey guys, in regards to questions of "how to validate" your existing Fsys data store, I put together the following script to validate the CRCs of the main stores. I based this on the output of UEFIExtract_NE_A63. I later figured out there is a bug in this version of UEFIExtract, because it displays the wrong CRCs in it's output. Maybe this problem is fixed on a newer version, but I'm stuck on Catalina so I can't go much higher.

Code:
UEFIExtract mydump.bin report;

# BAD OUTPUT due to UEFIExtract_NE_A63 bug.
cat mydump.bin.report.txt|grep store|cut -d\| -f3-6|sed -e "s/ //g" -e "s/\|/ /g" -e "s/--//"|awk {'print "(echo; echo "$0"; echo -n \""$4": file "$3" real \";CRC=`dd if=mydump.bin bs=1 skip=$[0x"$1"] count=$[0x"$2"] of=tmp; crc32 tmp`; echo -n $CRC\" : \"; if [[ 0x"$3" -eq 0x$CRC ]]; then echo good; else echo bad;fi;sleep 2) 2>/dev/null"'}|bash

The output of the GUI UEFITool_NE_A63 is correct however, and it is advised to check everything between 0x140000-0x14ffff to verify correct CRCs

A clean, upgraded, or rebuilt firmware can then be created with the following commands
Code:
cp MP51.bin myrebuild.bin;
dd if=mydump.bin of=myrebuild.bin conv=notrunc bs=1 seek=$[0x140000] skip=$[0x140000] count=$[0x10000] # copy FTW and Fsys stores
dd if=mydump.bin of=myrebuild.bin conv=notrunc bs=1 seek=$[0x3FFF00] skip=$[0x3FFF00] count=$[0x80] # copy LBSN

hope this helps
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.