Settings

Theme

C code that can be “compiled” by sha384

weijr-eng.blogspot.com

14 points by tjwei 11 years ago · 2 comments

Reader

glandium 11 years ago

"sha384 was chosen because it is possible to fit an ELF binary into sha384 digest"

Except none of the sources have a sha384 that ends up being an ELF binary.

In the first example, the important thing is that the sha384 digest starts with 0a23, so "\n#" so that this essentially "compiles" to an empty shell script.

In the second example, the digest starts with 2e202a0a, which is ". * \n", so it only really works because the source, 0.c, is the first file in the directory, and is both a sourceable shell script and a C source file. Remove it, and the trick doesn't work anymore.

In the final one, the trick is similar, but the digest starts with "sh * \n" instead.

EDIT: asterisks are inconveniently turned into italic formatting. Consider all asterisks in this post as not followed by a whitespace.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection