读取经典的asp文件并查找变量

发布于 12-31 22:01 字数 544 浏览 1 评论 0原文

我正在创建一个控制台应用程序来读取经典的 asp 页面文件并查找某些功能。我可以使用正则表达式来获取我想要的很多功能,然后使用检索到的文本来查询数据库。我已经可以做的一个例子 -

这是一个经典的 asp 函数(GetContentDirect),我想获取参数,这很容易用下面的代码来完成。我需要获取文本 CONTENT Logout 并用这些单词查询数据库。

xsl.addText "Logout", obj_Content.GetContentDirect("CONTENT Logout")

然而问题是函数的参数也是变量或文本和变量。就像下面的代码一样——

obj_node.appendChild obj_xml.createCDATASection(obj_Content.getContentDirect("CONTENT " & str_Temp))

我需要获取在页面其他位置分配的 str_Temp 的值。执行此操作的最佳方法是什么?

I'm creating a console application to read classic asp page files and find certain functions. A lot of the functions I can use regex to get what I want which I then use the the text retrieved to query a database. An example of what I can already do -

This is a classic asp function (GetContentDirect) and I want to get the parameters which is easy to do with the below code. I would need to get the text CONTENT Logout and query the database with those words.

xsl.addText "Logout", obj_Content.GetContentDirect("CONTENT Logout")

The problem however is that the parameters for the functions are also variables or text and variables. Like the below code -

obj_node.appendChild obj_xml.createCDATASection(obj_Content.getContentDirect("CONTENT " & str_Temp))

I would need to get the value of str_Temp which is assigned elsewhere on the page. Whats the best way to go about doing this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

摘星┃星的人2025-01-07 22:01:54

如果你的“变量”实际上是常量,那么解决方案就相当简单了。只需让您的控制台应用程序了解这些常量即可。

但是,如果它们确实是变量,那么获取所有代码路径的值的最简单方法似乎是实际执行代码。

修改您的函数以在每次调用时记录它,包括每个参数的值。然后抓取您的网站并根据生成的日志运行控制台应用程序。

If your "variables" are actually constants, the solution is rather straightforward. Just let your console application know about the constants.

But, if they are truly variables, it seems the easiest way to get the values for all code paths would be to actually execute the code.

Modify your functions to log each time it is called, including the value of each parameter. Then crawl your site and run your console app against the resulting logs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文