I have two different files: code1.c
and code2.c
, both of them already contain some C code (files contents differ).
I would like to compile both files preferably with the same compilation flags so I will end up with two binaries which would have same size and same md5 hash.
Note: It is allowed to add extra dead/junk code to one of the files. I think gcc
compiler version should not matter? (I would use gcc version ≥ 7
)
How can I achieve that?
I found some articles which show that md5 hash collision is possible, but the problem is that it should result in the same file size: