Heat the oil in a frying pan or wok over a medium heat. Add the garlic and stir fry for 1-2 minutes until golden. Add the onion and carrot and cook for a couple of minutes.
Add the oyster sauce, soy sauce, fish sauce and sugar and quickly mix until combined, then add the cooked rice. Cook for a few minutes, stirring to separate the grains and coat them evenly with the sauce.
Move the rice to one side of the pan and crack the egg/s into the cleared space. Leave for a minute then break the egg up with a spatula and start tossing the egg through the rice.
Add the crabmeat, season with the salt and pepper and gently stir through the rice before removing from the heat.
Transfer to serving plates and top with the spring onions and some extra ground pepper if you like. Serve with a lime wedge, cucumber slices and nam pla prik.