News for hackers. Stuff that matters.
Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @03:01PM (#18992359)
Of course, no post like this is complete without OISC:

https://en.wikipedia.org/wiki/One_instruction_set_computer

(Then, there's my contribution: NISC -- the Null Instruction Set Computer! It's a revolutionary architecture, in that die sizes and TDP can be scaled down, seemingly arbitrarily, with no loss in functionality. In fact, NISC can transcend the solid state entirely, and be implemented directly on the quantum foam of the vacuum!

Another benefit: NISC machines are entirely immune to all buffer overflow and use after free exploits! In fact, they are free of all exploits, whatsoever!)

Re:Movfuscator – Single instruction C compiler by Legogris on Thursday January 24, 2019 @04:05PM (#18992959)
Someone made a NISC compiler: https://github.com/jbangert/trapcc
Re:Movfuscator – Single instruction C compiler by jbangert on Thursday January 24, 2019 @06:07PM (#18993975)
Well, we start running one instruction, it just never quite finishes. The other OISC systems run way more than one instruction, they’re just always the same one with different parameters.
Re:Movfuscator – Single instruction C compiler by Terr_ on Thursday January 24, 2019 @03:39PM (#18992686)
Nope, it's trivial to DoS them. Attackers don't even have to do anything.
Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @04:27PM (#18993157)
Nope, it's trivial to DoS them. Attackers don't even have to do anything.

That's just the "wrong" spin! NISC computers exhibit the same performance characteristics under DDOS attacks of immense scale. Increase the scale of the DDOS attack, and the performance graph remains flat! And by flat, I don't mean with a small slope or slight wobbles. I mean completely flat!

Re:Movfuscator – Single instruction C compiler by tiuPapa on Thursday January 24, 2019 @03:51PM (#18992805)
If the attackers can't do anything how will they DoS them? Wait I think I understand now how it can be implemented on the directly on the quantum foam of the vacuum.
Re:Movfuscator – Single instruction C compiler by naniwaduni on Thursday January 24, 2019 @03:59PM (#18992891)
It doesn't matter that they can't do anything if they don't need to do anything. Things attackers can't do only matter if they'd need to do them.
Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @05:59PM (#18993926)
Newsflash: NISC system weathers huge DDOS attack, with no discernible effects!

> Things attackers can't do only matter if they'd need to do them.

BUT, by the same token, things attackers can do don't matter either! NISC computers: So advanced, they make all attackers meaningless!

Re:Movfuscator – Single instruction C compiler by nickpsecurity on Thursday January 24, 2019 @11:52PM (#18995659)
Although that's funny, NISC is already a thing:

https://en.wikipedia.org/wiki/No_instruction_set_computing

Re:Movfuscator – Single instruction C compiler by readingnews on Thursday January 24, 2019 @03:27PM (#18992583)
Best part of the project is at the bottom, in the FAQ:

> Q: Why did you make this? A: I thought it would be funny.

Re:Movfuscator – Single instruction C compiler by gnulinux on Saturday January 26, 2019 @12:11AM (#19004876)
This is real hacker news.
Re:Movfuscator – Single instruction C compiler by stephencanon on Thursday January 24, 2019 @04:04PM (#18992946)
Without taking anything away from the author, calling MOV a "single instruction" stretches things quite a bit. It's more of a big family of instructions that happen to share an assembly mnemonic.
Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @06:55PM (#18994269)
MOV a "single instruction" stretches things quite a bit. It's more of a big family of instructions that happen to share an assembly mnemonic.

But if you look at the serious attempts to implement OISC, you'll find that the "single instruction" has so many parameters, some might think it might as well be a big family of instructions.

Re:Movfuscator – Single instruction C compiler by bepvte on Thursday January 24, 2019 @09:31PM (#18995072)
new OISC instruction: RUN <x86 instruction you want to run> <parameters>
Re:Movfuscator – Single instruction C compiler by stcredzero on Friday January 25, 2019 @12:15PM (#19000012)
That was like one of my professor's version of Object Oriented programming. He would simply message pass to his undergrad assistant, Mark. "Mark, code up an X."
Re:Movfuscator – Single instruction C compiler by posterboy on Saturday January 26, 2019 @12:48PM (#19007369)
Reverse Substract and Skip if Borrow (RSSB) uses only one parameter and is supposed to be turing complete. I havent understood how it works, to be honest.
Re:Movfuscator – Single instruction C compiler by stephencanon on Thursday January 24, 2019 @07:47PM (#18994522)
This is completely fair, which is why I said not to take "anything away from the author" =)
Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @08:11PM (#18994661)
I wasn't interpreting your comment as a criticism. I was introducing background information, which also shouldn't be interpreted as a criticism.
Re:Movfuscator – Single instruction C compiler by simcop2387 on Thursday January 24, 2019 @05:44PM (#18993818)
"No wireless. Less space than a nomad. Lame." -- CmdrTaco

Yea this isn't a true OISC setup, but it's very close and still completely impressive that this technique even works. That you can influence all necessary registers like this and accomplish arithmetic isn't immediately obvious.

Re:Movfuscator – Single instruction C compiler by stephencanon on Thursday January 24, 2019 @07:48PM (#18994525)
My comment should not be interpreted as criticism.
Re:Movfuscator – Single instruction C compiler by ianbicking on Thursday January 24, 2019 @02:31PM (#18992065)
I'd recommend the video presentation linked off the page, where he walks through how he actually turned mov into a machine. It's very weird and interesting!

https://www.youtube.com/watch?v=R7EEoWg6Ekk

Re:Movfuscator – Single instruction C compiler by Legogris on Thursday January 24, 2019 @03:55PM (#18992847)
I love how he nonchalantly throws in a 0-day x86 PoC in the end.
Re:Movfuscator – Single instruction C compiler by benj111 on Thursday January 24, 2019 @02:41PM (#18992178)
So as there's no branch prediction, this is good defense against spectre type attacks?
Re:Movfuscator – Single instruction C compiler by mbauman on Thursday January 24, 2019 @03:25PM (#18992556)
For a certain value of "good", yes.

> This is thought to be entirely secure against the Meltdown and Spectre CPU vulnerabilities, which require speculative execution on branch instructions.

> 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...

Re:Movfuscator – Single instruction C compiler by ClassyJacket on Thursday January 24, 2019 @08:54PM (#18994877)
Should be good enough for console players.
Re:Movfuscator – Single instruction C compiler by JasuM on Thursday January 24, 2019 @03:05PM (#18992396)
I can imagine some timing-specific attacks for memory accesses, but they're not likely as robust as attacks against the branch-predictor:

1. This is the simplest one - if the memory being accessed is in a cache (L1/L2, or page in TLB), the function will take a significantly shorter time to execute. If movfuscator achieves conditional execution by manipulating index registers to perform idempotent operations, this will be very easy to detect.

2. Prefetching - if movfuscator reads memory sequentially with a detectable stride, prefetching will shorten the execution time.

3. Write combining - if the code writes to nearby addresses (same cache line), the CPU will combine them to a single write. This will cause a measurable timing difference.

EDIT: One more: Store forwarding - if the code writes to a memory address and reads it soon, the CPU may bypass the memory access (and even cache access) completely.

Re:Movfuscator – Single instruction C compiler by klodolph on Thursday January 24, 2019 @03:04PM (#18992384)
This is a defense against spectre type attacks, but this cannot be a "good" defense because it sacrifices too much. The programs written this way are assuredly quite slow.
Re:Movfuscator – Single instruction C compiler by dx87 on Thursday January 24, 2019 @03:03PM (#18992379)
in a similar vein, here is an exmple program that runs using only x86 CPU faults.

https://github.com/jbangert/trapcc

Re:Movfuscator – Single instruction C compiler by saurik on Thursday January 24, 2019 @03:11PM (#18992450)
Re:Movfuscator – Single instruction C compiler by yellowapple on Thursday January 24, 2019 @04:27PM (#18993147)
Who would win: the world's most popular CISC architecture or one MOVey boi?
Re:Movfuscator – Single instruction C compiler by jchw on Thursday January 24, 2019 @03:29PM (#18992594)
This is awesome and it gets posted periodically. Previous discussion:

https://news.ycombinator.com/item?id=12372242

Re:Movfuscator – Single instruction C compiler by ChrisSD on Thursday January 24, 2019 @03:37PM (#18992669)
On a slight tangent, I remember minimal lambda languages like Iota, Jot and Zot that I think were derived from Unlambda.
Re:Movfuscator – Single instruction C compiler by odorousrex on Thursday January 24, 2019 @02:53PM (#18992284)
Ha! This is actually pretty darn clever!

I wonder what the final binary sizes are in comparison to normal GCC compilation, as well as execution speed.

I can't believe you made a floating point emulator just for this as well! Quite impressed.

Re:Movfuscator – Single instruction C compiler by Legogris on Thursday January 24, 2019 @03:00PM (#18992350)
Considering that the floating point library is big enough to be disabled by default tells me you might run out of disk space compiling a single application.

That being said, if this can increase difficulty of sidechannel attacks and branch prediction, maybe it'd actually make sense for very isolated parts of some services.

Re:Movfuscator – Single instruction C compiler by odorousrex on Thursday January 24, 2019 @03:21PM (#18992523)
>That being said, if this can increase difficulty of sidechannel attacks and branch prediction, maybe it'd actually make sense for very isolated parts of some services.

I agree, I can see how it certain special circumstances/services this could be very useful.

However, I still expect someone to compile Quake with it by the end of the year.

Re:Movfuscator – Single instruction C compiler by simcop2387 on Thursday January 24, 2019 @03:39PM (#18992691)
They've apparently done DOOM already, and it's hours per frame. I don't want to think what Quake would be like.
Re:Movfuscator – Single instruction C compiler by acheron on Thursday January 24, 2019 @02:57PM (#18992322)
To be clear, I (the HN submitter) have nothing to do with this, I just found it and thought it was great.
Re:Movfuscator – Single instruction C compiler by kbenson on Thursday January 24, 2019 @03:02PM (#18992372)
From the example images of original and obfuscated assembly, there's seems to be about a sixfold increase in the number of instructions (for that example, at least), so I imagine you'll see a similar binary size increase.
Re:Movfuscator – Single instruction C compiler by na85 on Thursday January 24, 2019 @03:17PM (#18992496)
Why haven't Single Instruction-Set architectures taken off?

If mov is Turing Complete it seems like there'd be a big win here... You could parallelize this massively.

Edit: can someone explain why this is being down voted please, because this is a legit question

Re:Movfuscator – Single instruction C compiler by saagarjha on Thursday January 24, 2019 @03:20PM (#18992519)
They’re impractical and massively inefficient?
Re:Movfuscator – Single instruction C compiler by na85 on Thursday January 24, 2019 @03:24PM (#18992546)
Okay?

I'm asking because I don't know; can you elaborate on why that is?

Aren't most modern GPUs similar in that they're designed to just shit out triangles as fast as possible, massively parallel?

Re:Movfuscator – Single instruction C compiler by saagarjha on Thursday January 24, 2019 @03:33PM (#18992629)
Basically, you're going to try to emulate other instructions that you don't have with this one instruction, and that's not going to perform very well because now, instead of many optimized instructions, you have strings of this one instruction in its place. And I don't see any way to parallelize this: you're doing the same thing you always were, just with a bunch more code.
Re:Movfuscator – Single instruction C compiler by uasm on Thursday January 24, 2019 @03:40PM (#18992702)
> "can you elaborate on why that is?"

Might as-well suggest we use a single letter, instead of 26.

Re:Movfuscator – Single instruction C compiler by posterboy on Saturday January 26, 2019 @01:05PM (#19007465)

     .....   ..  ..
    ..   ..  .. ..
    ..   ..  ....
    ..   ..  .. ..
     .....   ..  ..
The first number is zero, right? Then the first letter of the alphabet is well its hard to show because it doesn't print. It's just an empty set, nothing, a stop bit. We actually do use only 1 bit in digital cpus, but a weird mix of analogue in broad band transmission. I wonder why cpus don't use ternary or whatever. But I wonder why asynchronous CPUs didn't take off, so don't mind me, just being bored.
Re:Movfuscator – Single instruction C compiler by Sohcahtoa82 on Thursday January 24, 2019 @04:05PM (#18992958)
.... --- .-- .- -... --- ..- - - .-- ---?
Re:Movfuscator – Single instruction C compiler by munk-a on Thursday January 24, 2019 @06:28PM (#18994098)
............... .............. .....

............. ......... ....... ........ ....................

....................... ............... ................. ...........

Re:Movfuscator – Single instruction C compiler by chongli on Thursday January 24, 2019 @03:31PM (#18992613)
No, modern GPUs run many of the same instructions as CPUs. They have branches and everything. Their main limitation is that groups of threads are bundled together (called warps) and share a program counter, so lots of branching can result in a lot of wasted work if the threads disagree on which branch to take. That, and there's a huge penalty you pay for moving data across the bus to GPU RAM.
Re:Movfuscator – Single instruction C compiler by stefs on Thursday January 24, 2019 @03:38PM (#18992677)
few problems are easily parallelizable. that said, that's not even the issue here. specialized instruction may be emulated by movs, but the speed loss could never be recouped even by massive parallelization.
Re:Movfuscator – Single instruction C compiler by posterboy on Saturday January 26, 2019 @01:12PM (#19007504)
The problem is probably the address space that movs use, instead of specialized registers with optimized pipelining. But internally, many instructions might actually come down to conditional moves. I guess that's either after the microcode is decoded, or if I guessed wrong about that, then Register Transfer Logik still pretty much sounds like it was based on, well, transfers.
Re:Movfuscator – Single instruction C compiler by CyberDildonics on Thursday January 24, 2019 @03:34PM (#18992635)
Why would it make sense to use a single instruction?

(Also no, GPUs are not the same at all)

Re:Movfuscator – Single instruction C compiler by kej on Thursday January 24, 2019 @03:36PM (#18992657)
You can perform multiplication by repeated addition, but that is a very inefficient way to multiply. It's the same thing here, where you can replace other instructions with MOV, but the replacement is much slower than the original.
Re:Movfuscator – Single instruction C compiler by shawnz on Thursday January 24, 2019 @03:32PM (#18992618)
What makes you think this would be easier to parallelize than a traditional application? Just because there is only one kind of instruction used doesn't mean they don't still have to come in the right order!
Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @03:38PM (#18992678)
What makes you think this would be easier to parallelize than a traditional application?

Exactly such an idea was proposed for parallel signal processing quite a while back, actually. Look up One Instruction Set Computer.

Re:Movfuscator – Single instruction C compiler by shawnz on Thursday January 24, 2019 @03:41PM (#18992717)
I don't see any material online indicating that programs written for one-instruction-set-computers are more parallelizable than programs written for traditional computers. In fact, here is someone claiming the opposite:

> The disadvantage of an MISC is that instructions tend to have more sequential dependencies, reducing overall instruction-level parallelism.

https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1m...

Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @03:53PM (#18992832)
Also note that the idea didn't take off.
Re:Movfuscator – Single instruction C compiler by stcredzero on Thursday January 24, 2019 @03:36PM (#18992665)
If mov is Turing Complete it seems like there'd be a big win here... You could parallelize this massively.

Actually, One Instruction Set Computers were proposed for this very application! (Also mentioned elsewhere, but is applicable in a serious way here.)

https://en.wikipedia.org/wiki/One_instruction_set_computer

Re:Movfuscator – Single instruction C compiler by garganzol on Thursday January 24, 2019 @03:02PM (#18992373)
At first look, the code produced by Movfuscator is mind boggling. But despite its perceived entanglement there exist some deobfuscators that bring the code back to Harvard (e.g. human readable) model.

TL/DR obfuscation by translating a program to "mov" instructions is susceptible to static analysis and thus fully reversible.

Re:Movfuscator – Single instruction C compiler by TimTheTinker on Thursday January 24, 2019 @10:57PM (#18995448)
> there exist some deobfuscators that bring the code back

Care to elaborate? The author of Movfuscator is very experienced and capable at reverse engineering. In one of his video talks he hits some Movfuscated code with some tools and says he doesn't know of anything that can deobfuscate it. That may have changed since then -- I'd be curious to know.

Re:Movfuscator – Single instruction C compiler by andreareina on Friday January 25, 2019 @02:54AM (#18996288)
There's the demovfuscator: https://kirschju.re/demov
Re:Movfuscator – Single instruction C compiler by TimTheTinker on Friday January 25, 2019 @10:55AM (#18999002)
Thanks! That’s really cool.