So this is for anyone who has a Bitcoin.dat wallet.
A friend of mine, who's been into crypto way longer than I have, lost quite a bit of Bitcoin because he thought it would be a good idea to edit his .dat wallet file with an editor. He claimed it was just a blunder, but he definitely went through a tough time figuring it all out. Luckily, he warned me about it after he had a few rough days.
I can't really get a screenshot of the address that had the funds because he's aware that I might share it here. He knows I'm active on a crypto forum.
To keep it simple...
Don’t even think about opening your wallet.dat file with an editor.
It's not worth the risk, especially with your internet connection.
Remember, wallet.dat files are meant to be used only with Bitcoin Core.
Trying to mess with a wallet.dat file using a file editor basically lets everyone see your private key.
So for sure, basically, he used a text editor for sure, and that editor is connected online, which could easily detect whatever file is open on that editor.
So I assume that the editor is kinda not safe to use because it can easily access all the files you want to open with that editor.
I'm curious why he wants to open the .dat file in an editor?
You cannot overwrite your wallet file unless you click "Save" in the text editor.
And you shouldn't be editing a binary sqlite3 database using a text editor in the first place. Wrong tool.
Why was he doing that anyway? And he didn't make a copy?
No, it wasn't the internet connection.
Your brother have chance to recover his Bitcoin. See this short guide.
Make sure he do it only on offline/secure device.
But i wouldn't be surprised if there are editor that automatically change thing (such as editing metadata or encoding) when you open it, which may cause the corruption.