Actually the BASE.RKW format looks like this:
1) Header - start with "KRDL", the struct is in rkwpatch.c and can also be found somewhere in the SDK (has a CRC32 value of the header at the end). This part needs no modification if you change some bytes in the code.
2) code + CRC32 appended - ARM binary code & CRC32 of the code.
So basically if you want to change some bytes in the code: load the whole file into a buffer, change your bytes and replace the last 4bytes by the crc32 value of the code (code means the data starting from sizeof(header) and ending at filesize-4). Then you write the whole buffer to a file and you have a modified and working firmware. This amounts to doing some fileio and using the crc32 code from rkwpatch.c (+ that header iirc).
Regards
|