Hi Assad,
sorry if I wasn't clear and thank you for the reply.
Essentially what I want to do is similar to what WinAfl does, but instead of redircting to a specific function that I want to fuzz and then exit, I want to fuzz that function and then continue with the normal execution of the program as if the redirection behaves like a jump back in the program's code so that after this operation it can continue with the execution.
The jump back happens when I hit a specific api that I wrapped, for example strcmp.
Let's say that strcmp is encountered in the program, I jump back to another API that I have seen previously and for which I have saved the mcontext details when I first hit it, then it continues with the execution and so reach again strcmp and check its arguments if they are changed.
I don't want to put togheter the wrapping and also the instruction modification, seems like a mess to me, so I wonder if there is a more elegant way to do this with drwrap because at the end what I want to do is analyse the APIs that I encounte so I must use it.
Up to now the code I used is pretty standard, I have the load event where I decide which function wrap and then the pre/post-execution functions for each of them where I do the stuff.
As previously said until now I tried with drwrap_redirect_execution since I'm taking inspiration from WinAfl.
Have a nice day,
Nicola