A really stupid question
Hey,
I am not a programmer, but I have taken three programming courses in uni. I am currently trying to take a closer look at a certain algorithm with a small program that was sent to me, but I cannot for the life of me get it in a readable form. I've tried "opening" the program itself (just one file) with Microsoft Visual C++ and Textpad (for java) but I just get incomprehensible chaos of fonts. I need to be able to see the declarations and loops and all that stuff, how do I go about it?
cheers.
[521 byte] By [
Nagadsuna] at [2007-11-27 10:48:32]

Indeed it is a really stupid question. What type of file is it? What language is it?
> I am not a programmer, but I have taken three
> programming courses in uni. I am currently trying to
> take a closer look at a certain algorithm with a
> small program that was sent to me, but I cannot for
> the life of me get it in a readable form.
Maybe because the file's not in a readable form?
> I've tried
> "opening" the program itself (just one file) with
> Microsoft Visual C++ and Textpad (for java) but I
> just get incomprehensible chaos of fonts.
Fonts? Do you by any chance mean "characters"?
> I need to
> be able to see the declarations and loops and all
> that stuff, how do I go about it?
Ask the person who sent that stuff to you.
The file you are trying to open is a *.class file? if yes, use a decompiler like cavaj (google for cavaj).
Manuel Leiria
It is an .exe file. I figured i'd have to open it with the programming language that was used to program it. And yes, characters is what I meant. There was an addendum ot the file name when I opened it in textpad. It had "Hex" behind it, so perhaps the contents of it had been transformed into hexadecimal form.
Exe files contain machine code. With the right tools you may be able to "disassemble" the code back to a form of assembly language, but you won't be able to convert back to a higher level language (and a lot of stuff like meaningful names will be lost).
What you need is the source code.
> It is an .exe file.
.. a file that usually has nothing at all to do with Java. Moreso, a file that's not supposed to be read by humans.
> I figured i'd have to open it
> with the programming language that was used to
> program it.
You can't open a file with a programming language, in the same way you can't read a letter with French. You'll still have to use your eyes. You have to open it with an editor. Pointless in this case though.
Find out what programming language it is, find a decompiler, use that, dig through the assembler stuff you get. I doubt you'll get far though.
> There was an addendum ot the file name when I opened
> it in textpad. It had "Hex" behind it, so perhaps the
> contents of it had been transformed into hexadecimal
> form.
Files always are in hex.
Alright, thanks all for clarifying this a bit for me. I'll contact the other person and try and get the source code.
Assuming the project is a Java program, the files that make up the source code will end in 'java'. as in mySourceCode.java