问题
I've never really had to debug Classic ASP, so this is a little rough and most likely a poor question, but I have done as much research as I could before asking.
I have a request to identify what code prints to a printer, and re-use that code in a new page that someone has built.
While trying to identify that, I've stumbled on a few things that I don't understand, but namely one big one.
The gist is, people can order cookies from the cafeteria, and when they submit, it shows a confirmation page and that order is sent to a printer.
To get a list of cookie options, there's a Server Object created, and from there a method exists, but I cannot identify where it is or where I should be looking. Here's the code:
<%
On error resume next
Const CATAGORY_COOKIE = 1
Dim cookieNames
Dim objCookie
Dim Count
Set objCookie = Server.CreateObject("CookieOrder.CookieRequest")
if objCookie Is Nothing then
Response.Write "Error"
Response.End
End if
cookieNames = objCookie.getAvailable_Item_Names(CATAGORY_COOKIE)
Count = objCookie.Count
Dim sz
sz = Split(cookieNames, ";")
Set objCookie = Nothing
%>
How do I identify what the Server Object is? There's a .dll file that contains binary, but I'm not familiar with how that could be utilized.
I have tried to follow the browser dev tools, but they really haven't been too helpful in this aspect.
I am hoping that learning how this code is executing or where it's being executed I will figure out my other problems.
回答1:
Bit of background
The project is using a COM+ component. These are defined in Classic ASP using the syntax;
Set obj = Server.CreateObject("[insert COM+ ProgId]")
In this project you are using a component registered with the ProgId
CookieOrder.CookieRequest
There are many out of the box COM+ components available to Classic ASP that provide a lot of common functionality such as;
Visual Basic Scripting Runtime ActiveX Data Objects
There is also the ability to create COM+ components for use with Classic ASP using languages common to the time like Visual Basic, Visual C++ and more recently using the .NET Framework (C#, VB.NET).
How to locate COM+ libraries
NOTE: Please be careful when accessing the registry as modifying or deleting keys could lead to a corrupt operating system.
Also for the purposes of this guide will use the
Scripting.DictionaryProgId.
The key is using the ProgId to find an elusive COM+ library.
Start
%SystemRoot%\system32\regedit.exe(will work in most Windows Operating Systems)Navigate to the
HKEY_CLASS_ROOThive and select it, then press Ctrl + F to open the Find dialog box.In
Find whattype the ProgId in this caseScripting.Dictionaryand make sure inlook atonlyKeyis checked then pressFindorFind Next.If a
ProgIdkey is found expand to the key and locate theCLSIDkey which contains a(Default)REG_SZ with the value of the CLSID in the case of this example{EE09B103-97E0-11CF-978F-00A02463E06F}. Double click this value to bring up theEdit Stringdialog copy the value into your clipboard.Return to the
HKEY_CLASS_ROOTkey and use Find to search for theCLSIDvalue which in this example is{EE09B103-97E0-11CF-978F-00A02463E06F}and again make sureLook athas onlyKeychecked then pressFindorFind Next.If the key is found expand and locate the
InprocServer32key in it you will find the location of DLL in the(Default)REG_SZ value. In this example that isC:\Windows\System32\scrrun.dll(this will be different depending on installation location and OS)
What about decompiling?
There's a lot of assumption in the comments about the compiler used to compile the DLL (mainly .NET), but the best way to check is to use one of the many programs out there in the public domain designed for this purpose.
There is a specific question on SO that deals with this;
Answer by @simon-mᶜkenzie to Identifying the origin of a DLL
来源:https://stackoverflow.com/questions/30175701/locating-the-source-dll-behind-a-com-progid