Like Tree1Likes
  • 1 Post By DeadPlanet

access absolute sector

This is a discussion on access absolute sector within the Windows Programming forums, part of the Platform Specific Boards category; how to i write sectors in win7...

  1. #1
    Registered User
    Join Date
    Jun 2010
    Location
    beijing
    Posts
    23

    access absolute sector

    how to i write sectors in win7

  2. #2
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    For what purpose do you need to write to sectors?
    Salem likes this.

  3. #3
    Registered User
    Join Date
    Jun 2010
    Location
    beijing
    Posts
    23
    i wanna develop a data recovery software.
    i need to modify the error of sectors
    Last edited by ampc; 02-06-2013 at 08:31 PM.

  4. #4
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    As with pretty much any sort of security applications, the methods involved have a great deal of malicious uses.

    I don't think it's too much to tell you to look into CreateFile for this purpose. I'm not sure what the documentation says about Windows 7 though (because it's not mentioned).

  5. #5
    Registered User
    Join Date
    Jun 2010
    Location
    beijing
    Posts
    23
    ReadFile can read the sectors ,but WriteFile can not modify it

  6. #6
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    I don't understand why you need to write the sectors for data recovery? Why wouldn't you just read the sectors off and then recreate the files from there, format the drive and place them back on?

  7. #7
    Registered User
    Join Date
    Jun 2010
    Location
    beijing
    Posts
    23
    for example , i have a removeable disk and its MBR data was broken, so i wannt use my program to modify it. i wanna use NtWriteFile, but it doesn't work

  8. #8
    Registered User
    Join Date
    Jun 2005
    Posts
    6,433
    NtWriteFile() doesn't allow such things from user code.

    There are plenty of legitimate utilities out there for repairing corrupted drives - with the caveat that all such utilities have to be installed by an administrator. You would be better off finding one of those, rather than rolling your own.

    If you are trying to find a way to do this without cooperation of an administrator, you are essentially asking for help in dodgy practices. That runs you afoul of guidelines here. Refer to this link, particularly #6. (You're barking up the wrong tree, technically, anyway).
    Right 98% of the time, and don't care about the other 3%.

  9. #9
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    And I'm not sure I'd want to touch "data recovery" software written by someone who can't work out how to do the first step.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 09-04-2008, 01:27 PM
  2. sector per track
    By sunil21 in forum C Programming
    Replies: 1
    Last Post: 09-13-2003, 11:10 PM
  3. sector size
    By elad in forum C++ Programming
    Replies: 5
    Last Post: 07-28-2003, 06:03 AM
  4. Solving bad sector ....
    By beely in forum Tech Board
    Replies: 7
    Last Post: 03-17-2003, 07:22 AM
  5. Fix the boot sector?
    By KrAzY CrAb in forum Tech Board
    Replies: 4
    Last Post: 03-14-2003, 05:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21