Program for file corruption?

I know it may seem ridiculous that you intentionally want to corrupt the file, but I assure you of this for a good reason.

In my application, I have a lot of xml serialization. This, in turn, also means that I have a lot of deserialization.

Today I tried some disaster scenarios. I reset the server during the serialization operation, as expected, it messed up the xml file.

The problem is that the attempt to "turn off" the server at the right time to damage the file is not entirely optimal, firstly, its luck in catching the operation during the recording time .0001 ms, and secondly, then the server needs to reboot .Also its just a bad idea period to pull the plug from the server for other reasons.

Is there an application that can corrupt a file efficiently so that this file can be used for testing in my application?

+3
source share
7 answers

Open it in a hex editor and enjoy twisting bits?

+20
source

Fuzz Testing, , . fuzz, . , . , , .

+5

?

, , - ?

+2

XML . : - XML ( XML). - (Binary/more text).  -, "/" XML . XML .

- ;)

+2

" " . , , , , , , .

- ( ) , , , , . (, , , )

+1

Hex, , nulls (0x00) ..

0

, , . , , .

Of course, this is just one kind of bad data, but it is worth noting that XML, distorted in any way, is essentially no longer XML, and most parsers reject it by hand at the first sign of a syntax error.

0
source

Source: https://habr.com/ru/post/1715195/


All Articles