Community
    • Login

    Certificate required for building Notepad++ ?

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    8 Posts 6 Posters 11.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Indigo GullI
      Indigo Gull
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • dailD
        dail
        last edited by

        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.
        1 Reply Last reply Reply Quote 1
        • Indigo GullI
          Indigo Gull
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • KaushaldevyK
            Kaushaldevy
            last edited by

            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

            tukuneT 1 Reply Last reply Reply Quote 0
            • tukuneT
              tukune @Kaushaldevy
              last edited by

              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());
              }
              
              1 Reply Last reply Reply Quote 0
              • KaushaldevyK
                Kaushaldevy
                last edited by

                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.

                Claudia FrankC 1 Reply Last reply Reply Quote 0
                • Claudia FrankC
                  Claudia Frank @Kaushaldevy
                  last edited by

                  @Kaushaldevy

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

                  Cheers
                  Claudia

                  1 Reply Last reply Reply Quote 0
                  • SinghRajenMS
                    SinghRajenM moderator
                    last edited by

                    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());
                    }
                    
                    1 Reply Last reply Reply Quote 2
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors