There are two possible answers to your question...but it sounds like you have a lot of background on embedded development to make up!
- If you have the source code, you can recompile the program and generate a new binary (hex) file which you can then download.
- If you don't have the source code, then it is obviously much harder and you are restricted just to changing a few instructions via the debugger. But that will only work if the program is running in RAM.
Hope this helps.
Chris