r/C_Programming • • 27d ago

Project i started building a dynamic binary optimizer in C11, looking for contributors

hey everyone,

i recently started a project called recode, an experimental dynamic binary optimizer for linux x86-64. figured i'd share it here in case anyone interested in low-level C, x86 internals, or JIT compilation wants to take a look.

right now it works with a very restricted subset of x86-64 instructions and functions following the System V AMD64 ABI ("uint64_t f(uint64_t)").

it decodes machine code, builds a small intermediate representation, simplifies arithmetic where possible, and emits new native instructions into memory that's switched from writable to executable before running.

for example, something like:

"mov rax, rdi; add rax, 7; sub rax, 2; nop; ret"

can be reduced to:

"mov rax, rdi; add rax, 5; ret"

the actual emitted code also includes an ENDBR64 entry marker.

it's still early and intentionally limited. there's no ELF loading, general branching, memory operand support, or syscall instruction handling. only return-value equivalence is guaranteed by the current contract, not flags or full CPU state. it's also not a sandbox.

i've documented the implementation, supported instruction encodings, build instructions, tests, and benchmarks in the repo.

looking for contributors:

i'd like to expand the supported instruction set and improve the optimizer over time. if you're comfortable with x86 instruction encoding, the System V AMD64 ABI, code generation, or executable memory management, i'd be interested in having you contribute.

code reviews, bug reports, and technical feedback are welcome too.

there's also an "AGENTS.md" and contribution guidelines. AI tools are fine, but contributors need to understand and take responsibility for every line they submit. i'd rather have a small, correct patch than a large one nobody can explain.

repo: https://github.com/aasul/Recode

3 Upvotes

18 comments sorted by

•

u/AutoModerator 27d ago

Hi /u/cobweb6542,

Your submission in r/C_Programming was filtered because it links to a git project.

You must edit the submission or respond to this comment with an explanation about how AI was involved in the creation of your project.

While AI-generated code is not disallowed, low-effort "slop" projects may be removed and it's likely that other users push back strongly on substantially AI-generated projects.

You can read more at How do I post my Project?


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

→ More replies (1)

8

u/Obliviousnut_ 24d ago

Hoły AI, what is happening in 90% of these files?? No commenting / readability, no flow, inconsistent function usage.
I’d suggest writing this yourself, you’ll learn something and can be proud of yourself.
Good luck

1

u/bullno1 24d ago

If anything, AI would over comment

-8

u/cobweb6542 24d ago

It's all reviewed, and I don't comment on it generally. Second, it's a code dump I started working on before; third, I have contributions to the PHP programming language, so there's not much left for me to learn

1

u/InternalCommercial44 21d ago

Weird flex bro ….

1

u/Low_Lawyer_5684 25d ago

Interesting project. I'll defenitely take a look. My current research area is binary code generation and transformation (attempting to create a code morpher, which changes the code without changing its logic. code interleaver, which interleaves instructions of two separate functions creating a single code flow and so on)

6

u/Low_Lawyer_5684 25d ago

Oh my.. It is an LLM-generated.. Pretty hard to find a human for this kind of code.

-8

u/cobweb6542 25d ago

AI-assisted, yes; vibe-coded, no. It used to help me code, and I verified all its work; plus, I have more important things to do. This is just for fun.

2

u/Low_Lawyer_5684 24d ago

" and I verified all its work;" Oh really? 15 MB of source code? You are pro then!

1

u/cobweb6542 24d ago

I didn't verify all of it at once; I verify it in small patches through its work.

1

u/Low_Lawyer_5684 24d ago

"I have more important things to do" is the classic answer; dead project which will be abandoned soon. Unfortunately. LLM coding requires low effort, and, as a result the value of code is neglible to the author. So interest is lost quickly.

1

u/cobweb6542 24d ago

I agree, but I do have more important things to do, and this is just a fun project I don't expect people to pay for it or devote their entire lives to contributing.

-4

u/cobweb6542 24d ago

I agree readability is an issue, and I'm working on it. Still, I believe problems like these should be presented as constructive criticism instead of dismissing the whole project as "AI Slop". Completely hating any use of AI is acceptable, and I don't say otherwise. Another thing, I don't expect anyone to actually contribute; this is a fun project on the side, which I don't put my full-day attention on. I was a bit hostile to an earlier reply, "Holy Ai...", which I probably shouldn't have been, so give me criticism if you want, but make it constructive so we grow as a human society.

2

u/Low_Lawyer_5684 24d ago edited 24d ago

No we do not blindly hate. I just said that LLM-generated code will not attract any human developers. Unless they are vibe coders. You are looking for contributors and at the same time you say that you need a fre time to do your other things. As with every LLM project - easy come easy go. Low effort - easier to abandon your own work. My guess is that your project will be abandoned in couple of months. Because it cost you nothing (mentally).

1

u/cobweb6542 24d ago

Don't contribute if you don't want to; I'm saying that if you want to contribute, the doors are open. I wanted to show something I've been building, and I got a ton of hate because I used AI to help with coding. It really can't be that deep to spend your mental energy hating on some random guy on the internet, and I did put mental energy into this because I did code on this project. I'm not another brain-dead vibecoder.

1

u/Low_Lawyer_5684 24d ago

I am sorry if my words sounds like hate speach.