asp-classiccom+

Locating the source DLL behind a COM+ ProgId


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.


Solution

  • 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.Dictionary ProgId.

    The key is using the ProgId to find an elusive COM+ library.

    1. Start %SystemRoot%\system32\regedit.exe (will work in most Windows Operating Systems)

    2. Navigate to the HKEY_CLASS_ROOT hive and select it, then press Ctrl + F to open the Find dialog box.

    3. In Find what type the ProgId in this case Scripting.Dictionary and make sure in look at only Key is checked then press Find or Find Next.

    4. If a ProgId key is found expand to the key and locate the CLSID key 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 the Edit String dialog copy the value into your clipboard.

    5. Return to the HKEY_CLASS_ROOT key and use Find to search for the CLSID value which in this example is {EE09B103-97E0-11CF-978F-00A02463E06F} and again make sure Look at has only Key checked then press Find or Find Next.

    6. If the key is found expand and locate the InprocServer32 key in it you will find the location of DLL in the (Default) REG_SZ value. In this example that is C:\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