Menu

Disabling disk access to prevent startup hang

Anonymous
2011-11-20
2013-04-23
  • Anonymous

    Anonymous - 2011-11-20

    I recently emailed Marcin, the developer about how Hexplorer hangs on startup because I don't have a floppy drive. I actually found out how to disable this "disk access" feature to prevent this from happening. I've pasted the instructions below which allows you to use Hexplorer on itself to patch out the problem. Ultimately, it would be nice to have a setting to disable this for those of us who never use this feature.

    Modding out the disk access in Hexplorer 2.6:

    Hexplo.exe

    At 0x63c8: Used to read:
    803d30004a0000  cmp     byte ptr ,0
    0f8552010000    jne     image00000000_00400000+0x70f0 (004070f0)
    Corresponds to source hexplorer.cpp:1535
    if(bos32)
      for(char drive='a'; drive<='z'; drive++)
      {
    dysk=new cDiskAccess(drive);

    Change 803d30004a0000 to 9090909090c039. Effective new source:
    if(!(%eax == %eax))
      for(char drive='a'; drive<='z'; drive++)

    Methodology of finding this solution:
    1) Within cDiskAccess constructor, calls CreateFile.
    2) Run Hexplo.exe in WinDbg, break on Kernel32.dll's CreateFileA:
         bp kernel32!CreateFileA
    3) Run until disk access dialog pops up.
    4) Look at disassembly and memory dump of location.
    5) Notice the for loop constants 'a' and 'z' (61h and 7ah)
    6) Just above should be the if statement, which instead of JE needs to ALWAYS jump.
    7) Thus, change the preceding CMP to an always true (CMP %eax,%eax = 0xc039), and fill the rest with NOP (0x90).

     
  • Marcin Dudek

    Marcin Dudek - 2011-11-21

    Thank you very much for your spectacular contribution. I know this should be done in the code, but for some reasons it wasn't. I still hope that some day soon I recompile Hexplorer again and fix this and few other annoyances I'm getting feedback about. Thank you!

     

Log in to post a comment.