Welcome to the dark corner of BIOS reverse engineering, code injection and various modification techniques only deemed by those immensely curious about BIOS

Friday, February 8, 2013

Reversing Applications Running on DOS Extender

Some BIOS/Firmware-related utilities are running in DOS "extender" mode, i.e. 32-bit Flat Protected mode. Reversing this kind of executable is not quite as straight forward as other DOS programs. Some of them "bind" the DOS "extender" binary with the core application executable into one "integrated" executable. A further optimization that you might find is executable compression before "bind"ing the executable to the DOS "extender". How would you deal with this kind of binary? Well, to be honest. It's not quite easy, but I found these steps help:


  1. Unbind the DOS "extender" from the "integrated" executable. For this, you can use the SUNSYS Bind Utility which is part of the DOS32A DOS extender. It's freely available at http://dos32a.narechk.net/index_en.html. Using the SUNSYS Bind utility, you can obtain the real executable. Usually in the form of LE executable. 
  2. (This step is optional, depending on the condition of the "unbound" executable). If the LE executable is compressed with UPX, you can use the UPX utility to decompress the executable to obtain the real executable. The UPX utility supports decompressing executables packed with UPX, with the -d command.
After the step(s) above, everything is business as usual for the reversing ;-). This trick is probably handy in some situations. Anyway, if you need to boot to DOS to run DOS32A utility, you can use an empty flashdisk and boot to DOS (or Windows 98) from it. The HP USB Disk Storage Format Tool is handy on this situation.

Friday, January 25, 2013

Gizmo Board (AMD G-series APU)

Has anyone play with this thing: http://www.gizmosphere.org/why-gizmo/ ? It's very interesting because it uses Coreboot out of the box instead of Legacy-BIOS/UEFI. Well, I'm not sure whether it's possible to use UEFI as it's payload or not (Coreboot support UEFI as its payload).

But from embedded development point of view, just boot straight to Linux from Coreboot ;-). Linux drivers will take care of the rest of system initialization. The interesting thing is, the kit also provides an "explansion" board to tap into the I/O of the x64 system (the AMD G-Series APU), well, I exagerrated a bit, I meant you could hook directly to the I/O which very probably connects to the "southbridge" of the entire system.

Anyway, from pure raw performance point-of-view, this is a real raw power  monster to play with. But, I'm not sure how it compares to BeagleBoard when playing with signal processing. But surely for computer vision stuff, it's certainly very powerful given that OpenCV is tuned for x86 (x64?) architecture by default.

I think it's also an interesting platform to play with Coreboot and to understand the inner working of modern day x86/x64 processor.

Thursday, January 10, 2013

UEFI EDK II on ARM (BeagleBoard) and My Next Article

I haven't been checking out TianoCore for a while and when I did, I stumbled upon this: http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=BeagleBoardPkg. It's an interesting proposition for UEFI-on-ARM research and the likes. 

As for the next article, I'm still looking for a suitable EFI Option ROM to work with. My previous candidates didn't live-up to expectation as they were quite unworkable given the free time I have to work on the article. 

Stay tuned.

Friday, October 19, 2012

Advanced Format HDD (HDD with 4KB Sectors)

Last week I migrated one of my machine to RAID 1 and for the first time using HDD supporting Advanced Format (4KB sectors). I wonder new BIOS/UEFIs implementation support these HDDs natively so that they can be used not in 512Byte sector emulation. Particularly, exposing the HDD capability to the operating system.

Well, of course, the support is very probably via new ATA Command in the ATA command set spec. So, BIOS/UEFI code emits ATA Command to the drive to get info on Advanced Format support and so on. I'm still digging into UEFI spec whether there are specific data structure exposed for that support.

Anyway, GNU parted have support to optimize sector aligning for Advanced Format HDDs. I have a write up on that at: https://sites.google.com/site/pinczakko/slackware-14-software-raid-installation-on-hdd-with-advanced-format-4kb-sectors.