CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2012
    Posts
    3

    Angry Dos application don't work

    I write a DOS application that read the boot sector of a hard disk but this dont work and show a message saying that a application try to access directly the hard disk and is no support to this. Why this happens? How can I bypass this?

  2. #2
    Join Date
    Apr 2012
    Posts
    3

    Re: Dos application don't work

    Why nobody answer???

  3. #3
    Join Date
    Jan 2009
    Posts
    596

    Re: Dos application don't work

    Quote Originally Posted by INT 13h View Post
    I write a DOS application that read the boot sector of a hard disk but this dont work and show a message saying that a application try to access directly the hard disk and is no support to this. Why this happens? How can I bypass this?
    If it is the boot sector of the hard disk from which you are running the application, this probably won't be easy. The OS will try it's best to prevent it as writing to this region is an operation which is used by boot sector viruses. Although reading from the boot sector won't be much use to a virus, maybe it is easier and safer for the OS to just prohibit any access to the boot sector.

    Quote Originally Posted by INT 13h View Post
    Why nobody answer???
    Answering questions on these forums isn't our job, you know. We do it for free, when we have a spare minute. Remember to be polite and you will have more chance of being answered.

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Dos application don't work

    If you boot DOS (or Win95/WinME) you will probably succeed but I would be surprised if not all variants of NT OS will prohibit you from using int13 regardless of if you read or write.

    The reason is that if int13 was allowed you could read any file on the disk regardless of priviledges.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  5. #5
    Join Date
    Apr 2012
    Posts
    3

    Re: Dos application don't work

    What I can't understand is that when my DOS Application that use INT 13h enter at INT 13h it find the instruction LES AX,SP that stop the application. What is the instrunction LES AX,SP and why this instruction stop the DOS application that I write?

  6. #6
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Dos application don't work

    The instruction pointer is always one step ahead when you experience such a break.

    I repeat, do this kind of programming in a DOS compatible OS. The shell (cmd.exe) in a NT OS isn't fully DOS compatible.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured