x86 boot code programmers : How to modify Truecrypt boot loader code for GPT tables?

1.6k Views Asked by At

It appears the the TrueCrypt (TC) boot loader is large so is split between the MBR (446 bytes) and a 32KB hole after the MBR but before the 1st partition. And TrueCrypt seems to be hardcoded in finding that 32KB hole just after sector 0 (i.e. pure MBR scheme). So when we have a GPT (which occupies the first 34 sectors/17407 bytes) instead of an MBR, this 32KB hole should be slider further away - which it does NOT.

I think the solution is "straightforward" where instead of just looking for 32KB free space (For the remaining TC boot loader) just after the MBR, it should be flexible to look for 32 KB after the GPT too. In short

// made up variable names
if (MBR)
{
    startOffsetTCBootloader = sizeOfMBR;
} 
else if (GPT)
{
    startOffsetTCBootloader = sizeOfGPT;
}
// plug back startOffsetTCBootloader into other calcs/jumps

Although I have a background in assembly AND boot loaders, none of it was in x86 assembly. So it'll take me time in fixing this myself. Plus I'm SUPER busy with a few other projects, so sadly don't have the luxury to pick a pet project (right now). So this is a call for help to my fellow developers who may be in a better position :)

So: does anyone know how to modify that? It's best if this went back to the core repository but forking isn't such a bag idea since the main branch seems unresponsive.

FYI, I did write to the TC developers but I think my email went into a black hole ... so gotta fix it ourselves. GPT disks are the future, so this fix should have a long live and many other use cases too.

Useful links:

  1. Truecrypt (TC) source: http://www.truecrypt.org/downloads2
  2. Truecrypt (TC) license: http://www.truecrypt.org/legal/license
  3. My user level issue: https://superuser.com/questions/361515/install-truecrypt-on-a-macbook-for-whole-disk-encryption-of-the-win7-partition-i
  4. More technical details (someone else): http://www.wilderssecurity.com/showpost.php?p=1590313&postcount=3 by someone else.
0

There are 0 best solutions below