Update 2001/anonymous - cpp, 32-bit ELF ten.c etc.

Add back cpp.c which is a C pre-processed version of anonymous.c. Added
comments and tried to format it some. Perhaps I should use a formatted /
de-obfuscator from some years ago in the IOCCC (by Dave Burton) but I
didn't think of that until much later on: I'll consider it another time.

The Makefile builds cpp by default. Works as well as anonymous.c: will
modify 32-bit ELF binaries in the right systems (it won't touch them in
macOS - I pre-compiled anonymous.ten.c as 32-bit ELF in linux and added
it to the repo as anonymous.ten.32 mostly for those who might be able to
run 32-bit ELF binaries but have no way to compile them though maybe no
system has that but it also allows for partly 'testing' the program in
macOS).

Change main target to compile to anonymous and not anonymous_tmp. This
is because otherwise running make would repeatedly try and build it. I
did try changing the target but that didn't want to work possibly due to
the cp updating the timestamp though that's a quick thought in the head
of someone who's been awake too long at the hour.

Instead anonymous.sh is the script to run to 'emulate' the running of
the target program (again assuming that's correct which does seem likely
but is still unconfirmed).

The anonymous.sh script now checks for compiling anonymous.ten.c but
uses anonymous.ten.32 as a backup if it exists.

Update bugs.md and README.md.

Anything else I'm afraid I've forgotten.
This commit is contained in:
Cody Boone Ferguson committed 2023-05-19 04:12:33 -07:00
1 parent 0571930501
commit 31fef7fa43
7 files changed
+464 -40

No files matched your search

+13 -4
View File
@@ -117,9 +117,9 @@ PROG= ${ENTRY}
#
OBJ= ${PROG}.o
DATA=
TARGET= ${PROG} ${PROG}.ten
TARGET= ${PROG} cpp ${PROG}.ten
#
ALT_OBJ=
ALT_OBJ=
ALT_TARGET=
@@ -139,8 +139,8 @@ ${PROG}: ${PROG}.c
X='-DA(X)=#X'; \
warning='-Dprocessor'; \
$$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \
$< -o $@_tmp ${LIBS}
${CP} -af anonymous.sh $@
$< -o $@ ${LIBS}
${CHMOD} -v +x anonymous.sh
${PROG}.ten: ${PROG}.ten.c
@@ -157,6 +157,15 @@ ${PROG}.ten: ${PROG}.ten.c
@echo
${CC} ${CFLAGS} -m32 $< -o $@ ${LIBS}
cpp: cpp.c
magic='${CC} ${CFLAGS}'; \
X='-DA(X)=#X'; \
warning='-Dprocessor'; \
$$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \
$< -o $@ ${LIBS}
${CHMOD} -v +x anonymous.sh
# alternative executable
#
alt: data ${ALT_TARGET}