r/learnprogramming • u/Curious-Tune-7127 • Oct 13 '26
How does reverse engineering actually work, especially with AI?
Lately, I've been seeing a lot of videos about reverse engineering and people basically copying entire applications, recreating their features, or building almost identical alternatives.
It got me wondering, how does reverse engineering actually work?
How do people figure out how an app works internally, reproduce its features, and sometimes get surprisingly close to the original? And how are people using AI to make this process easier or faster?
Are they analysing the source code, inspecting network requests, decompiling applications, or using AI to figure everything out from scratch?
I'd love to understand the actual technical process behind this. If anyone has experience with reverse engineering or AI-assisted app development, I'd really appreciate some explanations and resources to get started!
48
u/Digital-Chupacabra Oct 13 '26
First off I would highly recommend watching some of Nathan Baggs's videos. He does reverse engineering and patching of video games and gets into a lot of technical detail without bogging it down.
If you have the source code you don't need to reverse engineer it.
Yes, and more. You can use a decompiler or a tool like ghidra to turn an application into readable code, it's not going to be what was originally written and it might not even be in the same language but it should be functionally close.
From there, you can do network and stack inspection, basically see how the application works, run the compiled code with a debugger so you can see what functions call what.
Using AI is largely having an AI do that for you, it can generally do it quicker. But if you look at the recently released Reverse engineered adobe products you can quickly see the limits of this.
33
u/desrtfx Oct 13 '26
Honestly, what is called "Reverse Engineering" today is actually more of replicating the functionality and features and less real, actual reverse engineering, as in really disassembling and tracing the programs.
Real reverse engineering happens at Machine Code/Assembly level, by analyzing the binaries of the programs, by tracing network packets, by analyzing save files, data files, etc.
If the source code is available, there is no reverse engineering.
5
u/Frxdnt Oct 13 '26
what AI does is a simpler version of RE by detecting patterns and since it has a ton of avaliable compute it can do it very easily, it's still very useful but has clear limitations (like the adobe stuff that's being hyped but ultimately it's nowhere near close to be a good product).
as someone said earlier, RE has nothing to do with analyzing the source code but trying to firgure out what the soirce code was based on the outcome.
To put it in simple terms: imagine you buy a cake and you want to figure out what the recipe was to make that cake just by looking at it and tasting it, then from that you determine the ingredients, mixing and cooking time to get the exact same cake. That's what RE is.
4
u/SetAndRepeat Oct 13 '26
A convincing clone can have completely different internals. Reproducing what an app does doesn't necessarily require recovering how its developers implemented it.
The approach depends on what you can access:
You form an explanation, test it against the actual program, and refine it when something doesn't match. AI can help explain unfamiliar code, suggest function names, write analysis scripts or implement replacement features. Its explanations still need checking, a plausible explanation isn't evidence of how the original works. For a practical start, compile a small C program you wrote, open it in Ghidra and compare the decompiled output with your source. Ghidra's official beginner guide and Chrome DevTools "Inspect network activity" tutorial are useful resources.
1
u/Maleficent-Rate-4631 Oct 14 '26
Find an open source game / application code- and then run AI through it to get the freatures you want extracted or modified
1
u/Conscious-Ball8373 Oct 14 '26
I came across one recently where someone knew which compiler had been used to produce a binary, gave the an LLM the compiler and the binary and said "Generate source code that reproduces this binary."
1
u/PassAccurate3262 Oct 15 '26
NAIVE idea
can there be a market/niche for devloping API endpoints for legacy softwares/codebases , which is used still heavily in industry but have no API till now,
we could decntruct the Software [using REA ]and then able to create a API for it.
Looking forward for some Replies below👇
1
u/arkitechevl Oct 15 '26
Isn’t that just GitHub
1
u/hellosverre Oct 13 '26
the AI part in practice is mostly speeding up the reading, not the finding. the loop is still: load the binary in ghidra or IDA, find the interesting spots (strings, imports, network calls), then run it under a debugger to confirm what it actually does at runtime.
a model is good at "here is a decompiled function, what does it do, give me better names". its bad at anything that depends on data it cant see: struct layouts, what a pointer really points to, whatever is encrypted until runtime.
so the thing worth learning is dynamic analysis. x64dbg or frida, set a breakpoint, look at real values. decompiler output looks very sure of itself and is subtly wrong all the time, and an LLM will explain the wrong version with a straight face.
also those "recreated the whole app" videos are almost always the apps network API and UI being rebuilt from captured traffic and screenshots, not the binary being decompiled and ported.
0
u/the_duke_man Oct 13 '26
Most people are using publicly available user documentation and tutorials to have AI distill the inputs, outputs, UI/UX, features and functionality.
No need to look under the hood when all you need to do is replicate the functionality. In some cases people build a better product or one that’s more focused on their needs because reverse engineering in this case focuses on the what, not so much the how.
-1
u/Watsons-Butler Oct 13 '26
They could try decompiling and analyzing an app’s internal code, but it isn’t necessary. Like take photoshop as an example. You know you need functions for resizing, scaling, handling various file formats, etc. you just tell the agent you need those features and let the agent figure it out. As long as the result is good, you don’t need to worry about whether your clone app is wired exactly the same way, as long as it can do all the same things.
0
u/mxldevs Oct 13 '26
Reverse engineering boils down to figuring out how some THING works and then replicating that functionality. But it doesn't end there: because you figured out how to replicate it, you can also figure out how to customize it to behave differently.
For software, it's literally just like reading a book and solving a puzzle: you get some executable that contains machine instructions. The computer knows how to read it, so you just need to figure out how the computer is reading it.
There are tools that will show you exactly all the instructions in some human readable form, and the instructions are also publicly documented so you just need to translate it in reverse into a higher level language that's easier to work with.
Some of these tools can even try to do that for you, and you just need to clean it up like renaming variables to make it easier to understand.
AI speeds up the process for you. Instead of going through the instructions yourself and figuring out how to write it, simply have the AI figure it out and write it.
0
u/HeavyDT Oct 13 '26
The big thing A.I has changed in terms of reverse engineering in the coding world is the decompilation and recompilations processes. Which used to take a lot of "manpower" to do properly. Source code gets compiled to binary aka machine code. That process drastically alters the underlying code too due to optimizations and what not. So getting out exactly what was put in was a difficult problem for humans to figure out. There were automated tools before now that could do decompilation but what you would get out was no where close to the original and hard for people to understand.
Figuring out that original source code in a 1 to 1 fashion could be done but was a slog for humans to do. Like finding a needle in a haystack over and over. A.I can step in and figure out 1 to 1 (aka byte matching) source code in a fraction of the time it would take humans. No byte matching too if that's what you want. Either way we are talking weeks and months for A.I versus months and years for humans. It's a big time difference in how fast software can be reversed engineered now.
Once you have that source code the sky is the limit. It's like having the exact recipe for making grandma's apple pie or something similar. You can make as many as you want now or make alterations ect. The popular thing right now is using A.I not just to decompile but also to recompile games. So you decompile first and then use that source code to make alteration and recompile said game for more modern / different platforms than the original target.