This is a close-up on the front end. By the time this picture was taken, we'd already removed it once to verify that this technique works. The nicks on the flash hider were put on there by this procedure, however it would be possible not to damage it if more care were taken. In this specific instance, the owner had little interest in retaining the original muzzle device. Please note the wire visible in the flash hider at its base, almost centered with the barrel. This wire is part of the retention spring assembly and must not be mistaken for a pin. Farther over on this picture, you can see the rest of the retention spring. The function of this spring is to prevent a loose flash hider from spinning its way off. While it may perhaps be necessary when the rifle is brand new, the level of effort required to remove this FH indicates that the point where it may have been needed, has passed a long time ago.
First, it is necessary to remove the handguard. The push pin on the front must be removed. Locate the side with the spring on it, and in this case use pliers (or pretty much any tool) to gently whack it flush with the hole.
The pin is sticking far enough out of the hole that, with the jaws of the pliers open, the lower jaw is all it took to hook the pin and pull it out. Note that the pliers are NOT being closed on the pin at this point - it's just being used as a pry bar of sorts.
The handguards are pulled free of the gun. Note that the lower tube is the barrel, and the upper tube (unlike on an AK-47) is a cocking tube, NOT a gas tube. HK 9x series rifles generally have a cocking tube above the barrel.
With the handguard removed, the cocking tube and barrel are exposed. They're of roughly the same diameter, so we used some relatively light weight plywood to prevent marring them as we clamped them into the vise. You should set your plywood pieces as close to the front sight area as you can get them. If your flash hider is amazingly well attached, you don't want to potentially warp your cocking tube. Getting closer to the point of attachment reduces the risk of this happening.
A pair of vise-grips pliers have been cinched to the muzzle device. Note that this vise is not bolted to the floor, hence why my foot is standing on the vise to provide stability. Were it more important to preserve the muzzle device's cosmetics, I would suggest using a sheet of leather or rubber between the pliers and the muzzle device. In this picture, I am demonstrating the correct hold, but when we actually removed it, Doug was the one pulling on the pliers.
A close-up on the barrel underneath the flash hider. Note the buildup of material. This is probably solidified grease, mixed in with a bit of rust and probably some carbon, then baked together over years of firing. Over time, it turned into a kind of cement.