Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Just a coding question...  (Read 1632 times)

G-Flex

  • Bay Watcher
    • View Profile
Re: Just a coding question...
« Reply #15 on: October 19, 2011, 03:26:46 am »

Define "doable". Code compilation is not a reversible process, especially with a language that compiles straight to machine code like C++.

The best a decompiler can do is try to come up with a set of source code that compiles to the same machine code; it cannot come up with the actual original source, as that no longer exists and doesn't have a 1:1 correspondence with the compiled instructions. That's assuming it works perfectly! Plus, odds are any symbolic information is gone, so functions and variables won't have meaningful names.

It might help reverse-engineering, but it's really not what it sounds like.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Kogut

  • Bay Watcher
  • Next account: Bulwersator
    • View Profile
Re: Just a coding question...
« Reply #16 on: October 19, 2011, 03:51:46 am »

Yes, reverse engineering requires enormous time and knowledge, I know that is not magic box that will produce commented code :D. In case of DF it may be easier and better to steal ideas instead of code.

And it is possible to fix bugs in DF (crystal bug patch).
Logged
The worst bug - 34.11 poll
Tired of going decades without goblin sieges? Try The Fortress Defense Mod
Kogut, the Bugfixes apostle of Bay12forum. Every posts he makes he preaches about the evil of Bugs.

G-Flex

  • Bay Watcher
    • View Profile
Re: Just a coding question...
« Reply #17 on: October 19, 2011, 04:05:17 am »

Yes, reverse engineering requires enormous time and knowledge, I know that is not magic box that will produce commented code :D.

My point isn't that it won't provide the commented code, more that it won't provide the original code at all or anything that looks like it, at least not necessarily.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Just a coding question...
« Reply #18 on: October 19, 2011, 08:39:26 am »

Yes, reverse engineering requires enormous time and knowledge, I know that is not magic box that will produce commented code :D.

My point isn't that it won't provide the commented code, more that it won't provide the original code at all or anything that looks like it, at least not necessarily.

True enough.  A lot of things are heavily optimized by the compiler such that you are quite unlikely to get something like the original code.  You might lose exception catching in cases where there's no way an exception could be thrown for instance.  Who knows if it would decompile classes back to anything resembling their original structure (I suspect that this is at least possible...).  A decompiler probably wouldn't be able to split it back into meaningful compilation units either, except maybe for class files.

Of course, as you said without debugging symbols it's not going to know variable or function names, so it would be a lot of fun to go through and figure out what int aa345 means in the 29 places it shows up.  And I'm guessing DF has a pretty huge code base by this point...

As far as it being illegal, I think that's still a bit of a gray area but I don't think it is strictly illegal.  The Wine project at least shows that generating functionally identical code isn't illegal, as long as you don't steal the original code, and since a decompiler won't give you the original code it probably would be fine.

Still a hopeless cause though.  Decompiling DF might make it easier to guess how some things work internally, but that would probably be about it.
Logged
Through pain, I find wisdom.

Tharwen

  • Bay Watcher
    • View Profile
Re: Just a coding question...
« Reply #19 on: October 19, 2011, 02:43:59 pm »

Yes, reverse engineering requires enormous time and knowledge, I know that is not magic box that will produce commented code :D.

My point isn't that it won't provide the commented code, more that it won't provide the original code at all or anything that looks like it, at least not necessarily.

This is why Java is the best!

Hmm... wait. No it isn't.
Logged
[Signature]
Pages: 1 [2]