For compiled programs, how hard is it to reverse engineer and de-compile it into it's source code (ie: HL2 Beta)

JEDI

Lifer
Sep 25, 2001
29,391
2,738
126
first 1/3 of the HL2 source code is leaked.

next, a full compiled version of HL2 pre-Beta is leaked.

how hard is it to get the source code from a compiled version? and if it is hard, WHY?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
You can get assembly code.

You lose all the stuff that makes the code readable like variable names and comments.
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
Originally posted by: JEDI
first 1/3 of the HL2 source code is leaked.

next, a full compiled version of HL2 pre-Beta is leaked.

how hard is it to get the source code from a compiled version? and if it is hard, WHY?

Depends on the programming language. If it's c/c++ (almost all games are written in c++) and it's a not a debug version - it's virtually impossible. It might be slightly easier for java/c#.
 

NuclearFusi0n

Diamond Member
Jul 2, 2001
7,028
0
0
Incredibly hard to get useful code unless you are a truely gifted programmer. You would have better things to do than hack on games though.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
tools exist to get back to c/c++ code, but you lose comments and sensible variable names so understanding the resulting code is a lot more work.

instead of

// ship speed add thrusters
velocity += accel ;
// time for more shields
shields += regen_factor ;

you get

V0120 += V0138 ;
V0087 += V0242;

which over hundreds of thousands of lines can be pretty hard to unravel.

> Incredibly hard to get useful code unless you are a truely gifted programmer. You would have better things to do than hack on games though.

That too. The people writing cheats are the losers without the creativity or talent to do something useful with their lives.
 

alkemyst

No Lifer
Feb 13, 2001
83,769
19
81
to copy the program would be a lot easier than reverse engineering it....you know what it does basically....find an engine and go with it.

Now the comment about cheat writers??? WTF did that mean....some cheat apps are pretty elaborate and some are just commandline based, either way they aren't requirements to use.

It's a game the player should enjoy it, if that means being able to cast "Lightning Lvl. 1,000,000 Your body explodes into a fine bloody mist." their first time playing the game or have a BFG900000000 with unlimted ammo....
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: Argo
Originally posted by: JEDI
first 1/3 of the HL2 source code is leaked.

next, a full compiled version of HL2 pre-Beta is leaked.

how hard is it to get the source code from a compiled version? and if it is hard, WHY?

Depends on the programming language. If it's c/c++ (almost all games are written in c++) and it's a not a debug version - it's virtually impossible. It might be slightly easier for java/c#.
With standard java and c# or vb.net code, it's super easy because they are interpreted instead of native compiled. There are tons of tools. MS even includes a tool with dotnet called ILDASM. It stands for Intermediate Language Disassembler.
But there are also tools to obfuscate your compiled code and make it much more difficult to get anything readable or useful back.

 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Originally posted by: alkemyst
Now the comment about cheat writers??? WTF did that mean....some cheat apps are pretty elaborate and some are just commandline based, either way they aren't requirements to use.

It's a game the player should enjoy it, if that means being able to cast "Lightning Lvl. 1,000,000 Your body explodes into a fine bloody mist." their first time playing the game or have a BFG900000000 with unlimted ammo....
Fine if you're playing with yourself, using built-in cheat codes or something like a character editor in an RPG.

Not fine if you're hacking for multiplayer to see through walls, use an aimbot, get extra damage resistence, etc. to ruin the game for everyone else who is playing honestly.

 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: Shanti
Originally posted by: Argo
Originally posted by: JEDI
first 1/3 of the HL2 source code is leaked.

next, a full compiled version of HL2 pre-Beta is leaked.

how hard is it to get the source code from a compiled version? and if it is hard, WHY?

Depends on the programming language. If it's c/c++ (almost all games are written in c++) and it's a not a debug version - it's virtually impossible. It might be slightly easier for java/c#.
With standard java and c# or vb.net code, it's super easy because they are interpreted instead of native compiled. There are tons of tools. MS even includes a tool with dotnet called ILDASM. It stands for Intermediate Language Disassembler.
But there are also tools to obfuscate your compiled code and make it much more difficult to get anything readable or useful back.

Don't say interpreted :) They're compiled, just to an intermediate language; IL for .NET, bytecode for Java.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Once compiled to "native" (which has a relative meaning) code there is absolutely no way to recover the original source code without insane amounts of metadata emitted in the binary itself (which is done in some cases). Compilers perform A LOT of optimizations that would seriously obfuscate the meaning of your code in its compiled-reverse-engineed form.

For those that understand how to reverse-engineer an application, it makes little sense to convert it to a higher-level language. Most cracks are done using interactive debuggers which display opcodes and the associated assembly instruction only, and the higher-level language like C or C++ are then used to exploit what's been discovered.
 

JoLLyRoGer

Diamond Member
Aug 24, 2000
4,153
4
81
Originally posted by: Descartes
Once compiled to "native" (which has a relative meaning) code there is absolutely no way to recover the original source code without insane amounts of metadata emitted in the binary itself (which is done in some cases). Compilers perform A LOT of optimizations that would seriously obfuscate the meaning of your code in its compiled-reverse-engineed form.

For those that understand how to reverse-engineer an application, it makes little sense to convert it to a higher-level language. Most cracks are done using interactive debuggers which display opcodes and the associated assembly instruction only, and the higher-level language like C or C++ are then used to exploit what's been discovered.

Right, but even reverse engineering the program in to assembaly code would allow you to re-compile it for a different OS or processor, provided you have a compiler on hand. (For example: Porting the program onto Linux using the source code and a linux native compiler.) Correct?
 

AgaBoogaBoo

Lifer
Feb 16, 2003
26,108
5
81
Originally posted by: NuclearFusi0n
Incredibly hard to get useful code unless you are a truely gifted programmer. You would have better things to do than hack on games though.

Exactly. Back in the old days, it was easier because programs were simpler, but nowadays they are more complicated from an assembly code point of view. Sure, C++ or Java make it easier, but the final result is much more complicated for most things these days. If someone can really read the binary code and reverse engineer it AND has the time to do it, they could be making a lot more money working for a security company.

So, theoretically, it is possible, but for something as large as this, its not realistically possible 99.99999998% of the times.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: JoLLyRoGer
Originally posted by: Descartes
Once compiled to "native" (which has a relative meaning) code there is absolutely no way to recover the original source code without insane amounts of metadata emitted in the binary itself (which is done in some cases). Compilers perform A LOT of optimizations that would seriously obfuscate the meaning of your code in its compiled-reverse-engineed form.

For those that understand how to reverse-engineer an application, it makes little sense to convert it to a higher-level language. Most cracks are done using interactive debuggers which display opcodes and the associated assembly instruction only, and the higher-level language like C or C++ are then used to exploit what's been discovered.

Right, but even reverse engineering the program in to assembaly code would allow you to re-compile it for a different OS or processor, provided you have a compiler on hand. (For example: Porting the program onto Linux using the source code and a linux native compiler.) Correct?

Negative. There's a large variance of the instruction set CPUs support, especially when you consider bit-boundaries (32-bit, 64-bit like the Itanium, etc.). Different assemblers (nasm, masm, ...) support different instructions as well (e.g. masm has support for instructions that make procedure calls easier), and what works in one assembler might not work in another depending on what you used to reverse-engineer the application in the first place.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
Originally posted by: Descartes
Don't say interpreted :) They're compiled, just to an intermediate language; IL for .NET, bytecode for Java.
Semantics really. It's compiled into an intermediate language that is interpreted at runtime by either the JVM or the .net framework
The point was that the distributed executable file is not native machine code but is an intermediate language that is easier to reverse engineer than native machine code.

 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: Shanti
Originally posted by: Descartes
Don't say interpreted :) They're compiled, just to an intermediate language; IL for .NET, bytecode for Java.
Semantics really. It's compiled into an intermediate language that is interpreted at runtime by either the JVM or the .net framework
The point was that the distributed executable file is not native machine code but is an intermediate language that is easier to reverse engineer than native machine code.

Tru dat.
 

JoLLyRoGer

Diamond Member
Aug 24, 2000
4,153
4
81
Originally posted by: Descartes
Originally posted by: JoLLyRoGer
Originally posted by: Descartes
Once compiled to "native" (which has a relative meaning) code there is absolutely no way to recover the original source code without insane amounts of metadata emitted in the binary itself (which is done in some cases). Compilers perform A LOT of optimizations that would seriously obfuscate the meaning of your code in its compiled-reverse-engineed form.

For those that understand how to reverse-engineer an application, it makes little sense to convert it to a higher-level language. Most cracks are done using interactive debuggers which display opcodes and the associated assembly instruction only, and the higher-level language like C or C++ are then used to exploit what's been discovered.

Right, but even reverse engineering the program in to assembaly code would allow you to re-compile it for a different OS or processor, provided you have a compiler on hand. (For example: Porting the program onto Linux using the source code and a linux native compiler.) Correct?

Negative. There's a large variance of the instruction set CPUs support, especially when you consider bit-boundaries (32-bit, 64-bit like the Itanium, etc.). Different assemblers (nasm, masm, ...) support different instructions as well (e.g. masm has support for instructions that make procedure calls easier), and what works in one assembler might not work in another depending on what you used to reverse-engineer the application in the first place.

OK, that makes sense. I suppose libraries or header files would vary between compilers too, therefore a function called from a library using compiler "a" may not necessarily be availiable in compiler "b" (especially true if the software company wrote custom header files to include during the original build.)

--I'm a rookie who's still learning, I only know enough about programming to confuse myself and come off sounding like an idiot. ;) Not to mention everything (little as that may be) I do know revolves around C (not C++) or Java...
 

Zee

Diamond Member
Nov 27, 1999
5,171
3
76
am i allowed to post the page that describes wat the beta can do?
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
nearly impossible. certainly impossible for now. maybe in the future ai will be advanced enough to do that, but even then the produced result would not be identical to the original by any means.