Find and replace strings in HEX in bin file


I am trying to write a program changing the string (HEX) to another of the same length. I do it in C ++ and I have a bit of a problem (I'm just starting to research on the topic). I found a function that does this for one string and it works after modification, but I care that these strings to change were many (unspecified number with the possibility of appending). The code working with one string looks like this:

I would like to do this:

because these strings will be changeable.

I tried to repeat:

but there is a problem (error) of variable renaming and it does not look optimally. Can you help?
Registered users can post here. Sign in or register to post.