From 49d1e9223d1b2cb6ebcffe2ffb0b431a30760467 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 17 May 2023 04:43:06 -0700 Subject: [PATCH] Updates to 2001/anonymous As it's uncertain (both to Landon and me) whether it's supposed to execute programs it is run on or only modify it which it does (if 32-bit ELF - which is the only kind it's supposed to act on) with my fix (see README.md for commit ids) I have added a new bug status: STATUS: might not be completely functional - can you confirm? and added this new status to this entry. When or if we figure out the functional status we will remove (if completely functional or we figure out what's wrong and fix it which of course is the ideal case) or change (if it is not completely functional) the status. If anyone knows the functionality status *please* let us know! I also updated the try.me.sh script to be quiet on make clobber so that if -m32 does not work nothing but the error message will be shown and if it does work only the commands and output of the commands will be shown. In other words make commands are not shown. --- 2001/anonymous/README.md | 13 ++++++++++--- 2001/anonymous/try.me.sh | 3 +-- bugs.md | 36 +++++++++++++++++++++++++++++------- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/2001/anonymous/README.md b/2001/anonymous/README.md index 7b0394fd7..82cec013a 100644 --- a/2001/anonymous/README.md +++ b/2001/anonymous/README.md @@ -19,9 +19,9 @@ make supplementary program and the program itself, both of which segfaulted. He managed to do this with linux but it will not work with macOS (see [bugs.md](/bugs.md) for why this is); this is not a bug but a feature inherent -in what it does. He said this took serious debugging and skill (shameless self -promotion but it's true :-) ) and we thank him _very much_! But what needed to -be changed? Although it took a fair bit of debugging it turns out all that +in what it does. + +Although it took a fair bit of debugging it turns out all that needed to be changed was: - `#include ` for `mmap()`. @@ -47,6 +47,13 @@ git diff c48629017117379a52b1a512ef8f2593ca9569c8..efdee208a2bc650256637b9357ddf git diff efdee208a2bc650256637b9357ddfd0de82d2f41..e9a3f77ea3b209e63ac3f9c06bb84ad86e5ea706 anonymous.c ``` +There's an another important point in [bugs.md](/bugs.md) about this entry, +however, in that we're not sure if the entry was supposed to run the program or +not as there is some inconsistency in the author's comments which we think might +have been intentional. + +Thank you Cody for your assistance! + ### WARNING on note from the author The author suggested that this will somewhat destroy the binaries this touches diff --git a/2001/anonymous/try.me.sh b/2001/anonymous/try.me.sh index 4d3163537..1df9c1838 100755 --- a/2001/anonymous/try.me.sh +++ b/2001/anonymous/try.me.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -make clobber +make clobber >/dev/null 2>&1 if [[ $(make anonymous.ten >/dev/null 2>&1) ]]; then @@ -26,7 +26,6 @@ if [[ $(make anonymous.ten >/dev/null 2>&1) ]]; then echo "$ diff -s ten.txt ten.bak.txt" 1>&2 diff -s ten.txt ten.bak.txt else - echo echo "cannot compile anonymous.ten.c as 32-bit, sorry." exit 1 fi diff --git a/bugs.md b/bugs.md index 0edf30e3b..039bf54c3 100644 --- a/bugs.md +++ b/bugs.md @@ -191,8 +191,18 @@ NOTE: we're still locating entries and working on fixes with this status so we'r ready for help. We will remove this when we are. Entries with this status might or might not have a bug possibly depending on the -system. In these entries we don't have the appropriate systems to test and fix -any problems. +system. In these entries it's unknown if there is a bug and sometimes it's +because we do not remember and sometimes we don't have the appropriate system or +environment to test and fix any possible problems. + +## STATUS: might not be completely functional - can you confirm? + +NOTE: we're still locating entries and working on fixes with this status so we're not yet +ready for help. We will remove this when we are. + +Although these entries _appear_ to work for one or more reasons we're unsure if +they are completely functional. Can you confirm this? Please let us know so we +can fix it! ## STATUS: probable bug (possibly depending on system) - please help test and if necessary fix @@ -1093,14 +1103,26 @@ fire](https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing))! :-) ). # 2001 ## [2001/anonymous](2001/anonymous/anonymous.c) ([README.md](2001/anonymous/README.md)) +## STATUS: might not be completely functional - can you confirm? + +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed a segfault in +both the entry and the supplementary program (both segfaulted) and it appears to +work in that it does do what the author suggests. However there is an +inconsistency in remarks about whether it should _execute_ the program it's run +on after modification or if it should _only modify_ it. With Cody's fix it +modifies the program, only works on 32-bit ELF binaries (by design) and the +binary still works but we do not know if it's supposed _additionally_ run it. +Can you confirm? Please let us know! + + ## STATUS: INABIAF - please **DO NOT** fix [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this so that it -works in modern systems but he notes that the program -[anonymous.ten.c](2001/anonymous/anonymous.ten.c) **MUST** be compiled as a -32-bit ELF binary! This because the program acts on 32-bit ELF binaries. If you -cannot use `-m32` on this file the program **will** almost certainly crash but -in no case will it work properly. +works (it segfaulted - but see above) in modern systems but he notes that the +program [anonymous.ten.c](2001/anonymous/anonymous.ten.c) **MUST** be compiled +as a 32-bit ELF binary! This is because the program only works on 32-bit ELF +binaries. If you cannot use `-m32` on the files it acts on the program **will** +almost certainly crash but in no case will it work properly. This means that for macOS it will not work. Why will this not work in macOS? Because Apple saw to it to make it very hard to compile 32-bit binaries (thanks