cobfusc 生成未知字符

问题描述 投票:0回答:1

我想得到一个混淆的输出(对于学生)。我用这个例子:

输入文件hello.c

#include <stdio.h>

int main() {
    printf("Hello, World!\n");
}

生成混淆文件,olleh.c

cobfusc hello.c -o olleh.c

输出文件olleh.c

#include <stdio.h>

�my�U �my�U() {
    �my�U("Hello, World!\n");
}%

编译olleh.c

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() {

这是预期的行为吗?我认为输出应该是可编译的。

c obfuscation
1个回答
0
投票

README.compile 解释了“flex”的问题,并说您需要使用“lex”或使用“flex -l”。

最简单的修复是在运行 ./configure 后更新所有 Makefile,并将 LEX= 行更新为 flex -l,而不是 flex。

混淆快乐!

© www.soinside.com 2019 - 2024. All rights reserved.