Change a constant variable without rebuilding C++

It seems that there are only two approaches. One is just building the project inside a Linux environment which is a better method but must be used some tools like Mono XBuild link here. Another option which may be simpler is just open the binary file and manipulate the specific string. As @aloMalbarez comment Here is a simple script based on this. Suppose this example: (I used 50 ms as a fixed length for my ID)

#include <string>
#include <iostream>
#include <Windows.h>

#define ID "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"


using namespace std;

int main() {
    cout << "Your ID: " << ID << "\nlen:" << strlen(ID) <<  endl;
    getchar();
    return(0);
}

After generating the executable use the following script to create output. I'm not a Linux guy so you can help me improve this. ./build.sh input.exe output.exe "myfixedID"

#!/bin/bash
# build.sh input_file output_file <ID>


input_file=$1
output_file=$2
ID=$3


if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
  echo "wrong parameters"
  echo "build.sh input_file output_file <ID>"
  exit 1
fi

# use fixed string (ID) in the source file
# this creates 50 of "m"s
search_value=$(printf 'm%.0s' {1..50})

extension=".back"
temp_file="$input_file$extension"
tmpstring_file="./tmp"
null_termin='\0'


echo "copying the original file..."
yes | cp -rf $input_file $temp_file

address=$(strings -t d $temp_file | grep $search_value | grep -o '[0-9]*')

echo "Address:"
echo $address
if ! [[ $address =~ ^[0-9]+$ ]]; then
  echo "cannot find valid ID in executable"
  echo "removing temps"
  rm $temp_file
  exit 1
fi


# make the tempstring file
printf "$ID$null_termin" > $tmpstring_file

dd if=$tmpstring_file of=$temp_file obs=1 seek=$address conv=notrunc

echo "make new file"
yes | cp -rf $temp_file $output_file

echo "removing temps"

rm $temp_file $tmpstring_file

echo "Done!"