how to edit ECC code

Hi , can I change the ECC code for a block of a file stored on a flash drive by any means ? of a file stored on a HDD (though I don’t think there would be a difference between the two)

Maybe , through some hardware interrupts or anything like that?

Also if possible I need the solution to be in C/C++.

If my question in unclear this is the ECC code I am referring to Eureka Technology - NAND Flash Controller IP core FAQ