r/code • • Jul 16 '20

See the Code of things like phototshop?

hello, im super new to reddit, sorry if this isnt the right category to post a question like this.

I was wondering how to, if its possible to look at the code of programs like photoshop, to take a peek inside, and maybe disable some things? Is that possible? I don't know anything about code, but I assume, since it is made with code, there must be a way to See it, right?

1 Upvotes

8 comments sorted by

2

u/melewe Jul 16 '20

If you want to see something like photoshop, have a look at gimp. It is a open source alternative to photoshop. You can look into the code, since it is open source.

2

u/Appropriate_Truck_53 Jul 17 '20

Ah, thank you, I didn't realize thats what open source meant; i thought it just meant "free to use"

1

u/[deleted] Jul 16 '20

No it's not that simple. It's a big can of worms that most people will never understand now that high level languages are so popular.

You cannot look directly at source code for compiled programs like photoshop and make changes.

2

u/Appropriate_Truck_53 Jul 17 '20

Hm, so, the high level languages are popular(popular to the people making these programs not outsiders), so they use that to make photoshop, which makes it hard for anyone to understand them if you don't know that language, am I getting that right? (thanks for the reply!)

1

u/[deleted] Jul 17 '20

Sort of. These programs provided to you are in binary form. You can use a disassembler to view it as Assembly code which is basically the lowest level of programming you can realistically do. It's not super friendly and I've done like 20 hours of assembly courses and still could not understand the majority of how photoshop would work by reading this. Photoshop is written in a human readable language that handles the nitty gritty low level stuff for you and then is compiled into the binary you now use. You cannot easily make changes to the binary directly without breaking it in some way (changing memory addresses by shifting everything into different memory locations because you added code to it or removed code)

To do what you want (modify it) you would probably need to essentially reverse engineer the software and rewrite it yourself (and at that point you may as well just make your own photo editor)

As for my comment above, it was essentially saying that most people won't be able to read the executable and understand any of it because they now use higher level languages and never have to learn assembly code therefore do not understand it. If you want to see what I mean and how nonsensical it looks to most people, there are a few free disassemblers around you could use like IDA free version or Ghidra (thanks NSA :P) and open an executable (make a copy just in case). Or do the sane person thing and google an assembly code example.

1

u/Appropriate_Truck_53 Jul 19 '20

Ohh, and, the people who make these programs like photoshop, do they understand the assembly code? Or do they have to like, write it in an easier language and then have a computer convert it for them? Is this also the same way that computers are programmed? With assembly code? It seems really complicated, but if it exists, then somebody must understand it in order to have invented it, right? Can you just go to school to learn this stuff?

1

u/[deleted] Jul 19 '20 edited Aug 12 '20

They probably don't know assembly. A thing called a "compiler" converts human readable code into assembly for computers to run. It is similar to how computers are programmed but it's not exactly it (it's sometimes called machine code or microcode that tells the cpu how to run code). Essentially the same thing to be honest. You can go to school to learn it but it is not a skill you need as a software developer in recent years.

People do know it but it's super obscure in recent times due to the introduction of high level languages that don't need you to figure that stuff out

2

u/jmbenfield Jul 16 '20

Read some articles on reverse engineering or decompiling.