Not 100% sure where you see the problem in C.
You can fseek
to 32 bytes before the end of the file and find the md5sum that you appended.
You can calculate a new md5sum over the full data except for the last 32 bytes of the file.
Do a search for cryptlib
. Quite sure it will contain the md5 algorithm (function) and that way it will prevent you from re-inventing the wheel
PS There is a dedicated programming section
here at LQ. Your question might fit better there. If you agree, you can ask a moderator to move the thread by reporting your opening post.