XView and ASPScan

download : aspscan and xview .net binary (22kb)
download : aspscan src (9kb)
download : xview src (30kb)

Note : You will need to have a .net enabled machine to run these. You can get the .Net framework redistributable here or if you are a programmer you can get the .Net framework SDK here.

XView

This is a tool written in C#, that acts as a visual interface for the commandline scanner, aspscan.exe. ASPScan.exe can scan entire projects and provide information about declaration of variables and methods and their usage information. XView can open and display the XML files dumped by aspscan.exe as a tree. The tree description is provided below. XView can spawn aspscan.exe, thus you will not need to use aspscan at the commandline.

XView : Executing a Scan

The output file will be created in the last directory in the list. (if it was a relative path). You can go on to view this XML in XView.

XML Tree Desription

The following is a terse description of the XML tree. A bit of comparing with the src should make the ideas clear.

About Token
Normally the token subtree should be empty. It will have elements when a tokens could not be traced. This could be because -

ASPScan.exe : ASP analyser in C#

The command line tool aspscan.exe does the analysis. This can scan entire projects and provide information about declaration of variables and methods and their usage information.

Benefits

Aspscan.exe gives you a lot of detail in the anlysis(Is this a lot?).
This includes

COM

COM instances are treated as normal Dim declarations. It further tell you the name of the COM method invoked and which COM component it is an instance of. This information is tracked on a per file/methos basis.

Command Line

Ex:
aspscan.exe /d:\myproject\aspfiles *.asp /r+

Pass2 : Pass2 is when the analyser tries to detect usage information and is time consuming. If one does not need this info, disable it with the '/p2+' switch

Recurse Include files: If one wishes only to analyse the mentioned file and not any include files it might have then use the '/in-' switch to disable include file recursion.

Known Limitations (aspscan.exe):

 

Note :

This had originally been written in Ruby. Ruby is an amazing interpreted language and it came to about 330+ lines of code in Ruby without any effort to tighten code.

But as Ruby was slow , being interpretive, and had some problem despite its expressive beauty and because you need Ruby to run teh analyser I tried a c# version. I am happy to say that the c# version stopped in about 550+ lines of code. Surprise, because I was expecting it to bloat like hell if I was expecting it to be the equivalent of tdoing it in c++/c. Also a speedup of about 10 to 15 times on the same analysis.