In the 2nd method, you don't need to write anything to the dig site :)))
The save file isn't encoded there, so you can do it more simply:
Load the save, buy a hero where you want another hero to appear under him, save. In this second save, just change a couple of bytes. That's it, the hero for hire is the one you need. All that's left is to load the modified file again. All dig sites will take no more than 30 seconds.
As a rule, this is prohibited by the rules of offline tournaments.
P.S. Although, theoretically, this method can be used.
The only thing to pay attention to is that you don't "accidentally"
dig up a hero who simply cannot appear in the tavern
(well, for example, this hero is already on the map or in the tavern of the enemy).
It is difficult to predict what will happen in such a case.
Perhaps strange glitches or something else will start.
In any case, modifying the save file can lead to errors.
Charity suffereth long, and is kind; charity envieth not; charity vaunteth not itself, is not puffed up,
Doth not behave itself unseemly, seeketh not her own, is not easily provoked, thinketh no evil;
Rejoiceth not in iniquity, but rejoiceth in the truth;
Beareth all things, believeth all things, hopeth all things, endureth all things. Charity never faileth...