我想得到一个混淆的输出(对于学生)。我用这个例子:
#include <stdio.h>
int main() {
printf("Hello, World!\n");
}
cobfusc hello.c -o olleh.c
#include <stdio.h>
�my�U �my�U() {
�my�U("Hello, World!\n");
}%
gcc olleh.c
olleh.c:3:1: error: stray ‘\344’ in program
3 | �my�U �my�U() {
| ^
olleh.c:3:2: error: stray ‘\16’ in program
3 | �my�U �my�U() {
| ^
olleh.c:3:5: error: stray ‘\333’ in program
3 | �my�U �my�U() {
| ^
olleh.c:3:3: error: unknown type name ‘my’
3 | �my�U �my�U() {
这是预期的行为吗?我认为输出应该是可编译的。
README.compile 解释了“flex”的问题,并说您需要使用“lex”或使用“flex -l”。
最简单的修复是在运行 ./configure 后更新所有 Makefile,并将 LEX= 行更新为 flex -l,而不是 flex。
混淆快乐!