Certificate required for building Notepad++ ?



  • Hello everyone.

    I’ve successfully built Notepad++.exe in Visual Studio from https://github.com/notepad-plus-plus/notepad-plus-plus, and also Boost.

    However when I launch the resulting notepad++.exe I get these 3 fatal errors…

    • Cheking signature of C:<snip>\scilexer.dll - DLL Signature verification failed
    • Library verification failed - Authenticode check failed: signature or signing certificate are not recognized
    • Exception on WM_CREATE - ScintillaEditView::init : SCINTILLA ERROR - can not load the dynamic library

    I assume this is related to https://notepad-plus-plus.org/community/topic/13415/v7-3-3-fix-cia-hacking-notepad-issue ?

    How can I run/debug from Notepad++ source?

    Thanks.



  • Yes Notepad++ does require the SciLexer.dll file to be digitally signed (which only Don Ho can create). So you have two options:

    1. Temporarily comment out the code that checks the certificate.
    2. Use the SciLexer.dll file that comes with the official release of Notepad++. You can also download one of the zip packages from the website (either 32 or 64 bit) and use the SciLexer.dll file from the zip file.


  • Thanks dail… was worried I was missing something! Commented out VerifySignedLibrary call and working fine now.



  • Hello everyone,
    I had the same issue with the SciLexer.dll and I’ve followed Dail’s kindly suggestion: “Temporarily comment out the code that checks the certificate” ( I commented out the call to VerifySignedLibrary in loadSciLexerDll() function)

    I was able to get rid of the checking the signature and Library verification failed errors. But, I still get the ‘Exception on WM_CREATE - ScintillaEditView::init : SCINTILLA ERROR - can not load the dynamic library error’

    I am new to the notepad++ and really appreciate on any suggestion
    I am using VS2017 (version 15.2), boost_1_55_0 and …\notepadPlus.vs2015.vcxproj project file
    Thanks



  • Temporarily comment out the code that checks the certificate.

    PowerEditor\src\ScitillaComponent\ScintillaEditView.cpp

    HMODULE loadSciLexerDll()
    {
    	generic_string sciLexerPath = getSciLexerFullPathName(moduleFileName, 1024);
    
    //	bool isOK = VerifySignedLibrary(sciLexerPath, SCINTILLA_SIGNER_KEY_ID, SCINTILLA_SIGNER_SUBJECT, SCINTILLA_SIGNER_DISPLAY_NAME, false, false);
    //
    //	if (!isOK)
    //	{
    //		::MessageBox(NULL,
    //			TEXT("Authenticode check failed: signature or signing certificate are not recognized"),
    //			TEXT("Library verification failed"),
    //			MB_OK | MB_ICONERROR);
    //		return nullptr;
    //	}
    
    	return ::LoadLibrary(sciLexerPath.c_str());
    }
    


  • Thanks tukune. I have attached a Screenshot
    But, even after commenting the verifySignedLibrary call I get the ‘Exception on WM_CREATE - ScintillaEditView::init : SCINTILLA ERROR - can not load the dynamic library error.



  • @Kaushaldevy

    you need to make sure that the resulting SciLexer.dll is in the same directory as notepad++.exe is.

    Cheers
    Claudia



  • Though little late in reply, but no change needed, if you are dealing with debug build (most of developers deals with debug version). Digital signature checking is guarded now.

    HMODULE loadSciLexerDll()
    {
    	generic_string sciLexerPath = getSciLexerFullPathName(moduleFileName, 1024);
    
    	// Do not check dll signature if npp is running in debug mode
    	// This is helpful for developers to skip signature checking
    	// while analyzing issue or modifying the lexer dll
    #ifndef _DEBUG
    	bool isOK = VerifySignedLibrary(sciLexerPath, SCINTILLA_SIGNER_KEY_ID, SCINTILLA_SIGNER_SUBJECT, SCINTILLA_SIGNER_DISPLAY_NAME, false, false);
    
    	if (!isOK)
    	{
    		::MessageBox(NULL,
    			TEXT("Authenticode check failed: signature or signing certificate are not recognized"),
    			TEXT("Library verification failed"),
    			MB_OK | MB_ICONERROR);
    		return nullptr;
    	}
    #endif // !_DEBUG
    
    	return ::LoadLibrary(sciLexerPath.c_str());
    }
    

Log in to reply