Cannot flash modded NVRAM using AFUWINx64

Hi, my PC has some problems which I described in my previous post and I’m trying to solve by myself. Right now, I’m trying to modify a BIOS NVRAM variable: “SaPegData”, which I think that could be playing an important role in this issue.

However, it is write-protected and I can’t use an EFI/Windows program to change its value, I would need to reflash the whole BIOS in order to do it, but AFUWIN has an option to only flash NVRAM section, so I thinked about extracting my BIOS NVRAM section from a firmware dump and modding SaPegData value using HxD and then replacing it using UEFITool.

UEFITool NE lets you extract NVRAM section (my BIOS has two of these)

But it won’t let you replace, for that you’ll have to use UEFITool 0.28.0.

I extracted both NVRAM regions, modified both of them, and replaced both. This is the result (as you see I just zeroed the antepenultimate position)

BEFORE

AFTER

But when I try to flash my modded image:

What shall I do to solve the “18 - Error: Error: Secure Flash Rom Verify fail” error?

Specs:
-Motherboard: B360H4-EM (Medion)
-Processor: intel i7-9700K
-RAM: 8 GB of Samsung RAM (M378A1K43CB2-CRC)
-Storage: 1 TB SSD +1 TB HDD.

BIOS: 360H4W0X.zip (7.1 MB)

Have you disabled Secure Boot in BIOS? That may be preventing you from flashing.

Yeah, Secure Boot is disabled. Your answer made me think about Flash permissions. Flash descriptor region is locked, but BIOS region is unlocked

This is quite “normal” for AMI tools and Aptio V manipulation mod files, OEM and AMI security prevents it, after all AMI is the base bios code supplier to OEMs and it’s supposed to supply a secure product and OEMs want to secure their costumers against “unknow” firmware flash, a mod…
You can try Intel FPT if your saying bios_region is unlocked or as final resource a cheap Ch341A programmer.