I was in search of an algorithm that calcualted CRC32 values compatible with WinZip. Found your code here and downloaded it. It works perfectly and is EASY to follow. Many, many thanks for an excellent code contribution!!
Is there a way to append 4 bytes to the end of a string such that the resulting new string always returns the same CRC regardless of what changes have been made to the original string? I'm trying to send a short packet of information but I'd rather not have to parse the packet before I CRC it at the receiving end. Instead I'd just like to hard-code a known result then compare a CRC of the whole packet to that known result. I only have to parse the packet if the CRC matches, thus not having to waste time parsing bad packets.
I want to get my exe to CRC check itself, but naturally there is a paradox in doing so. Each time i compile my final executable, it has a different CRC, so it seems impossible for me to place a check for if(crc = 123456789). Naturally, each time I recompile, the value I am comparing against will have changed ...
Is it possible to get an exe to check its own crc without storing the exe's crc externally to itself ? I wish to use this check so that I can verify that my exe has not been cracked/patched at runtime.