Movfuscator: Compile C into only mov instructions
github.com
github.com
Previous submissions with significant discussion:
- https://news.ycombinator.com/item?id=18991404
- https://news.ycombinator.com/item?id=16218872
- https://news.ycombinator.com/item?id=12372242
https://news.ycombinator.com/item?id=18992556
>The mov-only DOOM renders approximately one frame every 7 hours, so playing this version requires somewhat increased patience.
https://github.com/xoreaxeaxeax/movfuscator/tree/master/vali...
I have to say, reading through the github for the movfuscator was pretty damn amusing. I honestly burst out laughing at the control flow graphs. But I'm curious, is this actually practical for anything?
Running Doom at 1 Frame per 7 hours is, pretty unreasonable. Would text based software even be usable with this?
Either way, I do enjoy cleverly, overly engineered, possibly useless things created just because someone thought it would be funny.
I just wrote a quick C program to find the primes less than 100000 and compiled it with gcc and movcc. I wouldn't say it's, you know, fast, but I'm impressed at how it does finish in an amount of time that I was willing to wait.
$ time ./primes.gcc | wc -l
9592
real 0m0.035s
user 0m0.031s
sys 0m0.012s
$ time ./primes.movcc | wc -l
9592
real 0m10.511s
user 0m8.289s
sys 0m2.228s
It looks like the reason that it spent so much time in syscalls is that it somehow uses signals for control flow. (I'm not quite sure how that works.)see https://github.com/xoreaxeaxeax/movfuscator/blob/master/movf... and https://github.com/xoreaxeaxeax/movfuscator/blob/master/movf...
I liken the motivations behind things like Movfuscator to mountain climbing: they do it because it's there to be done.
As someone else noted, a large block of mov instructions would be quite easy to spot so you'd have to tie it into a bit of core application / algorithm logic. But that doesn't mean the whole program needs to be written that way.
What about a one-time screen kindly asking for a donation?
Yes? Obviously?
> What about a one-time screen kindly asking for a donation?
If it doesn’t have a “don’t show this again” checkbox, then I would have to say “yes”.
Also, a chunk of code that is just a long string of MOV instructions is going to be really easy to spot for an antivirus program.
[1]: https://drwho.virtadpt.net/files/mov.pdf
[2]: https://stackoverflow.com/questions/61048788/why-is-mov-turi...
Could this be helpful in reverse engineering binaries by first movfuscating and then demovfuscating them? My hypothesis is that movfuscation (maybe coupled with some other techniques) might “normalize” the program in some way and demovfuscation might recover some more human-understandable structures. Or would demovfuscation just bring back the same original obfuscated mess?
previously on hn https://news.ycombinator.com/item?id=12372242
>"... there is no self-modifying code, no transport-triggered calculation, and no other form of non-mov cheating."
Could someone say what is meant by "transport-triggered calculation"? Also how does "self-modifying code" work in the context of such constraints exactly? I had a look through the "mov is Turing-complete" paper referenced in this README but didn't come across these.
That one only uses MOVs, too, but the simulated CPU has a number of special registers implementing a number of basic operations, so instead of having to manually implement them the hard way using only MOVs (which in the particular case of the wireworld computer probably wouldn't even be possible due to its constrained resources and architecture), you can "cheat" by simply MOVing your operands into the respective special registers and then reading the result.
Is there some thing like the lambda calculus that corresponds to this? I.e., the Turing completeness of a single instruction?
https://en.wikipedia.org/wiki/One-instruction_set_computer
(I don't know what's known about how to tell whether or not a particular instruction will be Turing complete. Maybe, as in many other parts of computer science, you can do it by reductions: FOO is Turing complete if you can implement BAR with it, where BAR is already known to be Turing complete; BAZ is not Turing complete if you can implement it with QUX, where QUX is already known not to be Turing complete?)
Quake was the first Id game to use floating point and why other chips like Cyrix which had poor floating point units, suffered as a result.