Fravia's Messageboard ~ Moderated
Re: Logic not included
Monday, 05-Apr-99 05:53:11
it's easy :-). if u have the WHOLE listing.
same as traversing a directory-tree (www.multimania.com/svd/1/recursls.pl)
static level=0
function godeeper(argument: address) {
level++;
while (some-call-found and address
print level-number-of-spaces/tabs
if call is outside listing/to extern lib/DLL/whatever
--- print call extrn addr at IP;
--- also eventualy crosreference into table of all external calls for future indexing
else {
print call addr at IP;
godeeper(IP)
}
} //eo while
level--;
} //eo function
of course, there are some tricky parts like following JMPs etc, which is not mandatory; AND checking for direct/indirect recursion, which is mandatory (2 possible ways: 1)if level>99 then stop (stupid but 100%working;); 2)or mark/remember (i.e. cache) places where u already have been, and don't re-trace them again).
ah, yes, some thoughts on quick-and-dirty vs smart-but-never: http://www.jwz.org/worse-is-better.html
have fun
ciao
svd
svd