I have to explicitly test the case what my application does if it tries to access some corrupted part of an NTFS file system. I looked around for similar questions but those were about corrupting specific files (i.e. destroy the syntax of an xml file, etc).
I need to create a scenario where chkdsk would report errors in the file system in a specific location.
Does anybody have any idea how I could provoke such a situation to test my application.
Just in case you worry: I wouldn't do that on my production system, I have a VM set up for things like that.
How to corrupt a file on purpose so it won't open? You can corrupt a Word file or other types of files by renaming, using Notepad, online file corrupter, and file compression tool. If you have mistakenly damaged files that you actually need, use EaseUS file repair tool to fix the damaged files instantly.
Filesystems can be corrupted due to unexpected power loss, system crashes and unsafe removal of the drive. After such an incident it is recommended to repair or at least check the filesystem to prevent future data loss. Sometimes a repair is required in order to mount or modify a filesystem.
File corruption usually happens when there is an issue during the 'save' process. If your computer crashes the file being saved will likely be corrupted. Another cause might be damaged sections of your hard drive or storage media that might have viruses and malware.
A data or program file that has been altered accidentally by hardware or software failure or on purpose by an attacker. Because the bits are rearranged, a corrupted file is either unreadable to the hardware or, if readable, indecipherable to the software.
If the concern is about what your app would do when encountering corrupt files, then why bother corrupting the filesystem that contains the files? Why not simply corrupt the files themselves?
The operating system does a lot to ensure that filesystems are robust, I'm not sure that intentionally scribbling garbage on the file system will do anything other than fuzz test the filesystem implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With