how to i write sectors in win7
how to i write sectors in win7
For what purpose do you need to write to sectors?
i wanna develop a data recovery software.
i need to modify the error of sectors
Last edited by ampc; 02-06-2013 at 09:31 PM.
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).
ReadFile can read the sectors ,but WriteFile can not modify it
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?
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
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).
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.