POV-Ray : Newsgroups : povray.off-topic : How to read source code? : Re: How to read source code? Server Time
29 Jul 2024 02:29:38 EDT (-0400)
  Re: How to read source code?  
From: Patrick Elliott
Date: 6 Feb 2013 22:40:37
Message: <51132235$1@news.povray.org>
On 2/6/2013 4:19 PM, Kenneth wrote:
> Off-off-topic: While I was doing my research into this stuff, I read about 'hex
> editors.' Apparently they can open an executable (.exe) file for editing?? (Not
> in a higher-level language, of course.)
>
Well, yeah, and no. Its not going to be "readable" in any real sense. 
Way back, like the 80s, you could find some "decompilers". The concept 
meant one of two things. Some fairly good ones could "guess" at whether 
your program, based on clearly known factors, like how branching was 
done in certain compilers, and internal naming conventions (if you 
looked at an EXE in an hex editor, or even something else that could 
read it in well enough, you would find a mess of words, names, etc. in 
many of them, that you where using say Borland C, and then "rebuild" the 
source code, minus the original names for variables, and such. In many 
cases, a final compile, with all the "debug" data removed is/was never 
done, so "some" labels, variable, etc. might still be in those things, 
even in modern applications.

This is especially true with certain dlls, since they expose "entry 
points", which, in principle, you can look up by asking the dll, and 
some applications include entry points as well. Explorer, for example, 
functions both as a "stand alone", as part of the OS, and as something 
you can "attach" to your own program, ask for entry points, and then use 
those to talk to its own code, when loaded.

Less sophisticated ones, and even DOS' own little machine language 
utility could "sort of" do this, for very small programs, would just 
generate a machine code version, with what ever data you could get out 
of it.

I am sure there is, out there some place, applications that could pick 
apart an EXE and come up with something "close" to the original, 
possibly even in the same language it came from. But.. there are obvious 
legal issues with such tools, so finding one, at all, never mind a 
really good one, might be really hard today.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.