AMD and Nvidia GOP update (No requests, DIY)

@plutomaniac

My main purpose is to obtain the GOPupd.exe like the lordkag’s one. As there are new tables incoming (NVidia Volta/Turing cards), I can’t add those tables only via hex edit hack.
The best choice would be to recompile exe and as it is derived from the .py (python script), I’d like to add new strings in the .py file and compile or “freeze” like you said before
a windows executable file like the old one.

P.S.
I’ve also noticed the presence of gopupd.zip file (which seems more an executable zip) and I don’t know how it has been created.

I don’t understand your reservation. Why would you need to edit via hex when you have the source code? You first make any changes you want to the python script (source) as well as any other external batch/text files and then you only freeze the py script to an executable. The GOPupd.bat script is set to use the .exe if the .py cannot be used or found.

There is another (worse) py script freezer called Py2Exe which is what lordkag had used back then. It consists of GOPupd.exe, GOPupd.zip, msvcp100.dll, msvcr100.dll and python34.dll. You need to delete all these useless files and replace them with a single PyInstaller executable, as instructed and shown above.

I mean that until now, in order to accomodate updated gop tables, I’ve always edited .py, gop database files as well as gopupd.exe due to a simple byte change.

Now that I need to add more and more new tables (Volta/Turing and maybe AMD Vega) I need to compile the source code.

I can’t understand how to obtain a small exe and the relative zip file (gopupd.exe and gopupd.zip) like the lordkag’s ones.


That’s because you did not know how to freeze the python script. That will not be needed anymore, it was never needed in the first place but that’s another story.


PyInstaller, as instructed and shown above.


Read the added text at my previous post. These are all by-products of the other py script freezer called Py2Exe.

I’ve followed any step but I have various dll library errors about libcrypto and I can’t understand why.

Ignore these and get the executable from the dist folder.

This is what exe says:

Fatal Python error: initfsencoding: unable to load the file system codec
zipimport.ZipImportError: can’t find module 'encodings’

Current thread 0x00001e00 (most recent call first):

@Sylar76 : Ok I figured out what was wrong. I was using Python 2.7 because of warnings on other forums (about updating Fury’s bios). I installed Python 3.7 and everything’s fine. Thank you for your help!

Ok, I’ve compiled myself a two new GOP Uefi Bios Updater versions 1.9.8.d and 1.9.8.e

Changes in 1.9.8.d (for NVidia and AMD cards except VEGA)
----------------------

- NVidia GOP Tables Updated (Pascal).
- New NVidia GOP UEFI Table for Volta GPUs.
- Optimized code and less files (all DLLs are embedded in one exe file).

Changes in 1.9.8.e (for NVidia users and AMD VEGA only)
----------------------

- Same changes of 1.9.8.d.
- Added VEGA support.

AMD users with a VEGA card (RX VEGA) must use only this version

Download Here

You must also include the source code. If someone has python installed, the py script will be used. For everyone else, the executable.

@plutomaniac and @all

I’ve uploaded a folder on my google drive, including .py source as well as a preliminary support for VEGA cards !!!

Please someone test both versions please.

@plutomaniac

VEGA Uefi table, at offset showing the DRV Version is shorter (4 bytes) than previous ati gop tables. Editing the .py source makes vega gop properly displayed but has the collateral effect
of making normal amd cards not properly detected. The relative string is “t_version…” and I don’t know how write a string that can consider both lenghts (short and long). If you wish and
have time it would be nice to take a look at it. Thanks !!!

Please provide with two samples which differ.



Take them and compare with both gop uefi update version I posted above.

The 1.9.8.d version properly handles non vega cards, while the 1.9.8.e does VEGA and not the old cards.

You can better understand what I mean comparing the .py sources at AMD GOP section.

VGA_SAMPLES.zip (247 KB)

Sorry for the absence and the possible ranting in this comeback post. I took some time off for some personal issues, ended up enjoying too much the available time and the procrastination that accompanies it, wanted to return with more palpable results and thus postponed the moment with days and weeks… and months flew by without doing any real progress - or any work for that matter. Rather than expecting the greatness/impossible to show up, I should have let the small things fill in the cracks. Which is why I will quickly post some updates and answer any questions or PMs in the following weeks.

I would like to thank those that helped, expressed concerns regarding the future of the app, or simply mentioned my name. It is what makes any return not only easier, but rather necessary. It is sad that not everyone finds the same culture of sharing. I see people like Fernando, Plutomaniac, Pacman and Gupsterg (to name a few) that spend so much time in helping and providing drivers/firmwares/info/etc. for everyone and anyone, which makes me feel so humble in my limited interaction. And then I see the case of the Polaris Bios Editing thread on OCN, where the single phrase “added the BIOS signature check to the pixel clock patcher” is used to wash away any effort I made. It’s not that I need my name to shine over others, I can very well let my work speak for myself, be it modest or better. I know it is only a few bytes of change (most patches or moddings are), but those bytes are the pinnacle of a few hours/days of research, a few brilliant ideas and a few brave souls to test the patch. I’m all in favor of using an automated solution and don’t want it to be in any way altered or removed, nor do I need a royal seat at the table, nor do I desire a war between sites or a clash between members. But come on, was it that hard to add in small letters, anywhere, “thanks to xxx for finding a patch and to yyy and zzz for testing”? It is moments like these that make me leave the scene forever and enjoy my free time as I should be. Imagine the lockdown Nvidia has imposed on its latest cards, being forced on AMD users - and with Vega it might be so. If some of you had the pleasure of using a modded VBIOS on patched Windows drivers AND patched GOP/EFI drivers, it is because someone took the time to solve a problem that wasn’t even his to begin with. Imagine that beginners (in reversing) like me and JoeDirt brought the joy of using your hard payed hardware to its fully potential, WITHOUT asking or expecting anything in return. And to see this work simply copy-pasted without a hint towards the original provider, it is simply heart-breaking coming from someone who should know better the value of this work. Anyway, this is not as important as it would seem from the amount of words I have dedicated to it (I actually feel ashamed for having to even mention this), but rather a thorn that I wanted to remove for some time.

I don’t know if I ever thanked/credited enough to Sonix, CodeRush, Plutomaniac, Pacman, Donovan6000 and all others who helped build bridges of knowledge, so here is to you, you wonderful bastards human beings! And robots!

Back to fun stuff. I will edit this post in the future to give all the necessary credits and add any fix/feature I might have forgotten. Here is version 1.9.6 changelog:

- special thanks to Sylar76 for maintaining this tool and this thread alive.
- updated a few GOPs, with the help of Sylar76, TPU, […]
- updated AMD to 1.66.0.15.50, GF10x to 0x1002B, GK1xx to 0x10038, GM1xx to 0x10036, GM2xx to 0x20011, GP1xx to 0x3000C, GV1xx to 0x40006, GM1xx_MXM to 0x10035.
- added Volta support
- patched the latest AMD GOP. Used a more generic patch, like the one I used for the drivers.
- use “yp” or “ypat” without the quotes to use the modded GOP instead of the original one. Use them when asked “Do you want to update GOP to …”
- patched AtiFlash (using it instead of GopInfoX) to avoid loading and hooking the drivers at Windows startup. For the love of all things, AMD, why would I need these drivers to be loaded always at logon for what may be just one time flashing or even checking the VBIOS? This is the gazillion time I find such a sloppy design on your firmware/software - and I’m not even the average researcher.
- must do something similar for Nvidia. Noticed that on recent versions of NVFlash they are hiding the extra juicy details on their signature blocks. And they also relaxed the checks on image integrity, thus the older NVFlash version.
- added an automated solution for the microcode case. But can’t remember if it is for all cases or even finished. Yes, that’s the state of my work!
- fixed some Nvidia bugs. This was mostly on my part, but Nvidia isn’t making things easier. More details in the next days.
- added a more robust parser of ROM and EFI, work in progress. Should have started from the beginning of GopUpd, but I honestly thought it will be just “flip a byte, fix the checksum” thing. Had I known what it will come to, I probably would have given up.
- -ISBN, -DEBUG, -ROMSCAN and -PATCHED are configs that can be set from GopUpd.bat, more on them latter.
- added a validation of GOP, using the PE checksum. Don’t know if it is the flasher, the backup software (GPU-Z?) or simply AMD, but check the amount of badly formatted images from AMD side. It is simply ridiculous to have so many and makes me question the integrity of the main VBIOS as well.
- modified the version extraction code for AMD GOP. God forbid for AMD to use a clear structure! On anything!
- modified the ID extraction code. This one is on me, don’t know how I missed the masked IDs or the range of IDs, as it was there all along, next to the others. Talk about … vision. Or should I say “AMD robustness”?
- added version report for .efi and .ffs files.
- added VEGA support, but it is useless without a proper signature. I suspect there could be a way to bypass the protection, knowing this is AMD, but it requires a lot of time and work from my part; and frankly, seeing how my last attempt was treated, I’m not remotely inclined in investing any slice of time.
- can’t use 2.x.x.x.x on all cards, as it is not designed for cards older than Vega. Firstly, it checks for the ID to be in range 6860-687F, 69A0-69BF, 66A0-66BF, 15D0-15EF, 7310-732F. Secondly, it seems to have removed the signature check (oh joy!), probably as it is done in hardware, but the ID check makes it still the need for a patch (oh noes!) and Secure Boot off. Thirdly, having so much code removed and being Vega only, it makes no sense in offering a patched 2.x.x.x.x GOP.
- probably introduced some bugs.

@lordkag

Hi mate,

I’m very happy to hear your voice (text) again. I’d like to thank you for the great effort you have given to us with your amazing tool and I apologize for not having thanked you enough in the past.

It is great to see your shiny metal, uhh, face again, welcome back lordkag! :slight_smile:

I’m getting ERROR: Invalid firmware image detected. when trying to flash the updated GM2xx - 0x20011 - Jan 16 2017 - 21577143 - 80A19AD5 on my GTX 960 card.

Didn’t try these, but 0x2000E works.
GM2xx - 0x2000F - Jan 19 2016 - 20357017 - ACDBE171
GM2xx - 0x20010 - Feb 26 2016 - 20482337 - 3230CD4E

Edit:
Full error

BCRT Error: Certificate 2.0 verification failed
BIOS Cert 2.0 Verification Error, Update aborted.
Nothing changed!
ERROR: Invalid firmware image detected.

Oh and this:
Update Aborted - Invalid firmware image detected. Provide an Enthusiast Key to flash this firmware image.

I almost chocked on water when I saw that avatar, welcome back man! Well since I did spent 1 hour trying to understand and fix this issue, I will post my own solution and if you find it interesting you can use it. Otherwise feel free to discard it.

Capture.PNG



1
2
3
4
5
6
 
t_version = t_efi_dump[ver_end_match + 2: ver_end_match + 0x20].split(b'\x2E\x00') # Split at 0x2E00 character

for v in range(len(t_version)) : t_version[v] = t_version[v].decode('utf-16', 'ignore') # Decode parts from UTF-16

if t_version[:1] == '0' : t_version = '.'.join(map(str, t_version[:4])) # Convert first 4 parts (x.x.x.x) to version string
else : t_version = '.'.join(map(str, t_version[:5])) # Convert first 5 parts (x.x.x.x.x) to version string
 

@lordkag :
Welcome back to the Win-RAID Forum - we missed you so much!