r/learnprogramming • • 2d ago

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!

84 Upvotes

21 comments sorted by

View all comments

2

u/SetAndRepeat 1d ago

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: * Web apps: inspect the page, delivered JavaScript and network requests. DevTools shows what gets sent to an API and what comes back, but that doesn't expose the server's source code. * Compiled native apps: tools like Ghidra disassemble machine code and produce a C-like representation. That helps reconstruct the logic but won't restore the exact original source. * Runtime analysis: use a debugger to inspect memory, follow execution and check what happens with different inputs

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.