Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load the library #1

Open
ghostjat opened this issue Aug 20, 2018 · 8 comments
Open

Failed to load the library #1

ghostjat opened this issue Aug 20, 2018 · 8 comments

Comments

@ghostjat
Copy link

COM failed to load the Universal_CCW.dll.

@EionRobb
Copy link
Owner

Ah, the dll needs to be registered to be able to call it. I should probably make a note on the readme about it.

You need to run regasm.exe, eg C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe Universal_CCW.dll

@ghostjat
Copy link
Author

Invalid pointer
After registering it

@EionRobb
Copy link
Owner

How are you calling it? Is "Invalid pointer" a PHP error, COM error or VB error? Can you get a full backtrace?

@ghostjat
Copy link
Author

Uncaught com_exception: Failed to create COM object `Universal_CCW.Universal_CCW_Factory': The system cannot find the file specified.
even after registering it.
when checking it in OLE/COM object viewer
ICLassFactory:: CreateInstance failed
Invalid pointer

@andreasring
Copy link

andreasring commented Feb 10, 2020

If anyone ever stumbles upon this 'invalid pointer' issue again, I fixed it by trying to debug it within .net and found out it was the disallow_app nonesense in new() that was causing it. Just comment it out, rebuild and it should work. Without taking the time to investigate any further I believe there is an issue because the keys and/or values in registry dosent exist by default (duh).

@EionRobb
Copy link
Owner

What's the "disallow-app nonsense"?

@andreasring
Copy link

The code from line 156 line 164 in Universal_CCW_source.vb:

' Warn user if calling app is on the blacklist
Dim disallow_reg As String() = Ctype(Microsoft.Win32.Registry.GetValue("HKEY_CLASSES_ROOT\Universal_CCW.Universal_CCW_Factory\Application_Security", "Disallow", New String(){String.Empty}), String())
For Each disallow_app In disallow_reg
  If disallow_app = Calling_App_Name Then
    If MsgBox("WARNING: " & disallow_app & " is attempting to call potentially dangerous code.  When this code is allowed to run on websites, it will give the website full access to your system.  Due to the extreme security risks this code poses, allowing " & disallow_app & " to use it is highly discouraged.  Do you wish to allow this?", MsgBoxStyle.Critical Or MsgBoxStyle.YesNo) <> vbYes Then 
      Throw New Exception(disallow_app & " is attempting to call this library.  Blocked by user.")
    End If
  End if
Next

Due to the Universal_CCW_COM_Register.reg file not being available anymore, the 'HKEY_CLASSES_ROOT\Universal_CCW.Universal_CCW_Factory\Application_Security' registry entry dosent exist and is causing the 'invalid pointer' error for anyone who dosent manually create it.

From a security standpoint I guess its not a horrible idea (the blacklist), but it dosent exactly fix the security problem. This is like fixing a leaky dam with duct tape. I consider this project such a hack anyway that you should not run this in any sort of environment where it is likely to be exploited. In other words this should be used in a safe and isolated environment.

The blacklist stuff is mentioned, but just barely way down on this page: http://universalccw.sourceforge.net/

@aiso-net
Copy link

This fixed my issue, just need to get help with the constructor arguments issue I just posted on here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants