Archive - Jan 13, 2007

Date

The cheapest way to decompile chm to html in Windows

in

hh.exe have a undocumented parameter, which anyone will find useful when decompile CHM to HTML. hh.exe comes with a copy of windows so no additional software have to be downloaded.
Here, are some steps to decompile a CHM file to HTML:
1. Find hh.exe
If you look into the folder you installed Windows(usually C:\windows), you can find hh.exe
hh.exe location
2. Open command line
Go to start->run, type in cmd and press enter
3. decompile!!!!
This is what you have to do in command line:
hh.exe -decompile <output folder> <input chm>
For example, if you want to output everything in c:\out\ and the chm file are located in C:\ and called something.chm, this is what you have to type:
hh.exe -decompile c:\out\ c:\something.chm
what next? PRESS ENTER!

This is FREE and FAST, why pay to get the softwares does the completely the same thing?

Absolute Server Path

in

Absolute server path can be find in different ways, the simplest will be call the pre defined variable $_SERVER['DOCUMENT_ROOT'].
But what if $_SERVER['DOCUMENT_ROOT'] does not exist?

In that case, we have to define $_SERVER['DOCUMENT_ROOT'] ourselves. Here are the ways I have find by search though the internet:

//From ChronoFish in http://www.thescripts.com/forum/thread2604.html
$_SERVER['DOCUMENT_ROOT'] = getcwd()."/../"; // works when the CGI-BIN directory is contained in the htdocs directory.
 
//From http://us3.php.net/reserved.variables
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
 
//From http://us3.php.net/reserved.variables  by chris at vault5 dot com
function resolveDocumentRoot() {
   $current_script = dirname($_SERVER['SCRIPT_NAME']);
   $current_path  = dirname($_SERVER['SCRIPT_FILENAME']);
 
   /* work out how many folders we are away from document_root
       by working out how many folders deep we are from the url.
       this isn't fool proof */
   $adjust = explode("/", $current_script);
   $adjust = count($adjust)-1;
 
   /* move up the path with ../ */
   $traverse = str_repeat("../", $adjust);
   $adjusted_path = sprintf("%s/%s", $current_path, $traverse);
 
   /* real path expands the ../'s to the correct folder names */
   return realpath($adjusted_path);   
}
Honey Pot that kill bots