The echo command doesn't really do anything that would fix whatever the problems is. However, the comment to add it was to help diagnose where the error is. Echo will simply print what is being stored in each of those variables. One is based off of the value of the other, so if the first one is wrong, they both will be. Let's see what the values are for each and see if we can't help.
Here's the latest attempt with those echo lines included:
kts-mac-pro: ~ kt$ cd /Users/kt/Desktop
kts-mac-pro: Desktop kt$ dd if=4870.ROM of=efi.part bs=1 skip=63488 count=49152
49152+0 records in
49152+0 records out
49152 bytes transferred in 0.315280 secs (155900 bytes/sec)
kts-mac-pro: Desktop kt$ blocknum=`printf %d "'\`dd if=pc4870.rom bs=1 skip=2 count=1 2>/dev/null\`"`
kts-mac-pro: Desktop kt$ size=$(($blocknum * 512))
kts-mac-pro: Desktop kt$ echo $blocknum
-128
kts-mac-pro: Desktop kt$ echo $size
-65536
kts-mac-pro: Desktop kt$ dd if=efi.part of=pc4870.rom bs=$size seek=1 conv=notrunc
dd: bs must be between 1 and 2147483647
kts-mac-pro: Desktop kt$ python fixrom.py pc4870.rom pc4870.rom
Before:
OpRom (size=65536, indicator_offset=0x275, indicator=0x80, checksum=0x9e)
RawData (size=65536)
After:
OpRom (size=65536, indicator_offset=0x275, indicator=0x80, checksum=0x9e)
RawData (size=65536)
kts-mac-pro: Desktop kt$ dd if=4870.ROM of=efi.part bs=1 skip=63488 count=49152
49152+0 records in
49152+0 records out
49152 bytes transferred in 0.315280 secs (155900 bytes/sec)
kts-mac-pro: Desktop kt$ blocknum=`printf %d "'\`dd if=pc4870.rom bs=1 skip=2 count=1 2>/dev/null\`"`
kts-mac-pro: Desktop kt$ size=$(($blocknum * 512))
kts-mac-pro: Desktop kt$ echo $blocknum
-128
kts-mac-pro: Desktop kt$ echo $size
-65536
kts-mac-pro: Desktop kt$ dd if=efi.part of=pc4870.rom bs=$size seek=1 conv=notrunc
dd: bs must be between 1 and 2147483647
kts-mac-pro: Desktop kt$ python fixrom.py pc4870.rom pc4870.rom
Before:
OpRom (size=65536, indicator_offset=0x275, indicator=0x80, checksum=0x9e)
RawData (size=65536)
After:
OpRom (size=65536, indicator_offset=0x275, indicator=0x80, checksum=0x9e)
RawData (size=65536)
Something interesting: to rule out the possibility of a bad dumped ROM, I attempted to re-dump it using a different utility (ATIFlash instead of GPU-Z). Except I got a SIGSEV error that denied me every single time, of which I don't know exactly what that means. Worked fine, however, as far as I can tell, using Winflash and GPU-Z. Both ROMs are 128k. However, I'm still experiencing failed attempts with the script above.