I think they're not reversing the way you may think(and they're doing a very bad job, if you try any of these apps they collapse very soon for basic workflow things) but rather copying the behaviour by looking at input and output. A clean-room design is called iirc

Maybe it's doing a really good job, but the original code was just held together with scotch tape.