Sorry, I must have made some mistake in the editing. I am outlining the steps to be followed with some screenshots.
1. Start with the last working file, final.zip, extract it to get final.hex. This file has some mistakes and we wish to change /correct that.
2. I use vim for this; when I use vim final.hex, I get the output. (pic below).
This is the hex image in intel format. Each line is one record; first two chars (one byte) tells the number of bytes in the record. Next four chars (two bytes) are the address. Next 16 bytes (32 chars) are the data. Last two chars are the checksum for this record.
The color coding has been done by vim.
When we change a byte, we must also recalculate the checksum.
Let us see how to locate the string. First we search for the char L:
We type in vim /4C to look for the char L. But there may be some that are not part of the data string. So we cannot change at random.
We type :%s/4C//gn in vim. We see that the char L occurs 50 times. So we go for another char. This time we search for "!"
In vim I type /21. We see where they are present.
Finally we locate them in address line 165A. Look up an ascii table ans see that the ascii codes for LEBANON are 4C 45 42 41 4E 4F 4E
(see next post)
- - - Updated - - -
Searching is messy because they may not occur on the same line. ALso note that each char is separated by hex 34.
Search /4C344534 and you will that it is presence only once ... (it should be present twice but because of the spelling error)
Now we know that we have typed LF (by mistake) - so we search for /4C344634.
We reach the line that needs correction. Address line 168A.
in this line change 46 to 45. Also change 21 (code for !) to 41 (code for A). That is all.
Wait, we have made some changes to the file and the checksum is now to be corrected.
Open a calculator in hex mode. And add the following: 10 +16 +8A +20 +34 +4C+ 34 +45 +34 +42 +34 +41 +34 +4E +34+ 4F +34 +4E +34
(number of bytes + address two bytes + data bytes (sixteen in this case): in this case 46F. We take twos complement and take the last byte: 91.
We must put the correct checksum in line 168A (the last byte is the checksum). We replace B0 with 91.
Now you save and exit. (command is :x in vim).
That is all, load and run!
- - - Updated - - -
In the screenshot, vim is saying [dos] on the status line; by mistake I opened the file without the -b option. You should open the hex file in binary mode (i.e., vim -b final.hex)- otherwise other stuff may be written in the file.
After the edit, the original file (you kept a copy, right?) and final file must have he same size.
Also a diff orig.file chang.file should show only one line (because we have modified only one line).
I hope I have made the basics clear.