Hey o_e_l_e_o, this is just what I was looking for; that it is possible to fix a corrupt blk*.dat file and it can be done as long as I do not something crazy to the block that changes the consensus rule.
So this is a completely different scenario to what you described in your first post. You cannot fix a corrupted block by editing your Bitcoin Core files, since the two things are entirely separate. You also shouldn't try to manually edit your blk*.dat files to fix a mistake, as you will almost certainly just create more errors in the process.
As nc50lc says, the correct approach to a corrupted blk*.dat file is to run Bitcoin Core with the
-reindex option. This will wipe your block index and your chainstate and build them from your blk*.dat files. If it finds a corrupted block or blocks, it will request a replacement from peers.