In this case you have to use sed, like this
Code:
sed -i 's/[.]exe/.g43/g' testfile
Please note: in a regular expression the dot "." means any single character, so you have to let sed interpret it literally using the square brackets. Otherwise any occurence of the string "exe" preceeded by any character will be substituted.
Test the command above on a single file without the -i option (output is displayed in the terminal). When you are sure of the result, add the -i option to edit files in place. To do this recursively use the find command, like this:
Code:
find /path/to/dir -type f -exec sed -i 's/[.]exe/.g43/g' {} \;
Here I used -type f to select files only, but you can refine the search criteria if you want to do this to some specific files only. Take in mind that sed will substitute strings even in binary files.