Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

How to profile VBScript (wscript/cscript) execution?

$
0
0
Have a nice day!

I'm looking for a solution to profile Windows VBScript (wscript/cscript) execution. I need to log calls to functions like CreateObject, Eval, etc.

At this moment I have come up with 3 ideas:

1. Override these functions with my own like:

Function CreateObject(c1)
WScript.Echo c1 'profile here
Set CreateObject = WScript.CreateObject(obf)
End Function

Dim objShell
Set objShell = CreateObject("Name")

However there are problem "How to call the original one?". In case if we replace functions like "Trim, Replace, etc..." I have no idea how to call the original.

2. Using "IActiveScriptProfiling" interface. However, it seems it is only for JScript. Probably, I'm wrong.

3. Patching (hooking) calls to the functions above in the WScript/CScript executables. Ugly, but seems working way.

Could you please give me any examples of profiling? Or ideas how to deal with this task?

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>