Error in parsing MBR while opening a vhd file

Manickam
2013-09-12
2013-09-12
  • Manickam

    Manickam - 2013-09-12

    Hi,

    I'm trying to open a 1.49 TB VHD file(test_new.vhd).But it is listing only the .mbr file(test_new.mbr).

    While debugging the code i found that the below line is returning false.

    File : MbrHandler.cpp

    Function : HRESULT CHandler::ReadTables(IInStream *stream, UInt32 baseLba, UInt32 lba, int level)

    Line : for (int i = 0; i < kNumHeaderParts; i++)
    if (!parts[i].Parse(buf + 0x1BE + 16 * i))
    return S_FALSE;

    In bool Parse(const Byte *p) function the below condition is failing in my case.

    CompareChs(BeginChs, EndChs) <= 0 &&

    Note : The disk layout is in the below link

    https://dl.dropboxusercontent.com/u/41691011/disk_layout.jpg

    Why it is happening and how to solve this issue?

    Thanks in advance.

    Regards,
    Manickam

     
  • Igor Pavlov

    Igor Pavlov - 2013-09-12

    You must look also
    BeginChs
    and
    EndChs

     
    • Manickam

      Manickam - 2013-09-12

      Hi Igor Pavlov,

      We have already checked both BeginChs and EndChs.

      Both are working fine.It is failing in the below condition only

      CompareChs(BeginChs, EndChs) <= 0

      Is there anything related to disk layout?

      thanks,
      manickam

       
  • Igor Pavlov

    Igor Pavlov - 2013-09-12

    1) Just show the values of CChs structure members.
    Why (BeginChs > EndChs) ?

    2) Try to comment that line.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks