Extract the CHM with one of the various extracters (mostly chmlib based), and then look into the extracted "*.hhc" file. This is an topic map that matches topic tiles/ids to urls internal in the CHM file.
Note some rare CHM files have a binary TOC and no hhc file, but chances on that are very low, since HH defaults discourage it.
Added later:
The number of extraction options of the Free Pascal chmls tool have been updated. (though some are more of a dump functionality than real extraction): Make sure you get one from 2.6.4+
list [section number]
Shows contents of the archive's directory
extract [saveasname]
Extracts file "filename to get" from archive "filename",
and, if specified, saves it to [saveasname]
extractall [directory]
Extracts all files from archive "filename" to directory
"directory"
unblockchm [filespec2] ..
Mass unblocks (XPsp2+) the relevant CHMs. Multiple files
and wildcards allowed
extractalias [basefilename] [symbolprefix]
Extracts context info from file "chmfilename"
to a "basefilename".h and "basefilename".ali,
using symbols "symbolprefix"contextnr
extracttoc [filename]
Extracts the toc (mainly to check binary TOC)
extractindex [filename]
Extracts the index (mainly to check binary index)
printidxhdr
prints #IDXHDR in readable format
printsystem
prints #SYSTEM in readable format
printwindows
prints #WINDOWS in readable format
printtopics
prints #TOPICS in readable format