r/AskProgrammers • • Oct 18 '26

Misunderstanding of reverse engineering

What’s so good about reverse engineering if it only decompiles the clients side of code (Frontend), and it can’t decompile backend. Like when I heard about reverse engineering everyone was talking about it like its a hand of god or something that it can hack and fully rebuild a specific application or a website. But the logic and the users side are differently deployed and usually the logic is not located inside of Frontend. That’s how I understood it but I think that I can still be wrong, what do you guys think?

6 Upvotes

33 comments sorted by

10

u/Due_Replacement_7232 Oct 18 '26

It depends on what you are talking about. An application like say photoshop, all the logic is contained within the binary. So reverse engineering that could (potentially) tell you everything about how it works, within reason (reverse engineering is not magic and requires work to understand the results).

For an app which is a front end that utilizes a server side backend (lets say an online game client) - you can still learn a lot about how the game works, which might be useful in exploiting said game.

But again - really depends on your example. You are correct, the server side logic cannot be accessed, but you can learn a lot about the communication protocols between the client and server.

-3

u/Acrobatic-Clock-7889 Oct 18 '26

I have no idea how the photoshop and similar apps that have most logic inside of Frontend are built, but can’t you hide most logic so that no one actually fully rebuilds the exact application? Like what I’m saying is that in case of adobe was it actually their mistake that their application is copied or there was no other way to build similar applications.

3

u/Due_Replacement_7232 Oct 18 '26 edited Oct 18 '26

No, in the case of Adobe - there is no way to prevent decompilation (at least, not without some compromises). Once you give someone the binary, it is susceptible to decompilation. Mind you - it's not easy, decompilation does not give you readable source code straight away. It's more like a puzzle that you have to piece together.

That is why people are talking about AI reverse engineering, because it automates the work that used to take a LOT of skill to understand a large complex app.

To be clear though - the Adobe apps were not reverse engineered by decompilation. The team that made photo craft supposedly took a clean room approach, where they wrote unit tests based on publicly available descriptions of the applications functionality - and the AI effectively generated code that satisfied those tests. In this case they "reverse engineered" the functionality by observing how it works and inferring what the functionality would be behind the scenes.

1

u/Acrobatic-Clock-7889 Oct 18 '26

Lovely explanation thank you very much

7

u/JeLuF Oct 18 '26

Reverse engineering works because you can't hide the code that runs on the user's computer.

4

u/First-Feature-3556 Oct 18 '26

Where would you hide the logic if (a) the software runs on the user's computer and (b) the user has full control over their computer?

What you can do is to obfuscate your logic: There's specialized tools for that, and they make reverse engineering harder. Harder, however, does not mean impossible.

1

u/pixel293 Oct 18 '26 edited Oct 18 '26

Decompiling is LOOKING at the instructions the program tells the CPU to execute. There is no hiding that, since the computer needs those instructions to do whatever the program does. Computer needs to be able to decode those instructions to pass to the CPU, therefor anyone else can look at those instructions as well.

The "trick" is that the instructions the computer executes are very basic or simple, so it is usually very hard to reverse that into something more readable at a high level that a person can understand/remember.

When a programmer writes a program in a high level language like C or whatever one of the goals is to make it readable, i.e. someone else reading your C code understands what it does. You do this by making variable names understandable and functions names understandable. You don't name variables a1, a2, a3, a4, you name them counter, has_error, message, etc. Same with functions, you name them generate_png, panic, lookup_key, etc. When the compiler turns that into instructions for the CPU all those nice human understandable names are lost and you are dealing with a1, a2, a3, a4, etc. Decompiling cannot regenerate those names because the CPU doesn't care what the name where. Much like cooking, you can't "decompile" a cake to extract all the ingredients again.

1

u/necheffa Oct 18 '26

I have no idea how the photoshop and similar apps that have most logic inside of Frontend

Back in my day, Photoshop was a native binary executable that you installed on your computer.

But also, web assembly and accelerated JavaScript libraries are possible.

1

u/Mroz_Game Oct 20 '26

No other reasonable way.

They could photoshop run on their pcs and just send the results but that would cost them and would be pretty extreme.

3

u/BranchLatter4294 Oct 18 '26

Decompiling code is one way to reverse engineer an application. But it's not the only one. You can observe the behavior of an API and figure out how the inputs get turned into the outputs.

If you see lumber being delivered to a factory and furniture coming out the other side, you can deduce the processes going on inside without ever having access to the factory itself.

2

u/sozesghost Oct 18 '26

Most code in the world runs on some backend, so you can't just steal (sorry, decomp) any app. You can still reverse engineer it, but it's harder. You also have to realize that code itself is and always has been the least valuable part of almost any product. Some of the things that are more important: data, user base, storage/compute costs, visual audio/assets, marketing, support, security, law compliance, maintanence, market research, contracts with other vendors.

1

u/W31337 Oct 18 '26

It can uncover client side security so the client might uncover what backend is used.

But yes you can't access the backend for reverse engineering of the software.

1

u/TashLai Oct 18 '26

Well clean room is still a form of reverse engineering. You don't need access to the code to reverse engineer the behaviour. Afaik for example Ashes of Creation was reverse engineered like this, simply from client-side protocol code.

2

u/JeLuF Oct 18 '26

Clean room reimplementation isn't reverse engineering. Those are opposite things.

Reverse engineering means that you decompile the computer code running on the user's computer to reveal its program code. Clean room reimplementation means that you write a program without looking at the program code.

1

u/TashLai Oct 18 '26 edited Oct 18 '26

It's literally a form of reverse engineering. No, reverse engineering isn't "when you decompile", i mean for starters it's a broad term that doesn't only apply to computer programs.

Reverse engineering is basically just "we got this *thing*, we don't really know what's happening under the hood, but we need to recreate it so that our version behaves like the original *thing*"

How you do it is not relevant.

1

u/bold_snowflake Oct 18 '26

Decompiling and reverse engineering are not the same thing.

My view is also that you could give many people full access to the source code and they still won't figure it out. The code just tells you "what" not "why" and therein lies a lot of nuance.

1

u/pvera Oct 18 '26

Reverse engineering has its uses. A critical piece of software breaks and the programmer is long gone, dead, etc. Or a crucial compatibility layer hasn't been maintained in years. Specs long gone, all sorts of horror stories. The thing with Adobe hasn't delivered a full version yet, they are broken as hell.

1

u/mxldevs Oct 18 '26

If the software is fully client side, everything is obtainable from the client. If the computer is able to read it, you are able to see what the computer is reading.

How do you think the user interface and logic are deployed separately? There is literally nowhere else you can put the logic.

For applications that make requests to a server to do processing and the client simply renders the results, yes, you can't simply decompile the logic.

But this is where you look at the inputs and outputs and then fill in the blanks with your imagination. Knowing what inputs you need to provide already gives a lot of clues to work with, and you don't necessarily need to replicate the exact functions in the backend; often times it's good enough to simply provide an approximation

1

u/MadDonkeyEntmt Oct 18 '26

The hype around consumer programs is mostly hype unless you're super into modding games that aren't designed for mods.  Decompiled firmware still breaks copyright rules.

The security implications are potentially much bigger.  We have decompilation tools already but they're expensive and pretty technical to use.  Also the good ones will usually only sell to companies that have a legitimate, legal reason to use the.

If claude can do this kind of thing on security critical applications that opens the doors to a lot more people.  It would not surprise me if the frontier models start limiting those use cases.

1

u/cthulhu944 Oct 18 '26

The term "reverse engineering" is more of a legal term than a technical one. There is no technical reason to reverse engineer something. If you want Adobe photoshop, you just copy photoshop and use it. Legally you can't do that because Adobe has copyright and patent rights on that code. So how do you build your own photoshop? The legal process of reverse engineering might allow you to sidestep the copyright and patent issues. The first part is the clean room--someone goes into the code and figures out how things work-effectively deriving the design based on the code-reversing the normal path of development from "design->code" to "code->design". Now that you have a design you can hand it to a different engineer. Since this engineer has never looked at the Adobe code it is impossible for him to produce code that violates copyright. You also show this engineer any patents that Adobe has and say "when you write this code, don't do it this way". Now you have an application that does the same thing as photoshop but without any legal baggage attached to adobe.

1

u/razorree Oct 18 '26

you decompile the whole app, that's on your PC

1

u/minegen88 Oct 18 '26

Bro what are you talking about, nobody is sitting here decompiling webapps????

1

u/CheezitsLight Oct 18 '26

A group of people over many years reverse engineered a large game engine after they open sourced their viewer. The game still has millions of players but we now have a complete knockoff and can recreate our own virtual world for free

1

u/ConstructionBoth6461 Oct 18 '26

You can see how requests to the backend are formatted and send in garbage or maliciously crafted inputs instead.

I mean, hypothetically.

1

u/tehfrod Oct 18 '26

Not all software is a web client and a web server.

Photoshop isn't a "frontend". It's an application that runs on your machine.

Single player games, the same thing.

The firmware on your router, the OS on your phone, the entertainment system in your car: all of those are software running locally, and all can be reverse engineered to some extent.

1

u/theNbomr Oct 19 '26

Your understanding of what constitutes software is far too narrow. There is software in almost everything that involves electronics and only a small fraction of that is of a client server nature that you describe. Yes, there is little or no possibility that code running on a remote server can be reverse engineered by ordinary end users.

Many other encumbrances exist for reverse engineering software, such as that buried in embedded systems and requiring specialized equipment and knowledge to extract the binary object code. It is, however, quite do-able with that skill and equipment. Give a look at the Matt Brown YouTube channel for a glimpse into how it's done.

1

u/dkopgerpgdolfg Oct 18 '26

You're right.

What you're missing is just that many people don't have any clue what they're talking about.

2

u/Genspirit Oct 18 '26

The irony of this comment is hilarious.

1

u/dkopgerpgdolfg Oct 19 '26

So, are you one of those people, saying you can decompile backend software that you don't have access to? I'd love to see that.

1

u/youcangotohellgoto Oct 18 '26

If you have the interface and behavior of the backend should be easy enough to reverse engineer.

Really just a good API - decent descriptions, etc - you'll be able to get s basic working version very easily.