Hello, I came here to ask for some help after several tries to make dGPU passthrough on my laptop work. I tries several times with different configurations without success.
Problem:
I'm always getting code 43, while I got a (seemingly) successful VFIO setup.
I'm following this guide:
http://gist.github.com/Misairu-G/616f7b2756c488148b7309addc940b28 I successfully configured RDP, and can connect to the guest using xfreerdp. However, code 43 keeps happening.
I tried the following methods:
- Booted without romfile=xxx.rom.
- Booted without romfile=xxx.rom and with rombar=0.
- Extracted my MX150's vBIOS using my laptop's BIOS update file. Actually it's encrypted, so I had to use a Python 2 script from an obscure origin to decrypt those files, then use http://github.com/coderobe/VBiosFinder to extract my actual vBIOS. Then booted with romfile=my_vbios.rom and rombar unspecified.
- Actually integrated the vBIOS into OVMF firmware. I was following this guide http://github.com/jscinoz/optimus-vfio-docs/issues/2. I had to manually executing the commands specified in the PKGBUILD, and it successfully compiled. Then I replaced the vanilla OVMF UEFI BIOS with the newly compiled one.
- Same as above, but with ACPI paths changed in the file ssdt.asl, to match my MX150's actual ACPI path. The path in my host is _SB.PCI0.RP05.PEGP. Then recompiled OVMF and switch the guest's BIOS.
- Tried patching the vBIOS. http://github.com/Matoking/NVIDIA-vBIOS-VFIO-Patcher. Then did the above step with vBIOS rom file changed.
I was installing vendor-provided drivers since NVIDIA's drivers refused to install on my machine. That's because I'm using real PCI hardware IDs.
Why didn't I extract the vBIOS from a living system, such as Windows? Well, I can't, literally.
- Tried nvflash (vanilla), nvflash (with board id mismatch disabled). Can't read my MX150's EEPROM.
- Tried the registry method (reading vBIOS dumps from the registry). No such value as vbios. Not even one in the registry. Trust me, I even did a complete search on it (though not as an administrator, I suppose the vBIOS won't hide in that veil).
- Tried /sys/whateveobscure_pci_ids/rom. Operation not permitted. Period. (Or carriage return, whatever.)
- Tried GPU-Z. It's just a wrapper, so just wrapped dissapointment then.
- Tried extracting directly from Dell BIOS update file. I cannot even find the BIOS update files. Not even one file. Not even in %tmp%. Just a driver living in %tmp%/some relevant folder laughing at me for trying as a whatever year old-kid to dig in Dell's toybox to find some BIOS-shaped toys. And the filename says it an interface to Dell's BIOS. Thanks for the decryption script then, sincerely (how can I not?).
- Didn't try dumping BIOS. I have to disable secure boot, PTT then enable CSM. Not worth it I suppose. The extraction of update itself is humilating enough.
- Didn't try programmer. I cannot even find anything like SPI chip, and why bother? It's ridiculous amount of effort with probablistic success.
I'm going to share the golden key Python 2 script to decrypt the hard-to-decrypt-if-not-practically-impossible-to-do-so-and-imo-rather-humilating Dell BIOS update EXE file. It's in the rather bottom of this post, if I can find it. Hope it's useful for future
travelers adventurers time wasters users. I'm going to
throw Dell into a hot hot place sincerely thank Dell for their
notorious thoughtful protection for their BIOS update images.
Important information below.
System configuration:
Dell Inspiron 7580, MX150, Ubuntu, 4.15.0-1045-oem kernel
QEMU emulator version 3.1.0 (Debian 1:3.1+dfsg-2ubuntu3.2) (from official software source)
VFIO Version (from official software source too):
filename: /lib/modules/4.15.0-1045-oem/kernel/drivers/vfio/vfio.ko softdep: post: vfio_iommu_type1 vfio_iommu_spapr_tce alias: devname:vfio/vfio alias: char-major-10-196 description: VFIO - User Level meta-driver author: Alex Williamson license: GPL v2 version: 0.3 srcversion: EA6FC0201F8361D3E20DFF0 depends: retpoline: Y intree: Y name: vfio vermagic: 4.15.0-1045-oem SMP mod_unload
/proc/cmdline (forgive me for repeated cmdline items/options):
BOOT_IMAGE=/vmlinuz-4.15.0-1045-oem root=UUID=[redacted] ro i915.enable_gvt=1 intel_iommu=on,igfx_off kvm.ignore_msrs=1 quiet splash i915.enable_gvt=1 intel_iommu=on,igfx_off kvm.ignore_msrs=1 vt.handoff=1
QEMU Configuration:
Actually I'm using a QEMU launch script.
#!/bin/bash # Set audio output options # TODO: set up audio export QEMU_AUDIO_DRV=none export QEMU_PA_SERVER="" export QEMU_AUDIO_TIMER_PERIOD=500 FILES=/[redacted]/dgpu-passthrough # Use command below to generate a MAC address # printf '52:54:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) # Refer http://github.com/saveriomiroddi/qemu-pinning for how to set your cpu affinity properly qemu-system-x86_64 \ -name "Windows10-QEMU" \ -machine type=q35,accel=kvm \ -global ICH9-LPC.disable_s3=1 \ -global ICH9-LPC.disable_s4=1 \ -enable-kvm \ -cpu host,kvm=off,hv_vapic,hv_relaxed,hv_spinlocks=0x1fff,hv_time,hv_vendor_id=12alphanum \ -smp 2,sockets=1,cores=1,threads=2 \ -m 4G \ -mem-prealloc \ -rtc clock=host,base=localtime \ -device ich9-intel-hda -device hda-output \ -vga none \ -nographic \ -serial none \ -parallel none \ -k en-us \ -spice port=5901,addr=127.0.0.1,disable-ticketing \ -usb \ -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \ -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,x-pci-sub-device-id=0x08a6,x-pci-sub-vendor-id=0x1028,multifunction=on,rombar=0 \ -drive if=pflash,format=raw,readonly=on,file=/[redacted]/ovmf-patched-vbios/edk2/Build/OvmfX64/RELEASE_GCC5/FV/OVMF_CODE.fd \ -drive if=pflash,format=raw,file=$FILES/OVMF_VARS.fd \ -boot menu=on \ -boot order=c \ -drive id=disk0,if=virtio,cache=none,format=raw,file=$FILES/windows.img \ -drive file=$FILES/windows10.iso,index=1,media=cdrom \ -drive file=$FILES/virtio-win-0.1.141.iso,index=2,media=cdrom \ -netdev type=tap,id=net0,ifname=tap0,script=tap_ifup,downscript=tap_ifdown,vhost=on \ -device virtio-net-pci,netdev=net0,addr=19.0,mac=52:54:BE:EF:5E:A7 \ -device pci-bridge,addr=12.0,chassis_nr=2,id=head.2 \ -device usb-tablet # The -device usb-tablet will not be accurate regarding the pointer in some cases, another option is to use # -device virtio-keyboard-pci,bus=head.2,addr=03.0,display=video.2 \ # -device virtio-mouse-pci,bus=head.2,addr=04.0,display=video.2 \
vBIOS stats:
Valid ROM signature found @0h, PCIR offset 170h PCIR: type 0 (x86 PC-AT), vendor: 10de, device: 1d10, class: 030200 PCIR: revision 3, vendor revision: 1 Last image
PCI layout:
-[0000:00]-+-00.0 Intel Corporation Device [8086:3e34] +-02.0 Intel Corporation UHD Graphics 620 (Whiskey Lake) [8086:3ea0] +-04.0 Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] +-08.0 Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model [8086:1911] +-12.0 Intel Corporation Device [8086:9df9] +-14.0 Intel Corporation Device [8086:9ded] +-14.2 Intel Corporation Device [8086:9def] +-15.0 Intel Corporation Device [8086:9de8] +-16.0 Intel Corporation Device [8086:9de0] +-17.0 Intel Corporation Device [8086:9dd3] +-1c.0-[01]----00.0 NVIDIA Corporation GP108M [GeForce MX150] [10de:1d10] +-1d.0-[02]----00.0 Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] +-1d.1-[03]----00.0 Intel Corporation Wireless-AC 9260 [8086:2526] +-1d.4-[04]----00.0 Intel Corporation SSD Pro 7600p/760p/E 6100p Series [8086:f1a6] +-1f.0 Intel Corporation Device [8086:9d84] +-1f.3 Intel Corporation Device [8086:9dc8] +-1f.4 Intel Corporation Device [8086:9da3] \-1f.5 Intel Corporation Device [8086:9da4]
PCI device details:
00:00.0 Host bridge [0600]: Intel Corporation Device [8086:3e34] (rev 0b) Subsystem: Dell Device [1028:08a6] 00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 620 (Whiskey Lake) [8086:3ea0] Subsystem: Dell UHD Graphics 620 (Whiskey Lake) [1028:08a6] Kernel driver in use: i915 Kernel modules: i915 00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 0b) Subsystem: Dell Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [1028:08a6] Kernel driver in use: proc_thermal Kernel modules: processor_thermal_device 00:08.0 System peripheral [0880]: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model [8086:1911] Subsystem: Dell Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model [1028:08a6] 00:12.0 Signal processing controller [1180]: Intel Corporation Device [8086:9df9] (rev 30) Subsystem: Dell Device [1028:08a6] Kernel driver in use: intel_pch_thermal Kernel modules: intel_pch_thermal 00:14.0 USB controller [0c03]: Intel Corporation Device [8086:9ded] (rev 30) Subsystem: Dell Device [1028:08a6] Kernel driver in use: xhci_hcd 00:14.2 RAM memory [0500]: Intel Corporation Device [8086:9def] (rev 30) Subsystem: Dell Device [1028:08a6] 00:15.0 Serial bus controller [0c80]: Intel Corporation Device [8086:9de8] (rev 30) Subsystem: Dell Device [1028:08a6] Kernel driver in use: intel-lpss Kernel modules: intel_lpss_pci 00:16.0 Communication controller [0780]: Intel Corporation Device [8086:9de0] (rev 30) Subsystem: Dell Device [1028:08a6] Kernel driver in use: mei_me Kernel modules: mei_me 00:17.0 SATA controller [0106]: Intel Corporation Device [8086:9dd3] (rev 30) Subsystem: Dell Device [1028:08a6] Kernel driver in use: ahci Kernel modules: ahci 00:1c.0 PCI bridge [0604]: Intel Corporation Device [8086:9dbc] (rev f0) Kernel driver in use: pcieport 00:1d.0 PCI bridge [0604]: Intel Corporation Device [8086:9db0] (rev f0) Kernel driver in use: pcieport 00:1d.1 PCI bridge [0604]: Intel Corporation Device [8086:9db1] (rev f0) Kernel driver in use: pcieport 00:1d.4 PCI bridge [0604]: Intel Corporation Device [8086:9db4] (rev f0) Kernel driver in use: pcieport 00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:9d84] (rev 30) Subsystem: Dell Device [1028:08a6] 00:1f.3 Audio device [0403]: Intel Corporation Device [8086:9dc8] (rev 30) Subsystem: Dell Device [1028:08a6] Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel, snd_soc_skl 00:1f.4 SMBus [0c05]: Intel Corporation Device [8086:9da3] (rev 30) Subsystem: Dell Device [1028:08a6] Kernel driver in use: i801_smbus Kernel modules: i2c_i801 00:1f.5 Serial bus controller [0c80]: Intel Corporation Device [8086:9da4] (rev 30) Subsystem: Dell Device [1028:08a6] 01:00.0 3D controller [0302]: NVIDIA Corporation GP108M [GeForce MX150] [10de:1d10] (rev a1) Kernel driver in use: vfio-pci Kernel modules: nvidiafb, nouveau 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15) Subsystem: Dell RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1028:08a6] Kernel driver in use: r8169 Kernel modules: r8169 03:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29) Subsystem: Intel Corporation Wireless-AC 9260 [8086:4010] Kernel driver in use: iwlwifi Kernel modules: iwlwifi 04:00.0 Non-Volatile memory controller [0108]: Intel Corporation SSD Pro 7600p/760p/E 6100p Series [8086:f1a6] (rev 03) Subsystem: Intel Corporation SSD Pro 7600p/760p/E 6100p Series [8086:390b] Kernel driver in use: nvme
IOMMU groups:
IOMMU Group 0: 00:00.0 Host bridge [0600]: Intel Corporation Device [8086:3e34] (rev 0b) IOMMU Group 1: 00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 0b) IOMMU Group 10: 00:1d.1 PCI bridge [0604]: Intel Corporation Device [8086:9db1] (rev f0) IOMMU Group 11: 00:1d.4 PCI bridge [0604]: Intel Corporation Device [8086:9db4] (rev f0) IOMMU Group 12: 00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:9d84] (rev 30) 00:1f.3 Audio device [0403]: Intel Corporation Device [8086:9dc8] (rev 30) 00:1f.4 SMBus [0c05]: Intel Corporation Device [8086:9da3] (rev 30) 00:1f.5 Serial bus controller [0c80]: Intel Corporation Device [8086:9da4] (rev 30) IOMMU Group 13: 01:00.0 3D controller [0302]: NVIDIA Corporation GP108M [GeForce MX150] [10de:1d10] (rev a1) IOMMU Group 14: 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15) IOMMU Group 15: 03:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29) IOMMU Group 16: 04:00.0 Non-Volatile memory controller [0108]: Intel Corporation SSD Pro 7600p/760p/E 6100p Series [8086:f1a6] (rev 03) IOMMU Group 2: 00:08.0 System peripheral [0880]: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model [8086:1911] IOMMU Group 3: 00:12.0 Signal processing controller [1180]: Intel Corporation Device [8086:9df9] (rev 30) IOMMU Group 4: 00:14.0 USB controller [0c03]: Intel Corporation Device [8086:9ded] (rev 30) 00:14.2 RAM memory [0500]: Intel Corporation Device [8086:9def] (rev 30) IOMMU Group 5: 00:15.0 Serial bus controller [0c80]: Intel Corporation Device [8086:9de8] (rev 30) IOMMU Group 6: 00:16.0 Communication controller [0780]: Intel Corporation Device [8086:9de0] (rev 30) IOMMU Group 7: 00:17.0 SATA controller [0106]: Intel Corporation Device [8086:9dd3] (rev 30) IOMMU Group 8: 00:1c.0 PCI bridge [0604]: Intel Corporation Device [8086:9dbc] (rev f0) IOMMU Group 9: 00:1d.0 PCI bridge [0604]: Intel Corporation Device [8086:9db0] (rev f0)
ll /dev/vfio:
total 0 drwxr-xr-x 2 root root 80 Jul 12 13:55 ./ drwxr-xr-x 22 root root 4500 Jul 12 10:13 ../ crw------- 1 root root 241, 0 Jul 12 13:55 13 crw-rw-rw- 1 root root 10, 196 Jul 12 10:12 vfio
/proc/acpi/bbswitch:
0000:01:00.0 ON
lsmod:
Module Size Used by xt_conntrack 16384 1 cmac 16384 1 rfcomm 77824 16 ccm 20480 0 xt_CHECKSUM 16384 1 iptable_mangle 16384 1 ipt_MASQUERADE 16384 2 nf_nat_masquerade_ipv4 16384 1 ipt_MASQUERADE iptable_nat 16384 1 nf_conntrack_ipv4 16384 4 nf_defrag_ipv4 16384 1 nf_conntrack_ipv4 nf_nat_ipv4 16384 1 iptable_nat nf_nat 32768 2 nf_nat_masquerade_ipv4,nf_nat_ipv4 xt_tcpudp 16384 9 pci_stub 16384 1 bridge 151552 0 vboxpci 24576 0 stp 16384 1 bridge llc 16384 2 bridge,stp vboxnetadp 28672 0 vboxnetflt 28672 0 vboxdrv 483328 3 vboxpci,vboxnetadp,vboxnetflt iptable_filter 16384 1 ebtable_nat 16384 0 nf_conntrack 131072 6 xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv4,nf_nat,ipt_MASQUERADE,nf_nat_ipv4 libcrc32c 16384 2 nf_conntrack,nf_nat ip_set 40960 0 nfnetlink 16384 1 ip_set ebtable_filter 16384 0 ebtables 32768 2 ebtable_nat,ebtable_filter bnep 20480 2 bbswitch 16384 0 snd_hda_codec_hdmi 49152 1 binfmt_misc 20480 1 nls_iso8859_1 16384 1 snd_soc_skl 90112 0 snd_soc_skl_ipc 65536 1 snd_soc_skl snd_hda_ext_core 24576 1 snd_soc_skl snd_soc_sst_dsp 32768 1 snd_soc_skl_ipc snd_soc_sst_ipc 16384 1 snd_soc_skl_ipc snd_soc_acpi 16384 1 snd_soc_skl snd_soc_core 241664 1 snd_soc_skl snd_hda_codec_realtek 106496 1 arc4 16384 2 snd_compress 20480 1 snd_soc_core snd_hda_codec_generic 73728 1 snd_hda_codec_realtek ac97_bus 16384 1 snd_soc_core dell_laptop 20480 0 snd_pcm_dmaengine 16384 1 snd_soc_core dell_smm_hwmon 16384 0 joydev 24576 0 snd_hda_intel 40960 3 input_leds 16384 0 snd_hda_codec 126976 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek btusb 45056 0 snd_hda_core 81920 7 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_soc_skl snd_hwdep 20480 1 snd_hda_codec btrtl 16384 1 btusb btbcm 16384 1 btusb btintel 16384 1 btusb cdc_ether 16384 0 intel_rapl 20480 0 usbnet 45056 1 cdc_ether bluetooth 548864 41 btrtl,btintel,btbcm,bnep,btusb,rfcomm r8152 61440 0 dell_wmi 16384 0 x86_pkg_temp_thermal 16384 0 ecdh_generic 24576 2 bluetooth intel_powerclamp 16384 0 dell_smbios 24576 2 dell_wmi,dell_laptop wmi_bmof 16384 0 coretemp 16384 0 dcdbas 16384 1 dell_smbios snd_pcm 98304 8 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_soc_core,snd_soc_skl,snd_hda_core,snd_pcm_dmaengine kvm_intel 212992 4 kvm 598016 1 kvm_intel snd_seq_midi 16384 0 snd_seq_midi_event 16384 1 snd_seq_midi intel_cstate 20480 0 iwlmvm 372736 0 intel_rapl_perf 16384 0 snd_rawmidi 32768 1 snd_seq_midi mac80211 782336 1 iwlmvm dell_wmi_descriptor 16384 2 dell_wmi,dell_smbios snd_seq 65536 2 snd_seq_midi,snd_seq_midi_event serio_raw 16384 0 snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi snd_timer 32768 2 snd_seq,snd_pcm snd 81920 19 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi iwlwifi 290816 1 iwlmvm cfg80211 622592 3 iwlmvm,iwlwifi,mac80211 soundcore 16384 1 snd hid_multitouch 20480 0 idma64 20480 0 virt_dma 16384 1 idma64 mei_me 40960 0 mei 90112 1 mei_me processor_thermal_device 16384 0 intel_soc_dts_iosf 16384 1 processor_thermal_device ucsi_acpi 16384 0 typec_ucsi 28672 1 ucsi_acpi intel_pch_thermal 16384 0 typec 24576 1 typec_ucsi mac_hid 16384 0 int3403_thermal 16384 0 int3402_thermal 16384 0 intel_hid 16384 0 int3400_thermal 16384 0 int340x_thermal_zone 16384 3 int3403_thermal,int3402_thermal,processor_thermal_device acpi_thermal_rel 16384 1 int3400_thermal sparse_keymap 16384 2 intel_hid,dell_wmi acpi_pad 180224 0 sch_fq_codel 20480 8 ppdev 20480 0 lp 20480 0 parport 49152 2 lp,ppdev ip_tables 28672 3 iptable_filter,iptable_nat,iptable_mangle x_tables 40960 8 ebtables,xt_conntrack,iptable_filter,xt_tcpudp,ipt_MASQUERADE,xt_CHECKSUM,ip_tables,iptable_mangle autofs4 40960 2 btrfs 1126400 0 xor 24576 1 btrfs zstd_compress 163840 1 btrfs raid6_pq 114688 1 btrfs algif_skcipher 16384 0 af_alg 24576 1 algif_skcipher dm_crypt 40960 1 vhost_net 24576 1 vhost 45056 1 vhost_net tap 24576 1 vhost_net vfio_pci 45056 1 vfio_virqfd 16384 1 vfio_pci irqbypass 16384 6 vfio_pci,kvm vfio_iommu_type1 24576 1 vfio 28672 5 vfio_iommu_type1,vfio_pci hid_generic 16384 0 ums_realtek 20480 0 uas 24576 0 usb_storage 69632 2 uas,ums_realtek usbhid 53248 0 i915 1630208 132 crct10dif_pclmul 16384 0 crc32_pclmul 16384 0 ghash_clmulni_intel 16384 0 pcbc 16384 0 i2c_algo_bit 16384 1 i915 mxm_wmi 16384 0 drm_kms_helper 167936 1 i915 syscopyarea 16384 1 drm_kms_helper sysfillrect 16384 1 drm_kms_helper aesni_intel 188416 4 sysimgblt 16384 1 drm_kms_helper ahci 40960 2 aes_x86_64 20480 1 aesni_intel fb_sys_fops 16384 1 drm_kms_helper crypto_simd 16384 1 aesni_intel r8169 81920 0 i2c_hid 20480 0 glue_helper 16384 1 aesni_intel intel_lpss_pci 20480 0 cryptd 24576 4 crypto_simd,ghash_clmulni_intel,aesni_intel psmouse 151552 0 i2c_i801 28672 0 mii 16384 3 r8169,usbnet,r8152 drm 401408 14 drm_kms_helper,i915 libahci 32768 1 ahci intel_lpss 16384 1 intel_lpss_pci hid 118784 4 i2c_hid,usbhid,hid_multitouch,hid_generic wmi 24576 5 dell_wmi,wmi_bmof,dell_smbios,dell_wmi_descriptor,mxm_wmi video 45056 3 dell_wmi,dell_laptop,i915
And, finally, the decryption script:
#This script finds the compressed data embedded in a Dell BIOS update program #and decompresses it to an apparent HDR file. The main data seems to start #at offset 0x58 in the HDR FWIW import zlib import sys import re import binascii if(len(sys.argv) < 2 or sys.argv[1] == "-h"): print "usage: python DecompNewDell.py " exit() f = open(sys.argv[1], "rb") string = f.read() #The 0x789C at the end is the zlib header. #It's necessary to check for that too because the string #appears a couple times in the file. pat = re.compile(r'.{4}\xAA\xEE\xAA\x76\x1B\xEC\xBB\x20\xF1\xE6\x51.{1}\x78\x9C') match = pat.search(string) #Once you find that string, the first 4 bytes are the little endian #size of the compressed data. The span will give you the starting #offset into the file where it is found (start_match, end_match) = match.span() #print match.span() compessed_len = string[start_match:start_match+4] #Now switch the order around since it's little endian #and also convert it to a hex string compessed_len = binascii.b2a_hex(compessed_len[::-1]) #and then make it a proper number (separate lines for clarity) compessed_len = long(compessed_len, 16) #read len bytes out of the file into the new string to decompress f.seek(start_match+16) string = f.read(compessed_len) o = zlib.decompress(string) f2 = open(sys.argv[1] + "_decompressed.hdr", "wb") f2.write(o) f.close() f2.close() print "Decompressed data written to %s_decompressed.hdr" % sys.argv[1]