If an egg is already cracked then it will almost certainly split open when boiled, there's no way to avoid it, it would be best to cook them using another method.
Be aware that once eggs are cracked they no longer have protection against microbes, if you don't know how long they have been cracked it may be best to throw them away.
cooking.stackexchange.com/users/19707/GdD
I use Egglettes ™ to boil my eggs.
You simply crack the egg/s into a silicone cup and place it/them into boiling water.
Without wishing to seem like a crappy infomercial (see below), I find it a heck of a lot easier to crack an egg into a cup than I find it to peel eggshells off of a soft-boiled egg.
Obviously it makes no difference if the egg has already sustained a recent crack (from being dropped onto the surface, for example) since you're removing the shell prior to cooking.
https://www.youtube.com/watch?v=WxVT2Q6Vt_c
For the avoidance of doubt, I am in no way affiliated to Egglettes other than being a customer
cooking.stackexchange.com/users/45049/Richard
Adding salt in the water helps as well.
There are multiple theories on why this works.
Osmosis direction
The egg white will become solid when getting in contact with the salt water and basically it will close the crack again.
Boiling point difference
cooking.stackexchange.com/users/70872/StefanJanssen
You can choose to poach the egg.
The egg is cracked into a cup or bowl of any size, and then gently slid into a pan of water at approximately 75 Celsius (167 °F) and cooked until the egg white has mostly solidified, but the yolk remains soft.
The "perfect" poached egg has a runny yolk, with a hardening crust and no raw white remaining.
I don't have any experience with this
but I would imagine you could cook it until the yolk hardens along with the whites.
cooking.stackexchange.com/users/41669/MonkeyZeus
You can boil cracked egg safely just use 2 table spoons of white vinegar.
Put White vinegar in boiling water and then gently put the egg in the water and let it boil.
Egg will not come out of its shell.
You can also make egg poach.
Click here to understand about egg poach
cooking.stackexchange.com/users/70693/user227201
Believe it or not, you can put some Duct Tape (like gaffer tape - heavy tape) over the crack, and away you go.
(I'm not sure why anyone would bother with this - boiled eggs which have some white "poking out" are fine -
but there you have it.)
cooking.stackexchange.com/users/38062/Fattie
It's possible to boil an egg with steam.
This usually requires an additional device.
The eggs are put upright and won't split open since they are not exposed directly to the hot water.
cooking.stackexchange.com/users/70871/fiscblog
If the egg's been cracked for a while, just throw it out.
Even though the boiling process should kill anything growing in it, good sense says it's not worth the risk.
If the egg gets small cracks when you put it in the water or while cooking, it's perfectly fine.
In my experience, the heat will quickly make the outer layer of white solidify as it cooks, which will lock everything else inside, crack or no.
The worst I've ever seen happen from cooking an egg that cracked early on is that little bits of white escape and get cooked in the water, giving it a cloudy look.
I've eaten many eggs that cracked while cooking and never had any problems.
cooking.stackexchange.com/users/70885/CMB
You can "steam" the egg instead.
use a separator/sieve to suspend the egg above the boiling water in the pan.
It will take longer than boiling to completely cook the egg.
cooking.stackexchange.com/users/70926/aquarian47
If we boil an egg which already has a crack on its shell before boiling, it will break and spread into the water. In many cases if we put an egg into hot water it will crack also. So, is there any safe method to boil an egg like that, or should it be fried or cooked in another way?
Is there any method to boil a cracked egg without making a mess?
cooking.stackexchange.com
<eggs><hard-boiled-eggs>
cooking.stackexchange.com/questions/94249
cooking.stackexchange.com/users/70568/user29521
If an egg has been cracked for a while, it may not be safe and should be thrown out. Otherwise you can add vinegar or salt to the water, use another method like steaming or poaching or use Egglettes to cook the eggs. If an egg has been cracked for some time, throwing it away is considered sensible. However, you can boil a cracked egg by adding salt or vinegar to the water, applying Duct Tape to the crack or boiling the egg in Egglettes ™. Alternatively, a different cooking method can be used, like poaching or steaming.
If an egg is cracked it is better to choose a different cooking method and not boiling. Poaching or steaming are possible cooking methods. If you wish to boil a cracked egg use one of the folloiwng tips: add salt or vinegar to the cooking water, use Egglettes ™ to cook the egg or place Duct Tape over the crack. It is better to throw away an egg that has been cracked for some time.