alt.hn

1/17/2025 at 7:36:37 PM

Show HN: Compile C to Not Gates

https://github.com/tomhea/c2fj

by tomhee

1/17/2025 at 8:14:08 PM

Reminds me of movfuscator [1]. This can compile programs to movs and only movs.

[1] https://github.com/Battelle/movfuscator

by bangaladore

1/17/2025 at 9:57:53 PM

Battelle is great. They also created some software called Cantor Dust [1] that turns files into images to allow humans to easily spot obfuscated data or files.

The sad thing about this kind of work, because I love it, is that to get paid to do it you need clearances and polygraphs and periodic reinvestigations/continuous monitoring and all sorts of things that I find unpleasant.

[1] https://github.com/Battelle/cantordust

by LPisGood

1/17/2025 at 11:12:42 PM

I'm not sure what you mean but I was a security researcher for a large company for a bit and required none of that. I was required to work airgapped at home, however.

by mmastrac

1/17/2025 at 11:14:52 PM

Really? You were doing offensive security work not for a government (/contractor)? What sorts companies, aside from some enterprise pen testers, employ these roles?

by LPisGood

1/17/2025 at 11:20:34 PM

Email is in my profile -- happy to clarify/share some very rough details if you'd like.

by mmastrac

1/17/2025 at 11:51:09 PM

Agreed that is a fine piece of work. But the author is Chris Domas. Which is plain from the repo readme, but it’d be clearer to link to his repo.

by beng-nl

1/17/2025 at 8:51:39 PM

Am I right in deducing that this language gets its power from self-modifying code? I.e. flipping bits within addresses of the opcodes of the running program?

by tromp

1/17/2025 at 9:08:46 PM

You are indeed right

by tomhee

1/17/2025 at 9:18:32 PM

I would have expected the language documentation to focus more on this observation and to explain for instance how self modification is used to implement while loops. But I don't even see the term mentioned anywhere?!

by tromp

1/17/2025 at 11:57:14 PM

Looking forward to the poor security researcher who gets to reverse engineer some malware sample they compiles this into for obfuscation... Its going to be an interesting blog post.

by tonetegeatinst

1/17/2025 at 8:12:10 PM

There is also a brainfuck to flipjump compiler: https://github.com/tomhea/bf2fj

by tomhee

1/17/2025 at 10:03:59 PM

Ah, the convenience of brainfuck with the performance of flipjump. Excellent.

by david-gpu

1/17/2025 at 10:08:51 PM

I wonder if someone has already made a Reverse Engineering CTF challenge for this concept.

by jkrshnmenon

1/17/2025 at 11:54:54 PM

I read it as reverse engineering WTF challenge... cool stuff though, seriously.

by og2023

1/17/2025 at 10:23:17 PM

Ah interesting.. wonder if you can model this with a recursively expanded algebraic expression. I've been thinking lately along similar lines about polynomials that encode pushdown automata, so this is cool to see.

by pizza

1/17/2025 at 10:27:37 PM

If you have an answer I'd be happy to hear it!

by tomhee

1/17/2025 at 9:22:04 PM

Maxim (now owned by Analog) actually manufactures a single-instruction processor series, called MAXQ. It uses a single move instruction, with a flag for literals, and a transport triggered architecture.

by dlcarrier

1/17/2025 at 9:17:01 PM

By the way, as a challenge, try how you can program an "If" statement in Flipjump.

by tomhee

1/17/2025 at 8:48:54 PM

How is a jump realized by Not Gates?

by platz

1/17/2025 at 9:15:29 PM

I dont think that the jump can be realized by NOT gates, but it's essentially "where to find the next NOT command". The jump is indeed a crucial part of the language, as it allows going back, and especially to make self-modifying code.

by tomhee

1/17/2025 at 9:14:56 PM

I'm guessing by not jumping into a terminating/ halting NOOP.

The logic is within the branching.

by Jerrrry

1/17/2025 at 10:01:23 PM

AND, OR, NOT - pick 2

by jumploops

1/17/2025 at 10:22:00 PM

NOR - pick 1

by sroussey

1/17/2025 at 9:32:31 PM

Id appreciate more explanations from the power of combined bitflip & goto

by artemonster

1/17/2025 at 7:57:18 PM

Looks like we banned you and this domain because of the egregious vote manipulation and bogus comments at https://news.ycombinator.com/item?id=34856792.

That was a long time ago, though, and the project is interesting enough, so I'm going to assume you've learned your lesson and unban you. Please stop using multiple accounts for this though!

by dang

1/17/2025 at 8:10:57 PM

Thanks man, I appreciate it.

by tomhee

1/17/2025 at 8:09:28 PM

Dang, I have to know what triggered you to say this. It’s not the same user account so you would have had to have recognized the URL and written based on that.

Do you keep notes on each astroturfed submission and auto-trigger reposts to notify yourself? Or did you just happen to recognize this? 20 minutes from his post to your comment is absurdly good moderation.

by jimbob45

1/17/2025 at 8:24:24 PM

https://news.ycombinator.com/item?id=42742462 was on the front page. We got an email suggesting that the URL should be https://github.com/tomhea/c2fj instead of https://github.com/tomhea/flip-jump. That made sense, except it turned out that github.com/tomhea was banned. That seemed odd because we don't normally ban github domains, so I looked at the history https://news.ycombinator.com/from?site=github.com%2Ftomhea (most of which will only be visible to users who have 'showdead' set to 'yes' in their profile), and it was pretty easy to see that https://news.ycombinator.com/item?id=34856792 was, let's call it, the original sin in this chain of woe. It was also pretty obvious that the other submitting accounts were all related. Since the project itself is interesting I figured the best thing to do was give the submitter a second chance, so I picked the earlier post from today (the OP) and swapped it out for the other one (42742462).

I hope that answers your question!

by dang

1/17/2025 at 10:01:18 PM

You sir, are amazing. Thank you for being so utterly transparent.

by doormatt

1/17/2025 at 8:15:16 PM

[dead]

by chicken_grease

1/17/2025 at 10:50:12 PM

[dead]

by jpcookie