27.04.2013 Views

330 Java Tips.pdf - FTP Server

330 Java Tips.pdf - FTP Server

330 Java Tips.pdf - FTP Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Miscellaneous I<br />

directory command "cd ." changes you to the current directory, effectively doing<br />

nothing. "c:\\.\Files\image.jpg" is exactly the same as saying<br />

"c:\\Files\image.jpg"<br />

The code you gave should do exactly the same thing in both forms, to my mind -<br />

return a list of the files in the root of the c:\ partition.<br />

--<br />

Lloyd Colling<br />

http://members.xoom.com/lcolling/<br />

Q: This is likely a very silly question. I need to create a .cab file, but I have no<br />

idea how to do it...<br />

Answer: Microsoft has a tool for it. See<br />

http://msdn.microsoft.com/workshop/management/cab/cab.asp<br />

You can also get a shareware version of a Cabinet Manager (easier to use than the<br />

MS tool) from<br />

http://www.microlognet.com/<br />

--<br />

Jos<br />

or you can download a free *.cab tool at:<br />

http://home.t-online.de/home/lars.hederer/english.htm<br />

Q: Why we can reengineer <strong>Java</strong> byte code (.class file) back to <strong>Java</strong> source<br />

code? But why binary .exe file we are unable to do it? What is the significant<br />

difference?<br />

Answer: AFAIK, <strong>Java</strong> byte code goes back to _some_ source, not to the original<br />

source. So, reverse engineering is limited.<br />

> But why binary .exe file we are unable to do it? What is the significant difference?<br />

(a) There is more than one way to do something using C++.<br />

(b) There are highly optimizing C++ compilers.<br />

(c) You won't get the original source anyway. See (a).<br />

Imagine that your C++ code contains inline functions. The compiler is free do place<br />

the body of it replacing a call, or instantiate the function and provide a real call to it.<br />

First, there is no way to know when it is going to do one or the other. Second, with<br />

some code inlined, how to decide what _was_ an inline function and what wasn't?<br />

So, the answer is: the distances between the levels of abstraction between byte code<br />

and <strong>Java</strong> source and between machine code and C++ source are significantly<br />

different. The bigger the distance, the less possible it is to recreate the source code.<br />

Victor Bazarov<br />

in java bytecode all the original variable names are kept. in an exe file smaller<br />

symbols are used.<br />

Some .exe decompilers are good enough to convince a jury that the "original" source<br />

code was reconstituted. See the Microsoft v. Stac case for an example.<br />

file:///F|/350_t/350_tips/miscellaneous-I.htm (10 of 11) [2002-02-27 21:18:44]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!