在沒有 app.config 的情況下在 .NET exe 中禁用驗證碼簽名驗證 (Disabling authenticode signature verification in .NET exe without app.config)


問題描述

在沒有 app.config 的情況下在 .NET exe 中禁用驗證碼簽名驗證 (Disabling authenticode signature verification in .NET exe without app.config)

有誰知道如何在不使用應用程序配置文件的情況下禁用 .NET 可執行文件中的驗證碼簽名驗證(以避免啟動緩慢)?換句話說,這樣做:

<configuration>
    <runtime>
        <generatePublisherEvidence enabled="false"/>
    </runtime>
</configuration>

沒有app.config。有可能嗎?


參考解法

方法 1:

If you are allowed to modify the Main() method, then what you could do is the following in your Main:

  1. Create an application config file in memory with generatePublisherEvidence
  2. Create a new application domain using the newly created application config file
  3. Run the original Main in the other application domain

This will allow you not to have an application config file, but be able to have all the customization you would want to have in the application config file.

方法 2:

Well, according to MSDN the element generatePublishersEvidence can only be used in a configuration file:

Configuration File

This element can be used only in the application configuration file.

See http://msdn.microsoft.com/en‑us/library/bb629393.aspx.

(by Joe AlbahariearlNamelessDirk Vollmar)

參考文件

  1. Disabling authenticode signature verification in .NET exe without app.config (CC BY‑SA 2.5/3.0/4.0)

#authenticode #app-config #.net #configuration






相關問題

關於唯一下載的未知發布者警告 (unknown publisher warning on unique downloads)

如何避免 Authenticode 在自動構建中對 .NET 項目中的第三方庫進行簽名? (How can I avoid Authenticode signing third-party libraries in a .NET project in an automated build?)

CAPICOM - 驗證 SignedCode 來自沒有 UI 的受信任的發布者 (CAPICOM - Verify SignedCode is from a Trusted Publisher without UI)

SignTool 錯誤:訪問被拒絕 (SignTool error: Access is denied)

代碼簽名證書過期問題 (Code Signing Certificate Expiration Issue)

在沒有 app.config 的情況下在 .NET exe 中禁用驗證碼簽名驗證 (Disabling authenticode signature verification in .NET exe without app.config)

驗證 EXE 上的 Authenticode 簽名 - 沒有 CAPICOM 的 C++ (Validate Authenticode signature on EXE - C++ without CAPICOM)

EV 代碼簽名證書或 Microsoft Authenticode 的代碼簽名證書 (EV Code Signing certificate or Code Signing Certificates for Microsoft Authenticode)







留言討論