[HELP REQUEST] - Modding Huawei MagicBook BIOS

i would like to know if it’s possible to MOD the the bios for this notebook. I don’ need anything fancy i just need to be able to set PRE-ALLOC DVMT to 64MB (better would be 128MB but from what i saw in the var_setup variables the max dimension is 64MB).
If there is a sort of hidden advanced menu to be enable i would be happy but honestly i just need the prealloc DVMT mod.
Before asking i tried by myself with no luck but i think i’ve figured out few things so in the zip there are :
The original bios
An IFR Extract var.txt
3 dump made using different version of H2OUVE


Could someone please help me ?


@tmbt - Yes, and here’s a more clear/legible setup IFR for you - http://s000.tinyupload.com/index.php?fil…230099077560397
You are correct, it appears 64MB is the max for DVMT Pre-Allocated & DVMT Total Gfx Mem max is 256MB (or MAX, whatever that amounts to?)
These changes can be done via IFR/Hex, or using your H20UVA vars

For the IFR/Hex, make the following change
One Of Option: 32M, Value (8 bit): 0x1 (default) {09 07 C5 11 30 00 01} << Move 30 from here (replace with 00)
One Of Option: 64M, Value (8 bit): 0x2 {09 07 C6 11 00 00 02} << Add 30 here, replacing 00

Same thing if you want to change the DVMT Total Gfx Mem from 256 to Max, move the "30"
You can also adjust Aperture Size, above these to 2GB and Gtt to 8MB, same edit, move the 30

To do it via vars, which may be only working method since default setup values edited or not may not be used due to custom profile applied I see in vars for advanced settings section
Edit VarStore: VarStoreId: 0x2 which = 72C5E28C-7783-43A1-8767-FAD73FCCAFA4 = "Custom"

For DVMT Pre-Allocated - >> 000000D0: 00 0A 00 0A 00 0A 00 04 04 04 00 1A 00 0B 00 02 << Change that to 02 for DVMT Pre-Allocated (Which is already set), did you make this change already? If not, it may be already applied by the manufacture to this profile
For DVMT Total Gfx Mem >> 000000E0: 02 00 00 01 00 01 01 02 00 00 00 01 00 00 01 02 << Change 02 to 03 for "MAX"
For Aperture Size >>>>>>> 00000040: 00 03 01 01 01 01 01 FF 01 FF 00 00 00 00 00 04 << Change 01 to 0F for 2048MB (GTT Size variable is the 03 before this, already set to max of 8MB)

@Lost_N_BIOS : Thanks for the real detailed instruction but maybe you think i’m more expert than i am in reality.
I tried to modify the DVMT Pre allocated using setup_var from a UEFI shell but i always received an error so i think i was never able to modify that value.

I’m trying to boot MacOS. It needs at least 64mb DVMT preallocated or you get a Kernel Panic. If i try to boot without a specific patch i receive a kernel panic so i’m quite sure that even if i made the change in the DVMT variable it is not working.

About the method using H20UAVA vars could you please be more specific step by step because i don’t want to brick my laptop.

Thanks again for the support

P.S. : Is there an advanced menu to be enable on my BIOS because the standard basically doesn’t allow to do anything specific.

@tmbt - Show me your error in grub (not shell) << this may be the issue, you need to use grub not shell (Similar process, but different things) If you are on a black screen with white text, then that is correct Grub, if you are not, then reflash stock BIOS and start over because you are changing something that’s incorrect possibly.
How I meant to do it was edit the actual file, then reflash, then no concerns about incorrect shell/grub or errors there etc. It would be done already at the BIOS level.

But, as I mentioned, I don’t think the settings in setup are being used anyway due to a custom profile, so IFR output doesn’t look like it’s being used. However, since this is already set to 64MB in the vars.txt, maybe not all of that is used and some of the default profile from IFR is also used, hard to know without testing.
Here, I made the changes for you in vars to “Setup” only (Since Advanced-custom already set to 02/64MB, maybe you did correctly via Shell but doesn’t sound like it) - this change only for now, then reboot and test and see if you can boot MAC

I modified the vars.txt without a number from your folder, so be sure you use that same exact version you created it with to flash it back in.

DVMT Pre-Allocated, VarStoreInfo (VarOffset/VarName): 0xDF << Editing at this location (hex location)

[06F] “Setup”
GUID: A04A27F4-DF00-4D42-B552-39511302113D
Attributes: 0x7
DataSize: 0x708
00000000: 00 00 00 00 00 00 00 00 00 00 00 03 04 00 00 00
00000010: 01 03 02 03 00 00 00 00 00 00 00 00 00 00 00 00
00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000040: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
00000050: 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00
00000060: 03 00 00 00 00 00 00 01 00 00 00 00 00 01 01 00
00000070: 00 00 00 00 00 00 01 00 00 02 00 01 00 02 00 00
00000080: 04 00 00 00 00 01 01 00 00 00 00 00 01 01 02 03
00000090: 05 EE 00 00 00 00 00 00 00 00 00 00 00 01 00 01
000000A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 02 << Changed 00 to 02

Program back in
H2OUVE.exe -sv varsM.txt

Dump again to compare with modified to make sure it went in (This file, should match one above exactly - compare in hex or upload for me to check before you reboot)
H2OUVE.exe -gv varsmodcheck.txt

If that fails, I will make you new vars with custom edited again too (in case you reflashed stock as I suggested, and your previous edit did work to enable 64MB as I seen in your original vars output)

I could try enabling all the BIOS for you, but it’s not my best strength editing this type of BIOS (Insyde), so I would prefer not doing that unless you have a flash programmer like CH341A and SOIC8 test clip cable in hand for recovery.

@Lost_N_BIOS :
First of all thanks again for the help. I really appreciate it.
I’m attaching the new dumped file. Let me know what you think of it.

I’ve at first used H2OUVE -sv to flash the modded file varsM.txt. During the flash operation i saw that 90% of the lines said successfull but on some it says error updating the value (or something like that). Then without reboot i execute the -gv command to obtain a new varcheck.txt that i attach to this post :

About your question when i tried to use the setup_var command i received this error : can’t set variable using efi(err = 0x00000008)
but i never understood why (i tried different versions setup_var, setup_var2 and setup_var_3 always with the same result)


Update :
I tried to boot the MacOS without the framebuffer patch and got kernel panic so i guess that the 64MB mod is not working as it should.

@tmbt - thanks for the info on setup_var, seems you were doing all that correct, sounds normal for some systems sadly.

Since you received errors on H20UVE, are you sure you were using same version you dumped with to write back what I sent you? So before you reboot, program back in your original vars, if you get errors then may be due to using a different version than you used to create that file. I’d also need to see the exact error message if this continue
If you are not sure and can recover after reboot, do it all over again. Flash stock BIOS, then dump vars w/ each version, then pick only one that creates the 111kb var, delete all others and only use that version/var files from then on, that way you’re always using same version software and it’s dumps.
No, those files do not match at all, large chunks of settings missing. However, the edited setting is there (the change to 64MB), so unsure why it’s still failing for you, unless the custom one is not set to 02 now as well. Both are set to 02/64MB in the vars you sent back.

Maybe MAC is not checking actual applied BIOS settings, but what’s in the setup options, which were not changing here? If we find this to be true I’ll have to send you a mod BIOS with the setting changed there.

It looks like may be best version, but check on your end, if it is one that originally gave you the 111kb vars

To make this simpler and less chance of write back errors, lets do this way instead of complete dump, this will dump only the setup and custom setup variables sections. Do this with whichever one of the versions gives you 111kb complete dump, then pick highest version of those two and use that only from here onwards
H2OUVE -gv var-setup.txt -g A04A27F4-DF00-4D42-B552-39511302113D -n Setup
H2OUVE -gv var-custom.txt -g 72C5E28C-7783-43A1-8767-FAD73FCCAFA4 -n Custom

Please also run these three commands and include their output files too
H2OUVE -gs setupall.txt -all
H2OUVE -gd settings.txt
H2OUVE -d40 -g setnamesval.txt << If this one fails, try this instead >> H2OUVE -g setnamesval.txt

You can check those new dumps above, if both contain 02 at end of line 000000D0, then 02/64MB is applied in both profiles in variables and this is not what MAC is checking. You can confirm this is amount set/used in windows somehow I assume, if you already have a windows setup.
But I think no need to confirm, it’s either in use or not and MAC is saying not so we need to make the other edit instead I think (Actual BIOS setup edit, I can do for you, but unsure if you can write mod BIOS or not)

Good morning,
i’m sure i was using the same H2OUVE version because in the modded file you sent me in of the first line there was the version who generated the file and it was indeed the

To be sure and start fresh i forced the bios update (i was getting an error about the same bios version). After that i run the commands you gave me and here are the generated files :
Keep in mind that the last 3 commands you gave me all ended with an Exception Error Window but 2 files seems to have been generated anyway while setnamesval.txt is always 0byte.

From what i can see now the variable is set back to 01/32MB so the bios upgrade should have reverted any modification i could have made.

Finally there is no way to check Preallocated DVMT in Windows because the result doesn’t match the reality (i.e. Windows says I’ve 128MB which is clearly impossible and also it’s a written rule in every Hackintosh forum to not check DVMT in Windows).

Thanks again


@tmbt - good catch, I never noticed and wished they put that there, guess I should look better!
Bummer on the errors, I was getting error on my end using -gd on the BIOS file, similar to -gs on actual BIOS, and it would only give partial settings (of course, not far enough down to see DVMT)

Strange about windows, I assumed you could see this in system properties or with GPU-z (memory amount).
Probably advice on MAC to not check this is to lessen possible confusion, but if you have a windows system setup I’d like to check a few things so we can see what’s actually shown in a few places before and after these var changes, if any differences or not.
What do you see on dxdiag (Win Key + R, enter dxdiag) and to go display tab? What does GPU-z show you for memory size? - https://www.techpowerup.com/gpuz/

Was these files all created post stock BIOS flash? If yes, in archive I see the following in setupall.txt (Similar to vars original output you gave, but with all settings named and delineated into a viewable file).
This now matches “custom” vars variable too (91/32) from end of line 000000D0, which you set already to 02 previously and it didn’t help MAC install.
(0xDF, 1, 0x393FFB5311C9FFEF) DVMT Pre-Allocated
Callback ID = 0x1db
(0)[ ] 0M
(1)[*] 32M (Default)
(2)[ ] 64M
(240)[ ] 4M
(241)[ ] 8M
(242)[ ] 12M
(243)[ ] 16M
(244)[ ] 20M
(245)[ ] 24M
(246)[ ] 28M
(247)[ ] 32M/F7
(248)[ ] 36M
(249)[ ] 40M
(250)[ ] 44M
(251)[ ] 48M
(252)[ ] 52M
(253)[ ] 56M
(254)[ ] 60M

So, lets set that once again using vars, and then you redump vars and setupall and check this setting again to be sure it then says 02/64MB, if so and MAC still wont install then we need to make the actual BIOS edit instead because it seems like that must be what MAC is checking
Otherwise some other issue, did you unlock MSR 0xE2 already, I know this is unrelated but it’s one thing I know needs to be done also

Here’s lets try again

H2OUVE.exe -sv customm.txt

Then dump again and check, if matched to the changes, then reboot and check again using below mentioned output
H2OUVE -gv customm2.txt -g 72C5E28C-7783-43A1-8767-FAD73FCCAFA4 -n Custom

Once done, reboot and then run this and check it for DVMT variable like you see above, it should be moved to 64MB
H2OUVE -gs setupallmod.txt -all

If it is all correct, and now shows 02/64 for this, then we need to do actual BIOS edit instead. Here is that file in case you already know how to flash modified BIOS for this system.
Note, this may/will need the above edits done again if you want to additionally change the NVRAM vars to 02/64, this one only has setup edited (What you pulled the IFR from originally)

*Edit - This is Intel based system, correct? Can you check BIOS Main page, and see if it shows ME FW version? If not, please check from within windows, using HWINFO64, on the large window on left side, expand motherboard section and find ME Firmware version.
https://www.hwinfo.com/download/ Also, while you’re in this app, check Video info and see what it shows for allocated/available memory etc, (on left, in video adapter expanded)
This is mainly so if you do have Intel and ME, we can create a BIOS region backup using FPT and then that I will/should be able to use to modify all default settings via GUI Tool (EZH20) and possibly unlock the BIOS via mod (I don’t want to do that on stock, too many differences vs actual BIOS from board sometimes)

Also, can you please run H20FFT with command below and give me the file created, if you don’t have download this it has too many versions so surely you’ll find one that works (Sorry )
H20FFT.exe backup.bin -g

Hi @Lost_N_BIOS ,
i don’t have a working Windows 10 machine because i’ve already MacOS up and running but i will make one tonight so i can accomplish what you’re asking. For flashing the BIOS i’m using a Windows LiveCd but there i cannot installa drivers so no Intel UHD620 driver and ME driver.

For the moment i’ve done this :
flashed the customm.txt : Variable index 001 SET SUCCESFULLY
Dumped again without reboot customm2.txt and it’s identical.
Dumped again Custom and it is identical again
Dumped setupallmod.txt and checked DVMT variable BUT IT IS STILL 01/32MB (does this make sense to you?)

Later this evening i will try to create a working windows 10 machine and update this post.

Do you want me to do something for the moment ?

P.S. I was able to use H20FFT command and create a backup.bin :

backup.zip (4.5 MB)

No need for windows stuff, especially if you’ve already got MAC up and running. I thought you couldn’t install it without getting this sorted first?

On the setupall, that’s probably because we only edited the custom var instead of both (Setup too). Here is edited setup vars only, flash this in, check then reboot, then get setupall again

H2OUVE.exe -sv setupM.txt

Then dump again and check, if matched to the changes, then reboot and check again using below mentioned output (Edit is at second to last byte in D0 line
H2OUVE -gv setupm2.txt -g A04A27F4-DF00-4D42-B552-39511302113D -n Setup

Once done, reboot and then run this and check it for DVMT variable, it should be moved to 64MB now I think (Hopefully!)
H2OUVE -gs setupallmod.txt -all

Sorry, short for time right now, will check the backup tonight and make a mod for you too. I see with H2OFFT we can put BIOS in manufacturing mode too, unsure what all that would enabled, but maybe worth checking out (If you have a programmer or known recovery method, sorry I forget if you do)

Thanks again @Lost_N_BIOS ,
i can install Mac OS using a patch at boot who fake the 64MB DVMT need. But this come at the price (in term of max resolution available, HiDPI etc) so i would be more than happy to have real 64MB DVMT.
I will flash the other file you sent me and let you know.

I don’t have a programmer or know any recovery method in case the flash of the real bios goes wrong.

I’ve flashed the other txt file and done the same steps as before. Dump after flash to check 02 on D0 row OK.
Then reboot and checked again : Ok

But if i inspect setupallmod i can still see :
(0xDF, 1, 0x393FFB5311C9FFEF) DVMT Pre-Allocated
Callback ID = 0x1db
(0)[ ] 0M
(1)[*] 32M (Default)
(2)[ ] 64M

What do you think is wrong ?

@tmbt - At least there is that patch, I didn’t know and thought all this time you’re waiting and trying to get it installed. I can see though, limiting resolution would be terrible way to have to run.

It’s as I suspected, this board is using actual setup setting instead of either value in NVRAM to determine that setupall setting. We’ll have to use actual modified BIOS.

Flash via H2OFFT-W.exe backupm.bin

Once done, reboot and load optimal BIOS settings, reset your SATA settings, then load windows and dump setupall again and check if it’s not changed or not. If yes, and it should be, try installing MAC now

@Lost_N_BIOS Hi iàm having a problem flashing the modedded BIOS : "It only support to flash secure BIOS on current platform. The image to be uploaded is not a secure BIOS.
In fact if i check the image size of the backup i’ve made and the one that you’ve modified is around 1MB less than the original BIOS image.

Is there a fix for this ?


@tmbt - BIOS is exact same size as you uploaded, this is actual BIOS size 8MB (chip on board is only this big).
You’re comparing the stock update BIOS package (Which is BIOS + other files in same file = 8.92MB/9137KB), with the BIOS I made for you from the backup (8MB/8192KB) you sent at post #9 that is the actual size of the BIOS on board. This can be it’s only size, chip can only hold 8192KB

I assumed you would get error trying to update using any usual way, this is why I said update using H2OFFT, use the same version one you created the 8MB backup with.
And for that, due to making changes, you still may get security error, but not sure since it gave you ful 8MB backup with most programs wont.

If we find this security error with H2OFFT too, then I will help you flash via FPT, but you will have to do that from DOS. If this seems like only way, please check BIOS main page and get ME FW version, or in windows see if you can get ME FW Version from HWINFO64 (Maybe not due to drivers not installing like you mentioned)
Can you find it with MAC somehow, something for MAC like AIDA64 or HWINFO64? Once you find ME FW version, download matching package from section “C” of this thread Intel Management Engine: Drivers, Firmware & System Tools
Inside find Flash Programming Tool folder, and inside that DOS folder. Make a DOS Bootable USB and copy all contents from inside the DOS folder to root of USB, then from DOS run this command and send me the created file >> FPT.exe -bios -d biosreg.bin

I’m using H2OFFT but if i flash using your command line i got an error because the bios version is the same (1.20). There is not a command line for H2OFFT option (as far as i know) so i’m using an ini file to force the update without the check for the bios version but then i receive this other error. I haven’t found anything about secure bios in the ini i’m using so i’m not sure if i can disable this check.

About FW version i’ll try but i think i will need a working Windows 10 installation because without drivers HWINFO64 doesn’t show what you want to know. If it’s the only way i will find a way to install windows 10.


I gave you command line to make backup before, isn’t that how you did it? Yes, there is command line version, maybe not compatible with your system but that is where I got the commands from (the PDF for H2OFFT, inside this folder H20FFT\H20FFT-W >> H20FFT_UserGuide_Windows_V5.31.PDF, CMD stuff starts on page 37)
The guide makes it look like any of the versions, even windows versions, can also run from command line too.

As for same version error, edit this line, or add/create it (This is on page 21 of the PDF), this goes underneath [Others] and this should be the default already >> AllowVersion=000

@Lost_N_BIOS Hi,
I’ve managed to install a spare M.2 drive replacing the main disk and installed Windows 10. My ME FW version according to MEInfoWin64.exe is .
Can I procede with the bios update using the command you gave me before ?

P.S. Out of curiosity I also check dxdiag and other tools. All of them indicate DVMT 128MB even if we know it’s impossible. That’s why I think you can’t check DVMT allocated in Windows. It is not realiable.

P.P.S. Inside Flash Programming Tool folder there is also a Win64 folder (together with a DOS,Win32 and EFI64). Why I can’t flash the bios using the Win64 tool ?

EDIT : I wasn’t able to create a UEFI bootable Dos usb key and there isn’t an option to disable uefi boot in my bios so I tried the ftpw64.exe command from Windows 10. It worked.

Intel (R) Flash Programming Tool. Version:
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.

Reading HSFSTS register… Flash Descriptor: Valid

— Flash Devices Found —
W25Q64FW ID:0xEF6017 Size: 8192KB (65536Kb)

- Reading Flash [0x0800000] 6144KB of 6144KB - 100 percent complete.
Writing flash contents to file “biosreg.bin”…

Memory Dump Complete
FPT Operation Successful.

Is this ok ?
here is the file :

Wow, BIOS is intricate and risky to flash, even a stock BIOS, why do people rush and the ask to change directions from what they are given? I’ll never understand
Yes, you could use Win64 from FPT, but I’ve ever advised or mentioned it.
Yes, you can try the BIOS update using the modified 8MB BIOS I sent in post #12 you only with H20FFT, you can do that from command line as mentioned, or add/edit in the allowsame variable in the platform.ini and use the GUI if it will let you

Please show me images of all that in windows, dxdiag, GPU-z and HWINFO64 video memory, I believe you but would like to see it all myself, especially HWINFo64 and GPU-z.
I know actual windows (microcosoft) tools often mess this up, due to shared memory and whatever it thinks the OS can set aside too, especially Win7-10, but other tools shouldn’t and I’ve never seen them do so but I rarely have looked when testing with onboard GFX

UEFI bootable and DOS bootable are two different things, and cannot be one in the same, unsure what your goal was there, so can’t advise on that one.

Here is mod BIOS region, flash using FPTw.exe -bios -d biosregm.bin


@Lost_N_BIOS Good morning and sorry yesterday I was in a rush and wrote a quite confusing answer.
First of all i’m attaching here the images from the tools (gpuz,dxdiag and hwinfo64 as you asked) :


About the H2OFFT I will try again today to flash using the bios you sent me on post #12. I will read more carefully the manual and try to find out which command use to bypass the secure bios error (the version error I know how to bypass).

Just in case i’m not able to do that I tried to dump the bios using FPT as per your instruction. You said to use the DOS version I understand but I think I can’t that’ s why I used the Win64 version to dump the bios (I thought that reading a bios was not so risky. I would have waited for your instruction before flashing using a tool you didn’t mention).
My problem is this :
I can create a bootable USB drive with FreeDos in it, copy the files I need (FPT.exe, the bios.bin etc). I’ve done that a million time using for example Rufus. I use a drive like that for HDAT2.exe which is a software for analyze hard drive sectors and repair them BUT to boot the drive in the bios I’ve to disable Secure Boot AND enable Legacy (CSM) boot. In my bios there is NOT this option so the usb drive I’ve created doesn’t work at boot. I can use it in any other laptop I have but not on this one because there is not Legacy boot option. On this one I can boot only if the usb drive has an EFI partition and I don’t know who to create a USB with DOS and UEFI togheter.
I hope it’s more clear now …


Thanks for the images! No worries about being in a rush or anything Sorry, I didn’t know you were getting a security error, or forgot, I thought the main issue was the “Can’t flash same version” stuff. no need to worry about any of that.

Sorry though, I forgot to mention above, to reflash BIOS via FPT you need to change BIOS lock setting, here is my guide on doing that - [GUIDE] Grub Fix Intel FPT Error 368 - BIOS Lock Asus/Other Mod BIOS Flash
You can start at step #6, because I have done what step #1-5 give you below (This already done inside this BIOS, so next time you wont need to unlock, but if not done again then following that it will be locked once more)
BIOS Lock variable to change >> 0x17

Since I don’t think you have exit to shell on your exit page, you will need to follow what I’ve outlined in this post to be able to boot to grub, be sure to look at the images and make yours look exact same
Alt boot to grub when no boot to EFI on exit page - [Help needed] Hidden Advanced menu Bios HP Z1 J52_0274.BIN (2)

So once at grub prompt you will type in following >> setup_var 0x17 0x0

You can use DOS FPT, don’t use FreeDos or Rufus, use Win98 SE - here use this method >>https://www.win-raid.com/t3756f16-lt-Request-gt-Flagship-X-Gaming-Wifi-Motherboard-BIOS-Fix.html#msg53541
^^ This, has to either be separate USB from your grub setup USB, or do grub stuff, then redo stick for this

No worries about the x64 FPT, I was talking to whoever was listening, and laughing. You are correct, reading a BIOS is not risky, but still no one said to use x64 anything, that was my point is all.
On the Boot to DOS/USB etc, you should have option in your BIOS on the Boot page called “Boot Type” and there is dual, legacy or UEFI (If not, we need to unhide for you later, or now with grub)
Variable for that is >> 0x79 So, in grub (using that is UEFI, so you can boot to grub as outline above), to change this to dual >> setup_var 0x79 0x0
Then you will be able to boot to normal DOS USB. But, if you don’t want to do that, you can also use EFI FPT instead of DOS one, if there is EFI version in your ME System Tools FPT folder (I didn’t check, but assume it’s there)