From 4128a74613585dbef1e77c9bbabcf402238dd868 Mon Sep 17 00:00:00 2001 From: isaak654 Date: Sun, 17 Oct 2021 21:05:50 +0200 Subject: [PATCH] git add --renormalize . --- Installer/Languages.iss | 452 +- Installer/Sandboxie-Plus.iss | 1074 ++-- Sandboxie/COPYING | 1242 ++-- Sandboxie/apps/control/SbieControl.rc2 | 108 +- Sandboxie/apps/res/xptheme.manifest | 54 +- Sandboxie/common/NtCRT/x64/ntdll.def | 342 +- .../common/NtCRT/x86/except_handler3.asm | 1102 ++-- Sandboxie/common/NtCRT/x86/ntdll.def | 368 +- Sandboxie/core/dll/SboxDll.def | 6 +- Sandboxie/core/dll/SboxDll32.def | 228 +- Sandboxie/core/dll/SboxDll64.def | 16 +- Sandboxie/core/dll/pstore.idl | 510 +- Sandboxie/core/dll/util_32.asm | 558 +- Sandboxie/core/dll/util_64.asm | 686 +- Sandboxie/core/dll/util_asm.asm | 82 +- Sandboxie/core/drv/SbieDrv.inf | 118 +- Sandboxie/core/drv/SbieDrv_x32.ddf | 30 +- Sandboxie/core/drv/SbieDrv_x64.ddf | 30 +- Sandboxie/core/drv/aulldvrm.asm | 210 +- Sandboxie/core/drv/util_asm.asm | 536 +- Sandboxie/core/low/LowLevel.def | 2 +- Sandboxie/core/low/entry.asm | 1440 ++--- Sandboxie/install/Cmdline.nsh | 92 +- Sandboxie/install/IsAdmin.nsh | 98 +- Sandboxie/install/IsWow64.nsh | 118 +- Sandboxie/install/Registry.nsh | 1472 ++--- Sandboxie/install/SandboxieVS.nsi | 3258 +++++----- Sandboxie/install/release/release.manifest | 36 +- Sandboxie/msgs/sbiemsg.def | 2 +- SandboxiePlus/MiscHelpers/LICENSE | 330 +- SandboxiePlus/MiscHelpers/MiscHelpers.pri | 122 +- SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro | 80 +- SandboxiePlus/QSbieAPI/LICENSE | 330 +- SandboxiePlus/QSbieAPI/QSbieAPI.pri | 60 +- SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro | 80 +- .../qtsingleapp/qtsingleapp/qtsingleapp.pri | 16 +- .../SandMan/Forms/FileBrowserWindow.ui | 92 +- SandboxiePlus/SandMan/Forms/NewBoxWindow.ui | 338 +- SandboxiePlus/SandMan/Forms/OptionsWindow.ui | 5516 ++++++++--------- SandboxiePlus/SandMan/Forms/PopUpWindow.ui | 92 +- SandboxiePlus/SandMan/Forms/RecoveryWindow.ui | 340 +- .../SandMan/Forms/SelectBoxWindow.ui | 214 +- SandboxiePlus/SandMan/Forms/SettingsWindow.ui | 1764 +++--- .../SandMan/Forms/SnapshotsWindow.ui | 314 +- SandboxiePlus/SandMan/LICENSE | 20 +- SandboxiePlus/SandMan/SandMan.pri | 158 +- SandboxiePlus/SandMan/SandMan.qc.pro | 80 +- SandboxiePlus/SandboxiePlus.pro | 28 +- SandboxiePlus/UGlobalHotkey/.qmake.stash | 44 +- 49 files changed, 12144 insertions(+), 12144 deletions(-) diff --git a/Installer/Languages.iss b/Installer/Languages.iss index e58401c8..8be36204 100644 --- a/Installer/Languages.iss +++ b/Installer/Languages.iss @@ -1,226 +1,226 @@ -; English is default language and can be translated to any -; of the languages listed in the languages section. -; The translations can be added to the CustomMessages section. -; The content of this script will be included by Sandboxie-Plus.iss, -; so please edit with care. - - -[Languages] - -Name: "english"; MessagesFile: "compiler:Default.isl" -Name: "ChineseSimplified"; MessagesFile: "isl\ChineseSimplified.isl" -Name: "ChineseTraditional"; MessagesFile: "isl\ChineseTraditional.isl" -Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl" -Name: "french"; MessagesFile: "compiler:Languages\French.isl" -Name: "german"; MessagesFile: "compiler:Languages\German.isl" -Name: "Italian"; MessagesFile: "compiler:Languages\Italian.isl" -Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" -Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" -Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" -Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" -;Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" -;Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl" -;Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" -;Name: "bulgarian"; MessagesFile: "compiler:Languages\Bulgarian.isl" -;Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" -;Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl" -;Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" -;Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" -;Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl" -;Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" -;Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl" -;Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" -;Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" -;Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" -;Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" -;Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" - - -[CustomMessages] - -; English -english.AddSandboxedMenu=Add "Run Sandboxed" to context menu -english.CustomPageLabel1=Select Installation Type -english.CustomPageLabel2=How should be installed -english.CustomPageLabel3=Choose the installation mode -english.CustomPageInstallMode=Install {#MyAppName} on this computer -english.CustomPageUpgradeMode=Update existing {#MyAppName} installation -english.CustomPagePortableMode=Extract all files to a directory for portable use -english.RequiresWin7OrLater=Sandboxie-Plus requires Windows 7 or later. -english.ClassicFound=Sandboxie Classic installation detected, it must be uninstalled first, do you want to uninstall it now? -english.RunSandboxedMenu=Run &Sandboxed -english.UninstallTaskLabel1=Select Uninstall Type -english.UninstallTaskLabel2=How would you like to uninstall Sandboxie-Plus? -english.UninstallTaskLabel3=&Keep configuration files and sandboxes%nThis is the most recommended option if you plan to reinstall Sandboxie-Plus while keeping your configuration files and sandboxes. -english.UninstallTaskLabel4=Remove &configuration files%nSelect this option to remove the Sandboxie.ini and Sandboxie-Plus.ini configuration files while keeping the sandboxes unchanged. -english.UninstallTaskLabel5=Remove configuration files and &sandboxes%nSelect this option to remove all configuration files and sandboxes, including the Sandbox folder located in custom paths with FileRootPath. - -; Chinese Simplified -ChineseSimplified.AddSandboxedMenu=添加“在沙盘中运行”菜单 -ChineseSimplified.CustomPageLabel1=选择安装方式 -ChineseSimplified.CustomPageLabel2=应当如何安装 -ChineseSimplified.CustomPageLabel3=选择安装模式 -ChineseSimplified.CustomPageInstallMode=在这台计算机上安装 {#MyAppName} -ChineseSimplified.CustomPageUpgradeMode=更新当前已安装的 {#MyAppName} -ChineseSimplified.CustomPagePortableMode=提取全部文件到指定目录供便携化使用 -ChineseSimplified.RequiresWin7OrLater=Sandboxie-Plus 需要 Windows 7 或更高版本。 -ChineseSimplified.ClassicFound=检测到已安装 Sandboxie 原版,继续安装必须先将其卸载,是否开始卸载? -ChineseSimplified.RunSandboxedMenu=在沙盘中运行(&S) -ChineseSimplified.UninstallTaskLabel1=选择卸载方式 -ChineseSimplified.UninstallTaskLabel2=您想卸载 Sandboxie-Plus 到什么程度? -ChineseSimplified.UninstallTaskLabel3=保留配置文件和所有沙盘(&K)%n如果您是打算重新安装 Sandboxie-Plus,这是很好的选择,不会丢失您的配置文件和沙盘。 -ChineseSimplified.UninstallTaskLabel4=移除配置文件(&C)%n选择此选项将会移除 Sandboxie.ini 和 Sandboxie-Plus.ini 配置文件,但保留您的沙盘。 -ChineseSimplified.UninstallTaskLabel5=移除配置文件和所有沙盘(&S)%n选择此选项将会移除所有配置文件和沙盘,包括 FileRootPath 所定义的路径下的 Sandbox 文件夹。 - -; Chinese Traditional -ChineseTraditional.AddSandboxedMenu=加入「在沙箱中執行」選單 -ChineseTraditional.CustomPageLabel1=選擇安裝方式 -ChineseTraditional.CustomPageLabel2=應該如何安裝 -ChineseTraditional.CustomPageLabel3=選擇安裝模式 -ChineseTraditional.CustomPageInstallMode=在這台電腦上安裝 {#MyAppName} -ChineseTraditional.CustomPageUpgradeMode=更新目前已安裝的 {#MyAppName} -ChineseTraditional.CustomPagePortableMode=解壓縮所有檔案到指定目錄供便攜化使用 -ChineseTraditional.RequiresWin7OrLater=Sandboxie-Plus 需要 Windows 7 或更高版本。 -ChineseTraditional.ClassicFound=偵測到已安裝 Sandboxie 原版,要繼續安裝必須先將其移除,是否開始移除? -ChineseTraditional.RunSandboxedMenu=在沙箱中執行(&S) -ChineseTraditional.UninstallTaskLabel1=選擇移除類型 -ChineseTraditional.UninstallTaskLabel2=要如何移除 Sandboxie-Plus? -ChineseTraditional.UninstallTaskLabel3=保留設定檔和沙箱(&K)%n如果您打算保留設定檔和沙箱的同時,並重新安裝 Sandboxie-Plus,這是最推薦的選項。 -ChineseTraditional.UninstallTaskLabel4=刪除設定檔案(&C)%n選擇此選項可刪除 Sandboxie.ini 和 Sandboxie-Plus.ini 設定檔,並完整保留沙箱。 -ChineseTraditional.UninstallTaskLabel5=刪除設定檔和沙箱(&S)%n選擇此選項可刪除所有設定檔和沙箱,包含位於 FileRootPath 自訂路徑中的 Sandbox 資料夾。 - -; Dutch -dutch.AddSandboxedMenu="In sandbox uitvoeren" aan contextmenu toevoegen -dutch.CustomPageLabel1=Installatietype selecteren -dutch.CustomPageLabel2=Hoe moet er geïnstalleerd worden -dutch.CustomPageLabel3=Installatiemodus kiezen -dutch.CustomPageInstallMode={#MyAppName} op deze computer installeren -dutch.CustomPageUpgradeMode=Bestaande installatie van {#MyAppName} bijwerken -dutch.CustomPagePortableMode=Alle bestanden naar een map uitpakken voor draagbaar gebruik -dutch.RequiresWin7OrLater=Sandboxie-Plus vereist Windows 7 of later. -dutch.ClassicFound=Installatie van Sandboxie Classic gedetecteerd. Het moet eerst verwijderd worden. Wilt u het nu verwijderen? -dutch.RunSandboxedMenu=In &sandbox uitvoeren -dutch.UninstallTaskLabel1=Type verwijdering selecteren -dutch.UninstallTaskLabel2=Hoe wilt u Sandboxie-Plus verwijderen? -dutch.UninstallTaskLabel3=Configuratiebestanden en sandboxen behouden%nDit is de aanbevolen optie als u Sandboxie-Plus opnieuw wilt installeren en uw configuratiebestanden en sandboxen wilt behouden. -dutch.UninstallTaskLabel4=Configuratiebestanden verwijderen%nSelecteer deze optie om de configuratiebestanden Sandboxie.ini en Sandboxie-Plus.ini wilt verwijderen en de sandboxen ongewijzigd wilt laten. -dutch.UninstallTaskLabel5=Configuratiebestanden en sandboxen verwijderen%nSelecteer deze optie om alle configuratiebestanden en sandboxen te verwijderen, inclusief de Sandbox-map die zich in aangepaste paden met FileRootPath bevindt. - -; French -french.AddSandboxedMenu=Ajouter « Exécuter dans un bac à sable » au menu contextuel -french.CustomPageLabel1=Sélectionnez le type d'installation -french.CustomPageLabel2=Comment doit-on l'installer -french.CustomPageLabel3=Choisissez le mode d'installation -french.CustomPageInstallMode=Installer {#MyAppName} sur cet ordinateur -french.CustomPageUpgradeMode=Mettre à jour l'installation de {#MyAppName} existante -french.CustomPagePortableMode=Extraire tous les fichiers dans un répertoire pour une utilisation portable -french.RequiresWin7OrLater=Sandboxie-Plus nécessite Windows 7 ou une version ultérieure. -french.ClassicFound=Installation de Sandboxie Classic détectée, il doit être désinstallé d'abord, voulez-vous le désinstaller maintenant ? -french.RunSandboxedMenu=Exécuter dans un &bac à sable -french.UninstallTaskLabel1=Sélectionnez le type de désinstallation -french.UninstallTaskLabel2=Comment voulez-vous désinstaller Sandboxie-Plus ? -french.UninstallTaskLabel3=&Conserver les fichiers de configuration et les bacs à sable%nCette option est la plus recommandée si vous prévoyez de réinstaller Sandboxie-Plus tout en conservant vos fichiers de configuration et vos bacs à sable. -french.UninstallTaskLabel4=Supprimer les &fichiers de configuration%nSélectionnez cette option pour supprimer les fichiers de configuration « Sandboxie.ini » et « Sandboxie-Plus.ini » tout en conservant les bacs à sable inchangés. -french.UninstallTaskLabel5=Supprimer les fichiers de configuration et les &bacs à sable%nSélectionnez cette option pour supprimer tous les fichiers de configuration et les bacs à sable, y compris le dossier « Sandbox » situé dans les chemins personnalisés avec « FileRootPath ». - -; German -german.AddSandboxedMenu=Füge "In Sandbox ausführen" zum Kontextmenü hinzu -german.CustomPageLabel1=Wählen Sie die Installationsart aus -german.CustomPageLabel2=Wie soll installiert werden -german.CustomPageLabel3=Wählen Sie die Installationsmethode -german.CustomPageInstallMode=Installiere {#MyAppName} auf diesem Computer -german.CustomPageUpgradeMode=Update der bestehenden {#MyAppName} Installation -german.CustomPagePortableMode=Extrahiere alle Dateien in einen Ordner zur tragbaren Verwendung -german.RequiresWin7OrLater=Sandboxie-Plus benötigt Windows 7 oder neuer. -german.ClassicFound=Sandboxie Classic Installation gefunden, welche vorher deinstalliert werden muss. Möchten Sie diese nun deinstallieren? -german.RunSandboxedMenu=In &Sandbox ausführen -german.UninstallTaskLabel1=Wählen Sie die De-Installationsart aus -german.UninstallTaskLabel2=Wie möchten Sie Sandboxie-Plus de-installieren? -german.UninstallTaskLabel3=&Konfiguration und Sandboxen behalten%nDies ist die empfohlene Option, wenn Sie vorhaben Sandboxie-Plus erneut zu intallieren, während Sandboxie-Plus alle Sandboxen und Konfigurationsdateien behält. -german.UninstallTaskLabel4=&Entferne die Konfiguration%nWählen Sie diese Option um die Sandboxie.ini und Sandboxie-Plus.ini Dateien zu entfernen, während die Sandboxen unverändert bleiben. -german.UninstallTaskLabel5=Entferne die Konfiguration und alle &Sandboxen%nWählen Sie diese Option um alle Konfigurationsdateien und alle Sandboxen, inklusive des Sandboxordners im, durch die Dateisystemquelle, benutzerdefinierten Pfad. - -; Italian -Italian.AddSandboxedMenu=Aggiungi l'opzione "Avvia nell'area virtuale" al menu contestuale -Italian.CustomPageLabel1=Seleziona tipo di installazione -Italian.CustomPageLabel2=Come dovrebbe essere installato -Italian.CustomPageLabel3=Scegli la modalità di installazione -Italian.CustomPageInstallMode=Installa {#MyAppName} su questo computer -Italian.CustomPageUpgradeMode=Aggiorna l'installazione esistente di {#MyAppName} -Italian.CustomPagePortableMode=Estrai tutti i file in una directory per uso portabile -Italian.RequiresWin7OrLater=Sandboxie-Plus richiede Windows 7 o superiore. -Italian.ClassicFound=È stata rilevata una installazione di Sandboxie Classic che potrebbe causare incompatibilità. Rimuoverla ora? -Italian.RunSandboxedMenu=Avvia nell'&area virtuale -Italian.UninstallTaskLabel1=Seleziona tipo di disinstallazione -Italian.UninstallTaskLabel2=Come vorresti disinstallare Sandboxie-Plus? -Italian.UninstallTaskLabel3=&Mantieni i file di configurazione e le aree virtuali%nSelezionare questa opzione se si prevede di reinstallare Sandboxie in un secondo momento, conservando le impostazioni e le aree virtuali. -Italian.UninstallTaskLabel4=Rimuovi i file di &configurazione%nSelezionare questa opzione per rimuovere i file di configurazione Sandboxie.ini e Sandboxie-Plus.ini, lasciando invariate le aree virtuali presenti. -Italian.UninstallTaskLabel5=Rimuovi i file di configurazione e le &aree virtuali%nSelezionare questa opzione per rimuovere tutti i file di configurazione e le aree virtuali, inclusa la cartella Sandbox nei percorsi personalizzati mediante FileRootPath. - -; Polish -polish.AddSandboxedMenu=Dodaj "Uruchom w piaskownicy" do menu kontekstowego -polish.CustomPageLabel1=Wybierz typ instalacji -polish.CustomPageLabel2=Jak należy instalować -polish.CustomPageLabel3=Wybierz tryb instalacji -polish.CustomPageInstallMode=Zainstaluj {#MyAppName} na tym komputerze -polish.CustomPageUpgradeMode=Aktualizacja istniejącej instalacji {#MyAppName} -polish.CustomPagePortableMode=Wypakuj wszystkie pliki do katalogu, aby użyć trybu przenośnego -polish.RequiresWin7OrLater=Sandboxie-Plus wymaga systemu Windows 7 lub nowszego. -polish.ClassicFound=Wykryto instalację Sandboxie Classic, która musi być najpierw odinstalowana, czy chcesz ją teraz odinstalować? -polish.RunSandboxedMenu=Uruchom w &Sandboxie -polish.UninstallTaskLabel1=Wybierz typ dezinstalacji -polish.UninstallTaskLabel2=W jaki sposób chcesz odinstalować Sandboxie-Plus? -polish.UninstallTaskLabel3=Zachowaj pliki &konfiguracyjne i piaskownice%nJest to najbardziej zalecana opcja, jeśli planujesz reinstalować Sandboxie-Plus, zachowując pliki konfiguracyjne i piaskownice. -polish.UninstallTaskLabel4=Usuń pliki konfigura&cyjne%nWybierz tę opcję, aby usunąć pliki konfiguracyjne Sandboxie.ini i Sandboxie-Plus.ini, zachowując piaskownice bez zmian. -polish.UninstallTaskLabel5=Usuń pliki konfiguracyjne i pia&skownice%nWybierz tę opcję, aby usunąć wszystkie pliki konfiguracyjne i piaskownice, w tym folder Sandbox znajdujący się w niestandardowych ścieżkach z FileRootPath. - -; Portuguese -portuguese.AddSandboxedMenu=Adicionar "Roda na Caixa de Areia" para o menu de contexto -portuguese.CustomPageLabel1=Selecione Tipo de Instalação -portuguese.CustomPageLabel2=Como deve ser instalado -portuguese.CustomPageLabel3=Escolha o modo de instalação -portuguese.CustomPageInstallMode=Instalar {#MyAppName} neste computador -portuguese.CustomPageUpgradeMode=Atualizar instalação existente do {#MyAppName} -portuguese.CustomPagePortableMode=Extrair todos os arquivos para um diretório para uso portable -portuguese.RequiresWin7OrLater=Sandboxie-Plus requer o Windows 7 ou posterior. -portuguese.ClassicFound=Instalação do Classic Sandboxie detectada, deve ser desinstalado primeiro, você quer desinstalá-lo agora? -portuguese.RunSandboxedMenu=Rodar na &Caixa de Areia -portuguese.UninstallTaskLabel1=Selecionar Tipo de Desinstalar -portuguese.UninstallTaskLabel2=Como você gostaria de desinstalar Sandboxie-Plus? -portuguese.UninstallTaskLabel3=&Manter os arquivos de configuração do sandboxes%nEsta é a opção mais recomendada se você planeja reinstalar o Sandboxie-Plus enquanto mantém seus arquivos de configuração e caixas de areia. -portuguese.UninstallTaskLabel4=&Remover arquivos de configuração%nSelecione essa opção para remover os arquivos de configuração Sandboxie.ini e Sandboxie-Plus.ini mantendo as caixas de areia inalteradas. -portuguese.UninstallTaskLabel5=Remover arquivos de configuração e &caixas de areia%nSelecione essa opção para remover todos os arquivos de configuração e caixas de areia, incluindo a pasta Sandbox localizada em caminhos personalizados com FileRootPath. - -; Russian -russian.AddSandboxedMenu=Добавить "Запустить в песочнице" в контекстное меню -russian.CustomPageLabel1=Выберите тип установки -russian.CustomPageLabel2=Как следует установить -russian.CustomPageLabel3=Выберите режим установки -russian.CustomPageInstallMode=Установить {#MyAppName} на этом компьютере -russian.CustomPageUpgradeMode=Обновить существующую установку {#MyAppName} -russian.CustomPagePortableMode=Извлечь все файлы в каталог для портативного использования -russian.RequiresWin7OrLater=Sandboxie-Plus требует Windows 7 или новее. -russian.ClassicFound=Обнаружена установка Sandboxie Classic, перед установкой ее необходимо удалить. Удалить сейчас? -russian.RunSandboxedMenu=Запустить в песочнице (&S) -russian.UninstallTaskLabel1=Выберите тип удаления -russian.UninstallTaskLabel2=Как вы хотите удалить Sandboxie-Plus? -russian.UninstallTaskLabel3=Сохранять файлы конфигурации и песочницы (&K)%nЭто наиболее рекомендуемый вариант, если вы планируете переустановить Sandboxie-Plus, сохранив файлы конфигурации и песочницы. -russian.UninstallTaskLabel4=Удалить файлы конфигурации (&C)%nВыберите этот параметр, чтобы удалить файлы конфигурации Sandboxie.ini и Sandboxie-Plus.ini, оставив файлы песочницы без изменений. -russian.UninstallTaskLabel5=Удалить файлы конфигурации и песочницы (&S)%nВыберите этот параметр, чтобы удалить все файлы конфигурации и песочницы, включая папку Sandbox, расположение которой заданно в FileRootPath. - -; Spanish -spanish.AddSandboxedMenu=Agregar "Ejecutar Aislado en una Sandbox" al menú contextual -spanish.CustomPageLabel1=Seleccione el tipo de instalación -spanish.CustomPageLabel2=¿Cómo se debe instalar? -spanish.CustomPageLabel3=Elija el modo de instalación -spanish.CustomPageInstallMode=Instalar {#MyAppName} en esta computadora -spanish.CustomPageUpgradeMode=Actualizar la instalación existente de {#MyAppName} -spanish.CustomPagePortableMode=Extraiga todos los archivos a un directorio para uso portátil -spanish.RequiresWin7OrLater=Sandboxie-Plus requiere Windows 7 o posterior. -spanish.ClassicFound=Se detectó la instalación de Sandboxie Classic, primero debe desinstalarse. ¿Quieres desinstalarlo ahora? -spanish.RunSandboxedMenu=&Ejecutar Aislado en una Sandbox -spanish.UninstallTaskLabel1=Seleccione el tipo de desinstalación -spanish.UninstallTaskLabel2=¿Cómo le gustaría desinstalar Sandboxie-Plus? -spanish.UninstallTaskLabel3=&Mantenga los archivos de configuración y las sandboxes%nEsta es la opción más recomendada si planea reinstalar Sandboxie-Plus mientras mantiene sus archivos de configuración y las sandboxes. -spanish.UninstallTaskLabel4=Eliminar archivos de &configuración%nSeleccione esta opción para eliminar los archivos de configuración Sandboxie.ini y Sandboxie-Plus.ini manteniendo las sandboxes sin cambios. -spanish.UninstallTaskLabel5=Eliminar archivos de configuración y las &sandboxes%nSeleccione esta opción para eliminar todos los archivos de configuración y las sandboxes, incluida la carpeta Sandbox ubicada en rutas personalizadas mediante FileRootPath. +; English is default language and can be translated to any +; of the languages listed in the languages section. +; The translations can be added to the CustomMessages section. +; The content of this script will be included by Sandboxie-Plus.iss, +; so please edit with care. + + +[Languages] + +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "ChineseSimplified"; MessagesFile: "isl\ChineseSimplified.isl" +Name: "ChineseTraditional"; MessagesFile: "isl\ChineseTraditional.isl" +Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" +Name: "Italian"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" +Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" +Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" +Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" +;Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" +;Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl" +;Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" +;Name: "bulgarian"; MessagesFile: "compiler:Languages\Bulgarian.isl" +;Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" +;Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl" +;Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" +;Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" +;Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl" +;Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" +;Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl" +;Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" +;Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" +;Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" +;Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" +;Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" + + +[CustomMessages] + +; English +english.AddSandboxedMenu=Add "Run Sandboxed" to context menu +english.CustomPageLabel1=Select Installation Type +english.CustomPageLabel2=How should be installed +english.CustomPageLabel3=Choose the installation mode +english.CustomPageInstallMode=Install {#MyAppName} on this computer +english.CustomPageUpgradeMode=Update existing {#MyAppName} installation +english.CustomPagePortableMode=Extract all files to a directory for portable use +english.RequiresWin7OrLater=Sandboxie-Plus requires Windows 7 or later. +english.ClassicFound=Sandboxie Classic installation detected, it must be uninstalled first, do you want to uninstall it now? +english.RunSandboxedMenu=Run &Sandboxed +english.UninstallTaskLabel1=Select Uninstall Type +english.UninstallTaskLabel2=How would you like to uninstall Sandboxie-Plus? +english.UninstallTaskLabel3=&Keep configuration files and sandboxes%nThis is the most recommended option if you plan to reinstall Sandboxie-Plus while keeping your configuration files and sandboxes. +english.UninstallTaskLabel4=Remove &configuration files%nSelect this option to remove the Sandboxie.ini and Sandboxie-Plus.ini configuration files while keeping the sandboxes unchanged. +english.UninstallTaskLabel5=Remove configuration files and &sandboxes%nSelect this option to remove all configuration files and sandboxes, including the Sandbox folder located in custom paths with FileRootPath. + +; Chinese Simplified +ChineseSimplified.AddSandboxedMenu=添加“在沙盘中运行”菜单 +ChineseSimplified.CustomPageLabel1=选择安装方式 +ChineseSimplified.CustomPageLabel2=应当如何安装 +ChineseSimplified.CustomPageLabel3=选择安装模式 +ChineseSimplified.CustomPageInstallMode=在这台计算机上安装 {#MyAppName} +ChineseSimplified.CustomPageUpgradeMode=更新当前已安装的 {#MyAppName} +ChineseSimplified.CustomPagePortableMode=提取全部文件到指定目录供便携化使用 +ChineseSimplified.RequiresWin7OrLater=Sandboxie-Plus 需要 Windows 7 或更高版本。 +ChineseSimplified.ClassicFound=检测到已安装 Sandboxie 原版,继续安装必须先将其卸载,是否开始卸载? +ChineseSimplified.RunSandboxedMenu=在沙盘中运行(&S) +ChineseSimplified.UninstallTaskLabel1=选择卸载方式 +ChineseSimplified.UninstallTaskLabel2=您想卸载 Sandboxie-Plus 到什么程度? +ChineseSimplified.UninstallTaskLabel3=保留配置文件和所有沙盘(&K)%n如果您是打算重新安装 Sandboxie-Plus,这是很好的选择,不会丢失您的配置文件和沙盘。 +ChineseSimplified.UninstallTaskLabel4=移除配置文件(&C)%n选择此选项将会移除 Sandboxie.ini 和 Sandboxie-Plus.ini 配置文件,但保留您的沙盘。 +ChineseSimplified.UninstallTaskLabel5=移除配置文件和所有沙盘(&S)%n选择此选项将会移除所有配置文件和沙盘,包括 FileRootPath 所定义的路径下的 Sandbox 文件夹。 + +; Chinese Traditional +ChineseTraditional.AddSandboxedMenu=加入「在沙箱中執行」選單 +ChineseTraditional.CustomPageLabel1=選擇安裝方式 +ChineseTraditional.CustomPageLabel2=應該如何安裝 +ChineseTraditional.CustomPageLabel3=選擇安裝模式 +ChineseTraditional.CustomPageInstallMode=在這台電腦上安裝 {#MyAppName} +ChineseTraditional.CustomPageUpgradeMode=更新目前已安裝的 {#MyAppName} +ChineseTraditional.CustomPagePortableMode=解壓縮所有檔案到指定目錄供便攜化使用 +ChineseTraditional.RequiresWin7OrLater=Sandboxie-Plus 需要 Windows 7 或更高版本。 +ChineseTraditional.ClassicFound=偵測到已安裝 Sandboxie 原版,要繼續安裝必須先將其移除,是否開始移除? +ChineseTraditional.RunSandboxedMenu=在沙箱中執行(&S) +ChineseTraditional.UninstallTaskLabel1=選擇移除類型 +ChineseTraditional.UninstallTaskLabel2=要如何移除 Sandboxie-Plus? +ChineseTraditional.UninstallTaskLabel3=保留設定檔和沙箱(&K)%n如果您打算保留設定檔和沙箱的同時,並重新安裝 Sandboxie-Plus,這是最推薦的選項。 +ChineseTraditional.UninstallTaskLabel4=刪除設定檔案(&C)%n選擇此選項可刪除 Sandboxie.ini 和 Sandboxie-Plus.ini 設定檔,並完整保留沙箱。 +ChineseTraditional.UninstallTaskLabel5=刪除設定檔和沙箱(&S)%n選擇此選項可刪除所有設定檔和沙箱,包含位於 FileRootPath 自訂路徑中的 Sandbox 資料夾。 + +; Dutch +dutch.AddSandboxedMenu="In sandbox uitvoeren" aan contextmenu toevoegen +dutch.CustomPageLabel1=Installatietype selecteren +dutch.CustomPageLabel2=Hoe moet er geïnstalleerd worden +dutch.CustomPageLabel3=Installatiemodus kiezen +dutch.CustomPageInstallMode={#MyAppName} op deze computer installeren +dutch.CustomPageUpgradeMode=Bestaande installatie van {#MyAppName} bijwerken +dutch.CustomPagePortableMode=Alle bestanden naar een map uitpakken voor draagbaar gebruik +dutch.RequiresWin7OrLater=Sandboxie-Plus vereist Windows 7 of later. +dutch.ClassicFound=Installatie van Sandboxie Classic gedetecteerd. Het moet eerst verwijderd worden. Wilt u het nu verwijderen? +dutch.RunSandboxedMenu=In &sandbox uitvoeren +dutch.UninstallTaskLabel1=Type verwijdering selecteren +dutch.UninstallTaskLabel2=Hoe wilt u Sandboxie-Plus verwijderen? +dutch.UninstallTaskLabel3=Configuratiebestanden en sandboxen behouden%nDit is de aanbevolen optie als u Sandboxie-Plus opnieuw wilt installeren en uw configuratiebestanden en sandboxen wilt behouden. +dutch.UninstallTaskLabel4=Configuratiebestanden verwijderen%nSelecteer deze optie om de configuratiebestanden Sandboxie.ini en Sandboxie-Plus.ini wilt verwijderen en de sandboxen ongewijzigd wilt laten. +dutch.UninstallTaskLabel5=Configuratiebestanden en sandboxen verwijderen%nSelecteer deze optie om alle configuratiebestanden en sandboxen te verwijderen, inclusief de Sandbox-map die zich in aangepaste paden met FileRootPath bevindt. + +; French +french.AddSandboxedMenu=Ajouter « Exécuter dans un bac à sable » au menu contextuel +french.CustomPageLabel1=Sélectionnez le type d'installation +french.CustomPageLabel2=Comment doit-on l'installer +french.CustomPageLabel3=Choisissez le mode d'installation +french.CustomPageInstallMode=Installer {#MyAppName} sur cet ordinateur +french.CustomPageUpgradeMode=Mettre à jour l'installation de {#MyAppName} existante +french.CustomPagePortableMode=Extraire tous les fichiers dans un répertoire pour une utilisation portable +french.RequiresWin7OrLater=Sandboxie-Plus nécessite Windows 7 ou une version ultérieure. +french.ClassicFound=Installation de Sandboxie Classic détectée, il doit être désinstallé d'abord, voulez-vous le désinstaller maintenant ? +french.RunSandboxedMenu=Exécuter dans un &bac à sable +french.UninstallTaskLabel1=Sélectionnez le type de désinstallation +french.UninstallTaskLabel2=Comment voulez-vous désinstaller Sandboxie-Plus ? +french.UninstallTaskLabel3=&Conserver les fichiers de configuration et les bacs à sable%nCette option est la plus recommandée si vous prévoyez de réinstaller Sandboxie-Plus tout en conservant vos fichiers de configuration et vos bacs à sable. +french.UninstallTaskLabel4=Supprimer les &fichiers de configuration%nSélectionnez cette option pour supprimer les fichiers de configuration « Sandboxie.ini » et « Sandboxie-Plus.ini » tout en conservant les bacs à sable inchangés. +french.UninstallTaskLabel5=Supprimer les fichiers de configuration et les &bacs à sable%nSélectionnez cette option pour supprimer tous les fichiers de configuration et les bacs à sable, y compris le dossier « Sandbox » situé dans les chemins personnalisés avec « FileRootPath ». + +; German +german.AddSandboxedMenu=Füge "In Sandbox ausführen" zum Kontextmenü hinzu +german.CustomPageLabel1=Wählen Sie die Installationsart aus +german.CustomPageLabel2=Wie soll installiert werden +german.CustomPageLabel3=Wählen Sie die Installationsmethode +german.CustomPageInstallMode=Installiere {#MyAppName} auf diesem Computer +german.CustomPageUpgradeMode=Update der bestehenden {#MyAppName} Installation +german.CustomPagePortableMode=Extrahiere alle Dateien in einen Ordner zur tragbaren Verwendung +german.RequiresWin7OrLater=Sandboxie-Plus benötigt Windows 7 oder neuer. +german.ClassicFound=Sandboxie Classic Installation gefunden, welche vorher deinstalliert werden muss. Möchten Sie diese nun deinstallieren? +german.RunSandboxedMenu=In &Sandbox ausführen +german.UninstallTaskLabel1=Wählen Sie die De-Installationsart aus +german.UninstallTaskLabel2=Wie möchten Sie Sandboxie-Plus de-installieren? +german.UninstallTaskLabel3=&Konfiguration und Sandboxen behalten%nDies ist die empfohlene Option, wenn Sie vorhaben Sandboxie-Plus erneut zu intallieren, während Sandboxie-Plus alle Sandboxen und Konfigurationsdateien behält. +german.UninstallTaskLabel4=&Entferne die Konfiguration%nWählen Sie diese Option um die Sandboxie.ini und Sandboxie-Plus.ini Dateien zu entfernen, während die Sandboxen unverändert bleiben. +german.UninstallTaskLabel5=Entferne die Konfiguration und alle &Sandboxen%nWählen Sie diese Option um alle Konfigurationsdateien und alle Sandboxen, inklusive des Sandboxordners im, durch die Dateisystemquelle, benutzerdefinierten Pfad. + +; Italian +Italian.AddSandboxedMenu=Aggiungi l'opzione "Avvia nell'area virtuale" al menu contestuale +Italian.CustomPageLabel1=Seleziona tipo di installazione +Italian.CustomPageLabel2=Come dovrebbe essere installato +Italian.CustomPageLabel3=Scegli la modalità di installazione +Italian.CustomPageInstallMode=Installa {#MyAppName} su questo computer +Italian.CustomPageUpgradeMode=Aggiorna l'installazione esistente di {#MyAppName} +Italian.CustomPagePortableMode=Estrai tutti i file in una directory per uso portabile +Italian.RequiresWin7OrLater=Sandboxie-Plus richiede Windows 7 o superiore. +Italian.ClassicFound=È stata rilevata una installazione di Sandboxie Classic che potrebbe causare incompatibilità. Rimuoverla ora? +Italian.RunSandboxedMenu=Avvia nell'&area virtuale +Italian.UninstallTaskLabel1=Seleziona tipo di disinstallazione +Italian.UninstallTaskLabel2=Come vorresti disinstallare Sandboxie-Plus? +Italian.UninstallTaskLabel3=&Mantieni i file di configurazione e le aree virtuali%nSelezionare questa opzione se si prevede di reinstallare Sandboxie in un secondo momento, conservando le impostazioni e le aree virtuali. +Italian.UninstallTaskLabel4=Rimuovi i file di &configurazione%nSelezionare questa opzione per rimuovere i file di configurazione Sandboxie.ini e Sandboxie-Plus.ini, lasciando invariate le aree virtuali presenti. +Italian.UninstallTaskLabel5=Rimuovi i file di configurazione e le &aree virtuali%nSelezionare questa opzione per rimuovere tutti i file di configurazione e le aree virtuali, inclusa la cartella Sandbox nei percorsi personalizzati mediante FileRootPath. + +; Polish +polish.AddSandboxedMenu=Dodaj "Uruchom w piaskownicy" do menu kontekstowego +polish.CustomPageLabel1=Wybierz typ instalacji +polish.CustomPageLabel2=Jak należy instalować +polish.CustomPageLabel3=Wybierz tryb instalacji +polish.CustomPageInstallMode=Zainstaluj {#MyAppName} na tym komputerze +polish.CustomPageUpgradeMode=Aktualizacja istniejącej instalacji {#MyAppName} +polish.CustomPagePortableMode=Wypakuj wszystkie pliki do katalogu, aby użyć trybu przenośnego +polish.RequiresWin7OrLater=Sandboxie-Plus wymaga systemu Windows 7 lub nowszego. +polish.ClassicFound=Wykryto instalację Sandboxie Classic, która musi być najpierw odinstalowana, czy chcesz ją teraz odinstalować? +polish.RunSandboxedMenu=Uruchom w &Sandboxie +polish.UninstallTaskLabel1=Wybierz typ dezinstalacji +polish.UninstallTaskLabel2=W jaki sposób chcesz odinstalować Sandboxie-Plus? +polish.UninstallTaskLabel3=Zachowaj pliki &konfiguracyjne i piaskownice%nJest to najbardziej zalecana opcja, jeśli planujesz reinstalować Sandboxie-Plus, zachowując pliki konfiguracyjne i piaskownice. +polish.UninstallTaskLabel4=Usuń pliki konfigura&cyjne%nWybierz tę opcję, aby usunąć pliki konfiguracyjne Sandboxie.ini i Sandboxie-Plus.ini, zachowując piaskownice bez zmian. +polish.UninstallTaskLabel5=Usuń pliki konfiguracyjne i pia&skownice%nWybierz tę opcję, aby usunąć wszystkie pliki konfiguracyjne i piaskownice, w tym folder Sandbox znajdujący się w niestandardowych ścieżkach z FileRootPath. + +; Portuguese +portuguese.AddSandboxedMenu=Adicionar "Roda na Caixa de Areia" para o menu de contexto +portuguese.CustomPageLabel1=Selecione Tipo de Instalação +portuguese.CustomPageLabel2=Como deve ser instalado +portuguese.CustomPageLabel3=Escolha o modo de instalação +portuguese.CustomPageInstallMode=Instalar {#MyAppName} neste computador +portuguese.CustomPageUpgradeMode=Atualizar instalação existente do {#MyAppName} +portuguese.CustomPagePortableMode=Extrair todos os arquivos para um diretório para uso portable +portuguese.RequiresWin7OrLater=Sandboxie-Plus requer o Windows 7 ou posterior. +portuguese.ClassicFound=Instalação do Classic Sandboxie detectada, deve ser desinstalado primeiro, você quer desinstalá-lo agora? +portuguese.RunSandboxedMenu=Rodar na &Caixa de Areia +portuguese.UninstallTaskLabel1=Selecionar Tipo de Desinstalar +portuguese.UninstallTaskLabel2=Como você gostaria de desinstalar Sandboxie-Plus? +portuguese.UninstallTaskLabel3=&Manter os arquivos de configuração do sandboxes%nEsta é a opção mais recomendada se você planeja reinstalar o Sandboxie-Plus enquanto mantém seus arquivos de configuração e caixas de areia. +portuguese.UninstallTaskLabel4=&Remover arquivos de configuração%nSelecione essa opção para remover os arquivos de configuração Sandboxie.ini e Sandboxie-Plus.ini mantendo as caixas de areia inalteradas. +portuguese.UninstallTaskLabel5=Remover arquivos de configuração e &caixas de areia%nSelecione essa opção para remover todos os arquivos de configuração e caixas de areia, incluindo a pasta Sandbox localizada em caminhos personalizados com FileRootPath. + +; Russian +russian.AddSandboxedMenu=Добавить "Запустить в песочнице" в контекстное меню +russian.CustomPageLabel1=Выберите тип установки +russian.CustomPageLabel2=Как следует установить +russian.CustomPageLabel3=Выберите режим установки +russian.CustomPageInstallMode=Установить {#MyAppName} на этом компьютере +russian.CustomPageUpgradeMode=Обновить существующую установку {#MyAppName} +russian.CustomPagePortableMode=Извлечь все файлы в каталог для портативного использования +russian.RequiresWin7OrLater=Sandboxie-Plus требует Windows 7 или новее. +russian.ClassicFound=Обнаружена установка Sandboxie Classic, перед установкой ее необходимо удалить. Удалить сейчас? +russian.RunSandboxedMenu=Запустить в песочнице (&S) +russian.UninstallTaskLabel1=Выберите тип удаления +russian.UninstallTaskLabel2=Как вы хотите удалить Sandboxie-Plus? +russian.UninstallTaskLabel3=Сохранять файлы конфигурации и песочницы (&K)%nЭто наиболее рекомендуемый вариант, если вы планируете переустановить Sandboxie-Plus, сохранив файлы конфигурации и песочницы. +russian.UninstallTaskLabel4=Удалить файлы конфигурации (&C)%nВыберите этот параметр, чтобы удалить файлы конфигурации Sandboxie.ini и Sandboxie-Plus.ini, оставив файлы песочницы без изменений. +russian.UninstallTaskLabel5=Удалить файлы конфигурации и песочницы (&S)%nВыберите этот параметр, чтобы удалить все файлы конфигурации и песочницы, включая папку Sandbox, расположение которой заданно в FileRootPath. + +; Spanish +spanish.AddSandboxedMenu=Agregar "Ejecutar Aislado en una Sandbox" al menú contextual +spanish.CustomPageLabel1=Seleccione el tipo de instalación +spanish.CustomPageLabel2=¿Cómo se debe instalar? +spanish.CustomPageLabel3=Elija el modo de instalación +spanish.CustomPageInstallMode=Instalar {#MyAppName} en esta computadora +spanish.CustomPageUpgradeMode=Actualizar la instalación existente de {#MyAppName} +spanish.CustomPagePortableMode=Extraiga todos los archivos a un directorio para uso portátil +spanish.RequiresWin7OrLater=Sandboxie-Plus requiere Windows 7 o posterior. +spanish.ClassicFound=Se detectó la instalación de Sandboxie Classic, primero debe desinstalarse. ¿Quieres desinstalarlo ahora? +spanish.RunSandboxedMenu=&Ejecutar Aislado en una Sandbox +spanish.UninstallTaskLabel1=Seleccione el tipo de desinstalación +spanish.UninstallTaskLabel2=¿Cómo le gustaría desinstalar Sandboxie-Plus? +spanish.UninstallTaskLabel3=&Mantenga los archivos de configuración y las sandboxes%nEsta es la opción más recomendada si planea reinstalar Sandboxie-Plus mientras mantiene sus archivos de configuración y las sandboxes. +spanish.UninstallTaskLabel4=Eliminar archivos de &configuración%nSeleccione esta opción para eliminar los archivos de configuración Sandboxie.ini y Sandboxie-Plus.ini manteniendo las sandboxes sin cambios. +spanish.UninstallTaskLabel5=Eliminar archivos de configuración y las &sandboxes%nSeleccione esta opción para eliminar todos los archivos de configuración y las sandboxes, incluida la carpeta Sandbox ubicada en rutas personalizadas mediante FileRootPath. diff --git a/Installer/Sandboxie-Plus.iss b/Installer/Sandboxie-Plus.iss index d29b29d5..66520053 100644 --- a/Installer/Sandboxie-Plus.iss +++ b/Installer/Sandboxie-Plus.iss @@ -1,537 +1,537 @@ -#define MyAppName "Sandboxie-Plus" -#include "Languages.iss" - -; Use commandline to populate: -; ISCC.exe /ORelease Sandboxie-Plus.iss /DMyAppVersion=%SbiePlusVer% /DMyAppArch=x64 /DMyAppSrc=SbiePlus64 -; -;#define MyAppVersion "0.7.5" -;#define MyDrvVersion "5.49.8" -;#define MyAppArch "x64" -;#define MyAppSrc "SbiePlus64" - - -[Setup] -AppName={#MyAppName} -AppVerName={#MyAppName} v{#MyAppVersion} -AppId=Sandboxie-Plus -AppVersion={#MyAppVersion} -AppPublisher=http://xanasoft.com/ -AppPublisherURL=http://sandboxie-plus.com/ -AppMutex=SBIEPLUS_MUTEX -DefaultDirName={code:InstallPath} -DefaultGroupName={#MyAppName} -Uninstallable=not IsPortable -UninstallDisplayIcon={app}\SandMan.exe -OutputBaseFilename={#MyAppName}-{#MyAppArch}-v{#MyAppVersion} -Compression=lzma -ArchitecturesAllowed={#MyAppArch} -ArchitecturesInstallIn64BitMode=x64 -AllowNoIcons=yes -AlwaysRestart=no -LicenseFile=.\license.txt -UsedUserAreasWarning=no -VersionInfoCopyright=Copyright (C) 2020-2021 by David Xanatos (xanasoft.com) -VersionInfoVersion={#MyAppVersion} - -; Handled in code section as always want DirPage for portable mode. -DisableDirPage=no - -; Allow /CURRENTUSER to be used with /PORTABLE=1 to avoid admin requirement. -PrivilegesRequiredOverridesAllowed=commandline - - -[Tasks] -Name: "DesktopIcon"; Description: "{cm:CreateDesktopIcon}"; MinVersion: 0.0,5.0; Check: not IsPortable -Name: "AutoStartEntry"; Description: "{cm:AutoStartProgram,{#MyAppName}}"; MinVersion: 0.0,5.0; Check: not IsPortable -Name: "AddRunSandboxed"; Description: "{cm:AddSandboxedMenu}"; MinVersion: 0.0,5.0; Check: not IsPortable - - -[Files] -; Both portable and install. -Source: ".\Release\{#MyAppSrc}\*"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: recursesubdirs ignoreversion; Excludes: "*.pdb" - -; Only if portable. -Source: ".\Sandboxie.ini"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist; Check: IsPortable -Source: ".\Sandboxie-Plus.ini"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist; Check: IsPortable - - -[Icons] -Name: "{group}\Sandboxie-Plus"; Filename: "{app}\SandMan.exe"; MinVersion: 0.0,5.0 -Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "http://sandboxie-plus.com/"; MinVersion: 0.0,5.0 -Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; MinVersion: 0.0,5.0 -Name: "{userdesktop}\Sandboxie-Plus"; Filename: "{app}\SandMan.exe"; Tasks: DesktopIcon; MinVersion: 0.0,5.0 - - -[INI] -; Set Sandman language. -Filename: "{localappdata}\{#MyAppName}\{#MyAppName}.ini"; Section: "Options"; Key: "UiLanguage"; String: "{code:SandmanLanguage|{language}}"; Check: not IsPortable -Filename: "{app}\{#MyAppName}.ini"; Section: "Options"; Key: "UiLanguage"; String: "{code:SandmanLanguage|{language}}"; Check: IsPortable - - -[Registry] -; Autostart Sandman. -Root: HKCU; Subkey: "Software\Software\Microsoft\Windows\CurrentVersion\Run"; ValueName: "SandboxiePlus_AutoRun"; ValueType: string; ValueData: """{app}\SandMan.exe"" -autorun"; Flags: uninsdeletevalue; Tasks: AutoStartEntry - -; AddRunSandboxed all files. -Root: HKCU; Subkey: "Software\Classes\*\shell\sandbox"; ValueName: ""; ValueType: string; ValueData: "{cm:RunSandboxedMenu}"; Flags: uninsdeletekey; Tasks: AddRunSandboxed -Root: HKCU; Subkey: "Software\Classes\*\shell\sandbox"; ValueName: "Icon"; ValueType: string; ValueData: """{app}\start.exe"""; Tasks: AddRunSandboxed -Root: HKCU; Subkey: "Software\Classes\*\shell\sandbox\command"; ValueName: ""; ValueType: string; ValueData: """{app}\SandMan.exe"" /box:__ask__ ""%1"" %*"; Tasks: AddRunSandboxed - -; AddRunSandboxed folder. -Root: HKCU; Subkey: "Software\Classes\Folder\shell\sandbox"; ValueName: ""; ValueType: string; ValueData: "{cm:RunSandboxedMenu}"; Flags: uninsdeletekey; Tasks: AddRunSandboxed -Root: HKCU; Subkey: "Software\Classes\Folder\shell\sandbox"; ValueName: "Icon"; ValueType: string; ValueData: """{app}\start.exe"""; Tasks: AddRunSandboxed -Root: HKCU; Subkey: "Software\Classes\Folder\shell\sandbox\command"; ValueName: ""; ValueType: string; ValueData: """{app}\SandMan.exe"" /box:__ask__ ""%1"" %*"; Tasks: AddRunSandboxed - -; External manifest for Sbie service. -Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\SbieSvc"; ValueName: "PreferExternalManifest"; ValueType: dword; ValueData: "1"; Check: not IsPortable - -; Set language for Sbie service. -Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\SbieSvc"; ValueType: dword; ValueName: "Language"; ValueData: "{code:SystemLanguage}"; Check: not IsPortable - - -[Run] -; Install the Sbie driver. -Filename: "{app}\KmdUtil.exe"; Parameters: "install SbieDrv ""{app}\SbieDrv.sys"" type=kernel start=demand msgfile=""{app}\SbieMsg.dll"" altitude=86900"; StatusMsg: "KmdUtil install SbieDrv..."; Check: not IsPortable - -; Install the Sbie service. -Filename: "{app}\KmdUtil.exe"; Parameters: "install SbieSvc ""{app}\SbieSvc.exe"" type=own start=auto msgfile=""{app}\SbieMsg.dll"" display=""Sandboxie Service"" group=UIGroup"; StatusMsg: "KmdUtil install SbieSvc..."; Check: not IsPortable - -; Start the Sbie service. -Filename: "{app}\KmdUtil.exe"; Parameters: "start SbieSvc"; StatusMsg: "KmdUtil start SbieSvc"; Check: not IsPortable - -; Start the Sandman UI. -;Filename: "{app}\SandMan.exe"; Parameters: "-autorun"; StatusMsg: "Launch SandMan UI..."; Flags: postinstall nowait; Check: not IsPortable -Filename: "{app}\SandMan.exe"; Parameters: "-autorun"; StatusMsg: "Launch SandMan UI..."; Flags: nowait; Check: not IsPortable - - -[UninstallDelete] -Type: files; Name: "{app}\SbieDrv.sys.w10" -Type: files; Name: "{app}\SbieDrv.sys.rc4" -Type: dirifempty; Name: "{app}" -Type: dirifempty; Name: "{localappdata}\{#MyAppName}" - - -[Messages] -; Include with commandline /? message. -HelpTextNote=/PORTABLE=1%nEnable portable mode.%n - - -[Code] -var - CustomPage: TInputOptionWizardPage; - IsInstalled: Boolean; - Portable: Boolean; - - -function IsPortable(): Boolean; -begin - - // Return True or False for the value of Check. - if (ExpandConstant('{param:portable|0}') = '1') or Portable then begin - Result := True; - end; -end; - - -function IsUpgrade(): Boolean; -var - S: String; - InnoSetupReg: String; - AppPathName: String; -begin - - // Detect if already installed. - // Source: https://stackoverflow.com/a/30568071 - InnoSetupReg := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppName")}_is1'); - AppPathName := 'Inno Setup: App Path'; - - Result := RegQueryStringValue(HKLM, InnoSetupReg, AppPathName, S) or - RegQueryStringValue(HKCU, InnoSetupReg, AppPathName, S); -end; - - -function InstallPath(Dummy: String): String; -var - DrvPath: String; - SbiePath: String; -begin - - // Return the path to use for the value of DefaultDirName. - IsInstalled := False; - SbiePath := ExpandConstant('{param:dir}'); - - if SbiePath = '' then begin - if (ExpandConstant('{param:portable|0}') = '1') or Portable then begin - SbiePath := ExpandConstant('{src}') + '\{#MyAppName}'; - end else begin - if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Services\SbieDrv', 'ImagePath', DrvPath) then begin - IsInstalled := True; - DrvPath := ExtractFilePath(DrvPath); - - if Copy(DrvPath, 1, 4) = '\??\' then begin - DrvPath := Copy(DrvPath, 5, Length(DrvPath) - 5); - end; - - SbiePath := DrvPath; - end else begin - SbiePath := ExpandConstant('{autopf}') + '\{#MyAppName}'; - end; - end; - end; - - Result := SbiePath; -end; - - -function SandmanLanguage(Language: String): String; -begin - - // Language values for Sandboxie-Plus.ini. - case Lowercase(Language) of - 'english': Result := 'en'; - 'chinesesimplified': Result := 'zh-CN'; - 'chinesetraditional': Result := 'zh-TW'; - 'dutch': Result := 'nl'; - 'french': Result := 'fr'; - 'german': Result := 'de'; - 'italian': Result := 'it'; - 'polish': Result := 'pl'; - 'portuguese': Result := 'pt'; - 'russian': Result := 'ru'; - 'spanish': Result := 'es'; - 'turkish': Result := 'tr'; - end; -end; - - -function SystemLanguage(Dummy: String): String; -begin - - // Language identifier for the System Eventlog messages. - Result := IntToStr(GetUILanguage()); -end; - - -procedure UpdateStatus(OutputProgressPage: TOutputProgressWizardPage; Text: String; Percentage: Integer); -begin - - // Called by ShutdownSbie() to update status or progress. - if IsUninstaller() then - UninstallProgressForm.StatusLabel.Caption := Text - else begin - OutputProgressPage.SetProgress(Percentage, 100); - OutputProgressPage.SetText(Text, ''); - end; - - // Output status information to log. - Log('Debug: ' + Text); -end; - - -function ShutdownSbie(): Boolean; -var - ExecRet: Integer; - StatusText: String; - OutputProgressPage: TOutputProgressWizardPage; -begin - - // Require KmdUtil.exe to continue. - if (FileExists(ExpandConstant('{app}\KmdUtil.exe')) = False) then - begin - Result := True; - exit; - end; - - try - - // Backup status text (uninstall). Prepare progress page (install). - if IsUninstaller() then - StatusText := UninstallProgressForm.StatusLabel.Caption - else begin - OutputProgressPage := CreateOutputProgressPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc)); - OutputProgressPage.Show(); - end; - - // Run KmdUtil scandll. - UpdateStatus(OutputProgressPage, 'KmdUtil scandll', 5); - Exec(ExpandConstant('{app}\KmdUtil.exe'), 'scandll', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); - - if (ExecRet <> 0) then - begin - Result := False; - exit; - end; - - // Stop processes. - UpdateStatus(OutputProgressPage, 'Taskkill /IM Sandman.exe /IM SbieCtrl.exe /IM Start.exe /F', 30); - Exec(ExpandConstant('{sys}\taskkill.exe'), '/IM Sandman.exe /IM SbieCtrl.exe /IM Start.exe /F', '', SW_HIDE, ewWaitUntilTerminated, ExecRet); - - // Stop service and driver. - UpdateStatus(OutputProgressPage, 'KmdUtil stop SbieSvc', 55); - Exec(ExpandConstant('{app}\KmdUtil.exe'), 'stop SbieSvc', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); - - UpdateStatus(OutputProgressPage, 'KmdUtil stop SbieDrv', 85); - Exec(ExpandConstant('{app}\KmdUtil.exe'), 'stop SbieDrv', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); - - // Uninstall service and driver. - UpdateStatus(OutputProgressPage, 'KmdUtil delete SbieSvc', 95); - Exec(ExpandConstant('{app}\KmdUtil.exe'), 'delete SbieSvc', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); - - UpdateStatus(OutputProgressPage, 'KmdUtil delete SbieDrv', 100); - Exec(ExpandConstant('{app}\KmdUtil.exe'), 'delete SbieDrv', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); - - // Query driver which can remove SbieDrv key if exist. - if RegKeyExists(HKLM, 'SYSTEM\CurrentControlSet\services\SbieDrv') then begin - UpdateStatus(OutputProgressPage, 'SC query SbieDrv', 100); - Exec(ExpandConstant('{sys}\sc.exe'), 'query SbieDrv', '', SW_HIDE, ewWaitUntilTerminated, ExecRet); - end; - finally - - // Restore status text (uninstall). Hide Prepare progress page (install). - if IsUninstaller() then - UninstallProgressForm.StatusLabel.Caption := StatusText - else begin - OutputProgressPage.SetProgress(0, 100); - OutputProgressPage.Hide(); - end; - end; - - Result := True; -end; - - -////////////////////////////////////////////////////// -// Installation Events -// - - -function NextButtonClick(CurPageID: Integer): Boolean; -begin - - // Get mode setting from Custom page and set path for the Dir page. - if CurPageID = CustomPage.ID then begin - Portable := not (CustomPage.SelectedValueIndex = 0); - WizardForm.DirEdit.Text := InstallPath(''); - - // No Start Menu folder setting on Ready page if portable. - if Portable then begin - WizardForm.NoIconsCheck.Checked := True; - end else begin - WizardForm.NoIconsCheck.Checked := False; - end; - end; - - // Shutdown service, driver and processes as ready to install. - if ((CurPageID = wpReady) and (not IsPortable())) then - begin - Result := ShutdownSbie(); - exit; - end; - - Result := True; -end; - - -function ShouldSkipPage(PageID: Integer): Boolean; -begin - - // Skip Custom page and Group page if portable. - if PageID = CustomPage.ID then begin - if ExpandConstant('{param:portable|0}') = '1' then - Result := True; - end else if PageID = wpSelectDir then begin - if not IsPortable and IsUpgrade then - Result := True; - end else if PageID = wpSelectProgramGroup then begin - if IsPortable then - Result := True; - end; -end; - - -procedure InitializeWizard(); -begin - - // Create the custom page. - // Source: https://timesheetsandstuff.wordpress.com/2008/06/27/the-joy-of-part-2/ - CustomPage := CreateInputOptionPage(wpLicense, - CustomMessage('CustomPageLabel1'), - CustomMessage('CustomPageLabel2'), - CustomMessage('CustomPageLabel3'), True, False); - - if IsInstalled = True then begin - CustomPage.Add(CustomMessage('CustomPageUpgradeMode')); - end else begin - CustomPage.Add(CustomMessage('CustomPageInstallMode')); - end; - - CustomPage.Add(CustomMessage('CustomPagePortableMode')); - - // Default to Normal Installation if not argument /PORTABLE=1. - if ExpandConstant('{param:portable|0}') = '1' then begin - WizardForm.NoIconsCheck.Checked := True; - CustomPage.SelectedValueIndex := 1; - end else begin - CustomPage.SelectedValueIndex := 0; - end; -end; - - -function InitializeSetup(): Boolean; -var - Version: TWindowsVersion; - ExecRet: Integer; - UninstallString: String; -begin - - // Require Windows 7 or later. - GetWindowsVersionEx(Version); - - if (Version.NTPlatform = False) or (Version.Major < 6) then - begin - SuppressibleMsgBox(CustomMessage('RequiresWin7OrLater'), mbError, MB_OK, MB_OK); - Result := False; - exit; - end; - - // Ask to uninstall Sandboxie Classic if found. - ExecRet := IDYES; - - while (ExecRet = IDYES) do - begin - if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sandboxie', 'UninstallString', UninstallString) then begin - - ExecRet := MsgBox(CustomMessage('ClassicFound'), mbConfirmation, MB_YESNOCANCEL); - - if ExecRet = IDCANCEL then - begin - Result := False; - exit; - end; - - if ExecRet = IDYES then - begin - Exec('cmd.exe', '/c ' + UninstallString, '', SW_HIDE, ewWaitUntilTerminated, ExecRet); - ExecRet := IDYES; - end; - - end else begin - break; - end; - end; - - Result := True; -end; - - -////////////////////////////////////////////////////// -// Uninstallation Exclusive -// - - -procedure UninstallCleanup(ButtonCount: Integer); -var - Buttons: Cardinal; - ButtonLabels: TArrayOfString; - ExecRet: Integer; - I: Integer; - Paths: TStringList; - ShowMsgbox: Boolean; - TaskRet: Integer; -begin - - // Require 2 or 3 for button count. - if (ButtonCount < 2) or (ButtonCount > 3) then - exit; - - // Require Sandman.exe to continue. - if not FileExists(ExpandConstant('{app}\Sandman.exe')) then - exit; - - // Make a list. - Paths := TStringList.Create; - - // Append file paths to the list for removal. - Paths.Append('{localappdata}\{#MyAppName}\{#MyAppName}.ini'); - Paths.Append('{win}\Sandboxie.ini'); - Paths.Append('{app}\{#MyAppName}.ini'); - Paths.Append('{app}\Sandboxie.ini'); - - // Expand paths and detect if any file exist. - for I := 0 to Paths.Count - 1 do begin - Paths[I] := ExpandConstant(Paths[I]); - - if FileExists(Paths[I]) then - ShowMsgbox := True; - end; - - // Delete the config files and the sandboxes. - if ShowMsgbox then begin - case ButtonCount of - 2: begin - Buttons := MB_YESNO; - ButtonLabels := [CustomMessage('UninstallTaskLabel3'), - CustomMessage('UninstallTaskLabel4')]; - end; - - 3: begin - Buttons := MB_ABORTRETRYIGNORE; - ButtonLabels := [CustomMessage('UninstallTaskLabel3'), - CustomMessage('UninstallTaskLabel4'), - CustomMessage('UninstallTaskLabel5')]; - end; - end; - - case TaskDialogMsgBox(CustomMessage('UninstallTaskLabel1'), - CustomMessage('UninstallTaskLabel2'), - mbConfirmation, Buttons, ButtonLabels, 0) of - - IDRETRY: TaskRet := 1; - IDIGNORE: TaskRet := 2; - IDABORT: TaskRet := 3; - IDYES: TaskRet := 1; - IDNO: TaskRet := 2; - end; - - if TaskRet > 2 then begin - Log('Debug: Sandman /RemoveSandboxes'); - Exec(ExpandConstant('{app}\Sandman.exe'), '/RemoveSandboxes', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); - end; - - if TaskRet > 1 then begin - for I := 0 to Paths.Count - 1 do - if FileExists(Paths[I]) then begin - Log('Debug: DeleteFile(' + Paths[I] + ')'); - DeleteFile(Paths[I]); - end; - end; - end; - - // Release the list. - Paths.Free; -end; - - -////////////////////////////////////////////////////// -// Uninstallation Events -// - - -procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); -begin - - // Before the uninstallation. - if (CurUninstallStep <> usUninstall) then - exit; - - // User to confirm extra files to remove. - if not UninstallSilent then - UninstallCleanup(2); - - // Shutdown service, driver and processes. - if (ShutdownSbie() = False) then - begin - Abort(); - exit; - end; -end; +#define MyAppName "Sandboxie-Plus" +#include "Languages.iss" + +; Use commandline to populate: +; ISCC.exe /ORelease Sandboxie-Plus.iss /DMyAppVersion=%SbiePlusVer% /DMyAppArch=x64 /DMyAppSrc=SbiePlus64 +; +;#define MyAppVersion "0.7.5" +;#define MyDrvVersion "5.49.8" +;#define MyAppArch "x64" +;#define MyAppSrc "SbiePlus64" + + +[Setup] +AppName={#MyAppName} +AppVerName={#MyAppName} v{#MyAppVersion} +AppId=Sandboxie-Plus +AppVersion={#MyAppVersion} +AppPublisher=http://xanasoft.com/ +AppPublisherURL=http://sandboxie-plus.com/ +AppMutex=SBIEPLUS_MUTEX +DefaultDirName={code:InstallPath} +DefaultGroupName={#MyAppName} +Uninstallable=not IsPortable +UninstallDisplayIcon={app}\SandMan.exe +OutputBaseFilename={#MyAppName}-{#MyAppArch}-v{#MyAppVersion} +Compression=lzma +ArchitecturesAllowed={#MyAppArch} +ArchitecturesInstallIn64BitMode=x64 +AllowNoIcons=yes +AlwaysRestart=no +LicenseFile=.\license.txt +UsedUserAreasWarning=no +VersionInfoCopyright=Copyright (C) 2020-2021 by David Xanatos (xanasoft.com) +VersionInfoVersion={#MyAppVersion} + +; Handled in code section as always want DirPage for portable mode. +DisableDirPage=no + +; Allow /CURRENTUSER to be used with /PORTABLE=1 to avoid admin requirement. +PrivilegesRequiredOverridesAllowed=commandline + + +[Tasks] +Name: "DesktopIcon"; Description: "{cm:CreateDesktopIcon}"; MinVersion: 0.0,5.0; Check: not IsPortable +Name: "AutoStartEntry"; Description: "{cm:AutoStartProgram,{#MyAppName}}"; MinVersion: 0.0,5.0; Check: not IsPortable +Name: "AddRunSandboxed"; Description: "{cm:AddSandboxedMenu}"; MinVersion: 0.0,5.0; Check: not IsPortable + + +[Files] +; Both portable and install. +Source: ".\Release\{#MyAppSrc}\*"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: recursesubdirs ignoreversion; Excludes: "*.pdb" + +; Only if portable. +Source: ".\Sandboxie.ini"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist; Check: IsPortable +Source: ".\Sandboxie-Plus.ini"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist; Check: IsPortable + + +[Icons] +Name: "{group}\Sandboxie-Plus"; Filename: "{app}\SandMan.exe"; MinVersion: 0.0,5.0 +Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "http://sandboxie-plus.com/"; MinVersion: 0.0,5.0 +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; MinVersion: 0.0,5.0 +Name: "{userdesktop}\Sandboxie-Plus"; Filename: "{app}\SandMan.exe"; Tasks: DesktopIcon; MinVersion: 0.0,5.0 + + +[INI] +; Set Sandman language. +Filename: "{localappdata}\{#MyAppName}\{#MyAppName}.ini"; Section: "Options"; Key: "UiLanguage"; String: "{code:SandmanLanguage|{language}}"; Check: not IsPortable +Filename: "{app}\{#MyAppName}.ini"; Section: "Options"; Key: "UiLanguage"; String: "{code:SandmanLanguage|{language}}"; Check: IsPortable + + +[Registry] +; Autostart Sandman. +Root: HKCU; Subkey: "Software\Software\Microsoft\Windows\CurrentVersion\Run"; ValueName: "SandboxiePlus_AutoRun"; ValueType: string; ValueData: """{app}\SandMan.exe"" -autorun"; Flags: uninsdeletevalue; Tasks: AutoStartEntry + +; AddRunSandboxed all files. +Root: HKCU; Subkey: "Software\Classes\*\shell\sandbox"; ValueName: ""; ValueType: string; ValueData: "{cm:RunSandboxedMenu}"; Flags: uninsdeletekey; Tasks: AddRunSandboxed +Root: HKCU; Subkey: "Software\Classes\*\shell\sandbox"; ValueName: "Icon"; ValueType: string; ValueData: """{app}\start.exe"""; Tasks: AddRunSandboxed +Root: HKCU; Subkey: "Software\Classes\*\shell\sandbox\command"; ValueName: ""; ValueType: string; ValueData: """{app}\SandMan.exe"" /box:__ask__ ""%1"" %*"; Tasks: AddRunSandboxed + +; AddRunSandboxed folder. +Root: HKCU; Subkey: "Software\Classes\Folder\shell\sandbox"; ValueName: ""; ValueType: string; ValueData: "{cm:RunSandboxedMenu}"; Flags: uninsdeletekey; Tasks: AddRunSandboxed +Root: HKCU; Subkey: "Software\Classes\Folder\shell\sandbox"; ValueName: "Icon"; ValueType: string; ValueData: """{app}\start.exe"""; Tasks: AddRunSandboxed +Root: HKCU; Subkey: "Software\Classes\Folder\shell\sandbox\command"; ValueName: ""; ValueType: string; ValueData: """{app}\SandMan.exe"" /box:__ask__ ""%1"" %*"; Tasks: AddRunSandboxed + +; External manifest for Sbie service. +Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\SbieSvc"; ValueName: "PreferExternalManifest"; ValueType: dword; ValueData: "1"; Check: not IsPortable + +; Set language for Sbie service. +Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\SbieSvc"; ValueType: dword; ValueName: "Language"; ValueData: "{code:SystemLanguage}"; Check: not IsPortable + + +[Run] +; Install the Sbie driver. +Filename: "{app}\KmdUtil.exe"; Parameters: "install SbieDrv ""{app}\SbieDrv.sys"" type=kernel start=demand msgfile=""{app}\SbieMsg.dll"" altitude=86900"; StatusMsg: "KmdUtil install SbieDrv..."; Check: not IsPortable + +; Install the Sbie service. +Filename: "{app}\KmdUtil.exe"; Parameters: "install SbieSvc ""{app}\SbieSvc.exe"" type=own start=auto msgfile=""{app}\SbieMsg.dll"" display=""Sandboxie Service"" group=UIGroup"; StatusMsg: "KmdUtil install SbieSvc..."; Check: not IsPortable + +; Start the Sbie service. +Filename: "{app}\KmdUtil.exe"; Parameters: "start SbieSvc"; StatusMsg: "KmdUtil start SbieSvc"; Check: not IsPortable + +; Start the Sandman UI. +;Filename: "{app}\SandMan.exe"; Parameters: "-autorun"; StatusMsg: "Launch SandMan UI..."; Flags: postinstall nowait; Check: not IsPortable +Filename: "{app}\SandMan.exe"; Parameters: "-autorun"; StatusMsg: "Launch SandMan UI..."; Flags: nowait; Check: not IsPortable + + +[UninstallDelete] +Type: files; Name: "{app}\SbieDrv.sys.w10" +Type: files; Name: "{app}\SbieDrv.sys.rc4" +Type: dirifempty; Name: "{app}" +Type: dirifempty; Name: "{localappdata}\{#MyAppName}" + + +[Messages] +; Include with commandline /? message. +HelpTextNote=/PORTABLE=1%nEnable portable mode.%n + + +[Code] +var + CustomPage: TInputOptionWizardPage; + IsInstalled: Boolean; + Portable: Boolean; + + +function IsPortable(): Boolean; +begin + + // Return True or False for the value of Check. + if (ExpandConstant('{param:portable|0}') = '1') or Portable then begin + Result := True; + end; +end; + + +function IsUpgrade(): Boolean; +var + S: String; + InnoSetupReg: String; + AppPathName: String; +begin + + // Detect if already installed. + // Source: https://stackoverflow.com/a/30568071 + InnoSetupReg := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppName")}_is1'); + AppPathName := 'Inno Setup: App Path'; + + Result := RegQueryStringValue(HKLM, InnoSetupReg, AppPathName, S) or + RegQueryStringValue(HKCU, InnoSetupReg, AppPathName, S); +end; + + +function InstallPath(Dummy: String): String; +var + DrvPath: String; + SbiePath: String; +begin + + // Return the path to use for the value of DefaultDirName. + IsInstalled := False; + SbiePath := ExpandConstant('{param:dir}'); + + if SbiePath = '' then begin + if (ExpandConstant('{param:portable|0}') = '1') or Portable then begin + SbiePath := ExpandConstant('{src}') + '\{#MyAppName}'; + end else begin + if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Services\SbieDrv', 'ImagePath', DrvPath) then begin + IsInstalled := True; + DrvPath := ExtractFilePath(DrvPath); + + if Copy(DrvPath, 1, 4) = '\??\' then begin + DrvPath := Copy(DrvPath, 5, Length(DrvPath) - 5); + end; + + SbiePath := DrvPath; + end else begin + SbiePath := ExpandConstant('{autopf}') + '\{#MyAppName}'; + end; + end; + end; + + Result := SbiePath; +end; + + +function SandmanLanguage(Language: String): String; +begin + + // Language values for Sandboxie-Plus.ini. + case Lowercase(Language) of + 'english': Result := 'en'; + 'chinesesimplified': Result := 'zh-CN'; + 'chinesetraditional': Result := 'zh-TW'; + 'dutch': Result := 'nl'; + 'french': Result := 'fr'; + 'german': Result := 'de'; + 'italian': Result := 'it'; + 'polish': Result := 'pl'; + 'portuguese': Result := 'pt'; + 'russian': Result := 'ru'; + 'spanish': Result := 'es'; + 'turkish': Result := 'tr'; + end; +end; + + +function SystemLanguage(Dummy: String): String; +begin + + // Language identifier for the System Eventlog messages. + Result := IntToStr(GetUILanguage()); +end; + + +procedure UpdateStatus(OutputProgressPage: TOutputProgressWizardPage; Text: String; Percentage: Integer); +begin + + // Called by ShutdownSbie() to update status or progress. + if IsUninstaller() then + UninstallProgressForm.StatusLabel.Caption := Text + else begin + OutputProgressPage.SetProgress(Percentage, 100); + OutputProgressPage.SetText(Text, ''); + end; + + // Output status information to log. + Log('Debug: ' + Text); +end; + + +function ShutdownSbie(): Boolean; +var + ExecRet: Integer; + StatusText: String; + OutputProgressPage: TOutputProgressWizardPage; +begin + + // Require KmdUtil.exe to continue. + if (FileExists(ExpandConstant('{app}\KmdUtil.exe')) = False) then + begin + Result := True; + exit; + end; + + try + + // Backup status text (uninstall). Prepare progress page (install). + if IsUninstaller() then + StatusText := UninstallProgressForm.StatusLabel.Caption + else begin + OutputProgressPage := CreateOutputProgressPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc)); + OutputProgressPage.Show(); + end; + + // Run KmdUtil scandll. + UpdateStatus(OutputProgressPage, 'KmdUtil scandll', 5); + Exec(ExpandConstant('{app}\KmdUtil.exe'), 'scandll', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); + + if (ExecRet <> 0) then + begin + Result := False; + exit; + end; + + // Stop processes. + UpdateStatus(OutputProgressPage, 'Taskkill /IM Sandman.exe /IM SbieCtrl.exe /IM Start.exe /F', 30); + Exec(ExpandConstant('{sys}\taskkill.exe'), '/IM Sandman.exe /IM SbieCtrl.exe /IM Start.exe /F', '', SW_HIDE, ewWaitUntilTerminated, ExecRet); + + // Stop service and driver. + UpdateStatus(OutputProgressPage, 'KmdUtil stop SbieSvc', 55); + Exec(ExpandConstant('{app}\KmdUtil.exe'), 'stop SbieSvc', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); + + UpdateStatus(OutputProgressPage, 'KmdUtil stop SbieDrv', 85); + Exec(ExpandConstant('{app}\KmdUtil.exe'), 'stop SbieDrv', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); + + // Uninstall service and driver. + UpdateStatus(OutputProgressPage, 'KmdUtil delete SbieSvc', 95); + Exec(ExpandConstant('{app}\KmdUtil.exe'), 'delete SbieSvc', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); + + UpdateStatus(OutputProgressPage, 'KmdUtil delete SbieDrv', 100); + Exec(ExpandConstant('{app}\KmdUtil.exe'), 'delete SbieDrv', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); + + // Query driver which can remove SbieDrv key if exist. + if RegKeyExists(HKLM, 'SYSTEM\CurrentControlSet\services\SbieDrv') then begin + UpdateStatus(OutputProgressPage, 'SC query SbieDrv', 100); + Exec(ExpandConstant('{sys}\sc.exe'), 'query SbieDrv', '', SW_HIDE, ewWaitUntilTerminated, ExecRet); + end; + finally + + // Restore status text (uninstall). Hide Prepare progress page (install). + if IsUninstaller() then + UninstallProgressForm.StatusLabel.Caption := StatusText + else begin + OutputProgressPage.SetProgress(0, 100); + OutputProgressPage.Hide(); + end; + end; + + Result := True; +end; + + +////////////////////////////////////////////////////// +// Installation Events +// + + +function NextButtonClick(CurPageID: Integer): Boolean; +begin + + // Get mode setting from Custom page and set path for the Dir page. + if CurPageID = CustomPage.ID then begin + Portable := not (CustomPage.SelectedValueIndex = 0); + WizardForm.DirEdit.Text := InstallPath(''); + + // No Start Menu folder setting on Ready page if portable. + if Portable then begin + WizardForm.NoIconsCheck.Checked := True; + end else begin + WizardForm.NoIconsCheck.Checked := False; + end; + end; + + // Shutdown service, driver and processes as ready to install. + if ((CurPageID = wpReady) and (not IsPortable())) then + begin + Result := ShutdownSbie(); + exit; + end; + + Result := True; +end; + + +function ShouldSkipPage(PageID: Integer): Boolean; +begin + + // Skip Custom page and Group page if portable. + if PageID = CustomPage.ID then begin + if ExpandConstant('{param:portable|0}') = '1' then + Result := True; + end else if PageID = wpSelectDir then begin + if not IsPortable and IsUpgrade then + Result := True; + end else if PageID = wpSelectProgramGroup then begin + if IsPortable then + Result := True; + end; +end; + + +procedure InitializeWizard(); +begin + + // Create the custom page. + // Source: https://timesheetsandstuff.wordpress.com/2008/06/27/the-joy-of-part-2/ + CustomPage := CreateInputOptionPage(wpLicense, + CustomMessage('CustomPageLabel1'), + CustomMessage('CustomPageLabel2'), + CustomMessage('CustomPageLabel3'), True, False); + + if IsInstalled = True then begin + CustomPage.Add(CustomMessage('CustomPageUpgradeMode')); + end else begin + CustomPage.Add(CustomMessage('CustomPageInstallMode')); + end; + + CustomPage.Add(CustomMessage('CustomPagePortableMode')); + + // Default to Normal Installation if not argument /PORTABLE=1. + if ExpandConstant('{param:portable|0}') = '1' then begin + WizardForm.NoIconsCheck.Checked := True; + CustomPage.SelectedValueIndex := 1; + end else begin + CustomPage.SelectedValueIndex := 0; + end; +end; + + +function InitializeSetup(): Boolean; +var + Version: TWindowsVersion; + ExecRet: Integer; + UninstallString: String; +begin + + // Require Windows 7 or later. + GetWindowsVersionEx(Version); + + if (Version.NTPlatform = False) or (Version.Major < 6) then + begin + SuppressibleMsgBox(CustomMessage('RequiresWin7OrLater'), mbError, MB_OK, MB_OK); + Result := False; + exit; + end; + + // Ask to uninstall Sandboxie Classic if found. + ExecRet := IDYES; + + while (ExecRet = IDYES) do + begin + if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sandboxie', 'UninstallString', UninstallString) then begin + + ExecRet := MsgBox(CustomMessage('ClassicFound'), mbConfirmation, MB_YESNOCANCEL); + + if ExecRet = IDCANCEL then + begin + Result := False; + exit; + end; + + if ExecRet = IDYES then + begin + Exec('cmd.exe', '/c ' + UninstallString, '', SW_HIDE, ewWaitUntilTerminated, ExecRet); + ExecRet := IDYES; + end; + + end else begin + break; + end; + end; + + Result := True; +end; + + +////////////////////////////////////////////////////// +// Uninstallation Exclusive +// + + +procedure UninstallCleanup(ButtonCount: Integer); +var + Buttons: Cardinal; + ButtonLabels: TArrayOfString; + ExecRet: Integer; + I: Integer; + Paths: TStringList; + ShowMsgbox: Boolean; + TaskRet: Integer; +begin + + // Require 2 or 3 for button count. + if (ButtonCount < 2) or (ButtonCount > 3) then + exit; + + // Require Sandman.exe to continue. + if not FileExists(ExpandConstant('{app}\Sandman.exe')) then + exit; + + // Make a list. + Paths := TStringList.Create; + + // Append file paths to the list for removal. + Paths.Append('{localappdata}\{#MyAppName}\{#MyAppName}.ini'); + Paths.Append('{win}\Sandboxie.ini'); + Paths.Append('{app}\{#MyAppName}.ini'); + Paths.Append('{app}\Sandboxie.ini'); + + // Expand paths and detect if any file exist. + for I := 0 to Paths.Count - 1 do begin + Paths[I] := ExpandConstant(Paths[I]); + + if FileExists(Paths[I]) then + ShowMsgbox := True; + end; + + // Delete the config files and the sandboxes. + if ShowMsgbox then begin + case ButtonCount of + 2: begin + Buttons := MB_YESNO; + ButtonLabels := [CustomMessage('UninstallTaskLabel3'), + CustomMessage('UninstallTaskLabel4')]; + end; + + 3: begin + Buttons := MB_ABORTRETRYIGNORE; + ButtonLabels := [CustomMessage('UninstallTaskLabel3'), + CustomMessage('UninstallTaskLabel4'), + CustomMessage('UninstallTaskLabel5')]; + end; + end; + + case TaskDialogMsgBox(CustomMessage('UninstallTaskLabel1'), + CustomMessage('UninstallTaskLabel2'), + mbConfirmation, Buttons, ButtonLabels, 0) of + + IDRETRY: TaskRet := 1; + IDIGNORE: TaskRet := 2; + IDABORT: TaskRet := 3; + IDYES: TaskRet := 1; + IDNO: TaskRet := 2; + end; + + if TaskRet > 2 then begin + Log('Debug: Sandman /RemoveSandboxes'); + Exec(ExpandConstant('{app}\Sandman.exe'), '/RemoveSandboxes', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ExecRet); + end; + + if TaskRet > 1 then begin + for I := 0 to Paths.Count - 1 do + if FileExists(Paths[I]) then begin + Log('Debug: DeleteFile(' + Paths[I] + ')'); + DeleteFile(Paths[I]); + end; + end; + end; + + // Release the list. + Paths.Free; +end; + + +////////////////////////////////////////////////////// +// Uninstallation Events +// + + +procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); +begin + + // Before the uninstallation. + if (CurUninstallStep <> usUninstall) then + exit; + + // User to confirm extra files to remove. + if not UninstallSilent then + UninstallCleanup(2); + + // Shutdown service, driver and processes. + if (ShutdownSbie() = False) then + begin + Abort(); + exit; + end; +end; diff --git a/Sandboxie/COPYING b/Sandboxie/COPYING index b059d641..810fce6e 100644 --- a/Sandboxie/COPYING +++ b/Sandboxie/COPYING @@ -1,621 +1,621 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS diff --git a/Sandboxie/apps/control/SbieControl.rc2 b/Sandboxie/apps/control/SbieControl.rc2 index 6fc8aefc..e6721fad 100644 --- a/Sandboxie/apps/control/SbieControl.rc2 +++ b/Sandboxie/apps/control/SbieControl.rc2 @@ -1,54 +1,54 @@ -// -// SbieControl.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED -#error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION MY_VERSION_BINARY - PRODUCTVERSION MY_VERSION_BINARY - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", MY_COMPANY_NAME_STRING "\0" - VALUE "FileDescription", MY_PRODUCT_NAME_STRING " Control\0" - VALUE "FileVersion", MY_VERSION_STRING "\0" - OPTIONAL_VALUE("InternalName", "Control\0") - VALUE "LegalCopyright", MY_COPYRIGHT_STRING "\0" - VALUE "LegalTrademarks", "\0" - OPTIONAL_VALUE("OriginalFilename", "SbieCtrl.exe\0") - VALUE "PrivateBuild", "\0" - VALUE "ProductName", MY_PRODUCT_NAME_STRING "\0" - VALUE "ProductVersion", MY_VERSION_STRING "\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - +// +// SbieControl.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MY_VERSION_BINARY + PRODUCTVERSION MY_VERSION_BINARY + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", MY_COMPANY_NAME_STRING "\0" + VALUE "FileDescription", MY_PRODUCT_NAME_STRING " Control\0" + VALUE "FileVersion", MY_VERSION_STRING "\0" + OPTIONAL_VALUE("InternalName", "Control\0") + VALUE "LegalCopyright", MY_COPYRIGHT_STRING "\0" + VALUE "LegalTrademarks", "\0" + OPTIONAL_VALUE("OriginalFilename", "SbieCtrl.exe\0") + VALUE "PrivateBuild", "\0" + VALUE "ProductName", MY_PRODUCT_NAME_STRING "\0" + VALUE "ProductVersion", MY_VERSION_STRING "\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + diff --git a/Sandboxie/apps/res/xptheme.manifest b/Sandboxie/apps/res/xptheme.manifest index a05f6757..15e54d2d 100644 --- a/Sandboxie/apps/res/xptheme.manifest +++ b/Sandboxie/apps/res/xptheme.manifest @@ -1,27 +1,27 @@ - - - -Sandboxie - - - - - - - - true - - - + + + +Sandboxie + + + + + + + + true + + + diff --git a/Sandboxie/common/NtCRT/x64/ntdll.def b/Sandboxie/common/NtCRT/x64/ntdll.def index 40cbc7c4..a87bddd7 100644 --- a/Sandboxie/common/NtCRT/x64/ntdll.def +++ b/Sandboxie/common/NtCRT/x64/ntdll.def @@ -1,171 +1,171 @@ -EXPORTS -__C_specific_handler -__chkstk -__isascii -__iscsym -__iscsymf -__misaligned_access -__toascii -_atoi64 -_fltused -_i64toa -_i64toa_s -_i64tow -_i64tow_s -_itoa -_itoa_s -_itow -_itow_s -_lfind -_local_unwind -_ltoa -_ltoa_s -_ltow -_ltow_s -_makepath_s -_memccpy -_memicmp -_setjmp -_setjmpex -_snprintf -_snprintf_s -_snscanf_s -_snwprintf -_snwprintf_s -_snwscanf_s -_splitpath -_splitpath_s -_strcmpi -_stricmp -_strlwr -_strnicmp -_strnset_s -_strset_s -_strupr -_swprintf -_ui64toa -_ui64toa_s -_ui64tow -_ui64tow_s -_ultoa -_ultoa_s -_ultow -_ultow_s -_vscwprintf -_vsnprintf -_vsnprintf_s -_vsnwprintf -_vsnwprintf_s -_vswprintf -_wcsicmp -_wcslwr -_wcsnicmp -_wcsnset_s -_wcsset_s -_wcstoui64 -_wcsupr -_wmakepath_s -_wsplitpath_s -_wtoi -_wtoi64 -_wtol -abs -atan -atoi -atol -bsearch -ceil -cos -fabs -floor -isalnum -isalpha -iscntrl -isdigit -isgraph -islower -isprint -ispunct -isspace -isupper -iswalpha -iswctype -iswdigit -iswlower -iswspace -iswxdigit -isxdigit -labs -log -longjmp -mbstowcs -memchr -memcmp -memcpy -memcpy_s -memmove -memmove_s -memset -pow -qsort -sin -sprintf -sprintf_s -sqrt -sscanf -sscanf_s -strcat -strcat_s -strchr -strcmp -strcpy -strcpy_s -strcspn -strlen -strncat -strncat_s -strncmp -strncpy -strncpy_s -strnlen -strpbrk -strrchr -strspn -strstr -strtok_s -strtol -strtoul -swprintf -swprintf_s -swscanf_s -tan -tolower -toupper -towlower -towupper -vDbgPrintEx -vDbgPrintExWithPrefix -vsprintf -vsprintf_s -vswprintf_s -wcscat -wcscat_s -wcschr -wcscmp -wcscpy -wcscpy_s -wcscspn -wcslen -wcsncat -wcsncat_s -wcsncmp -wcsncpy -wcsncpy_s -wcsnlen -wcspbrk -wcsrchr -wcsspn -wcsstr -wcstol -wcstombs -wcstoul +EXPORTS +__C_specific_handler +__chkstk +__isascii +__iscsym +__iscsymf +__misaligned_access +__toascii +_atoi64 +_fltused +_i64toa +_i64toa_s +_i64tow +_i64tow_s +_itoa +_itoa_s +_itow +_itow_s +_lfind +_local_unwind +_ltoa +_ltoa_s +_ltow +_ltow_s +_makepath_s +_memccpy +_memicmp +_setjmp +_setjmpex +_snprintf +_snprintf_s +_snscanf_s +_snwprintf +_snwprintf_s +_snwscanf_s +_splitpath +_splitpath_s +_strcmpi +_stricmp +_strlwr +_strnicmp +_strnset_s +_strset_s +_strupr +_swprintf +_ui64toa +_ui64toa_s +_ui64tow +_ui64tow_s +_ultoa +_ultoa_s +_ultow +_ultow_s +_vscwprintf +_vsnprintf +_vsnprintf_s +_vsnwprintf +_vsnwprintf_s +_vswprintf +_wcsicmp +_wcslwr +_wcsnicmp +_wcsnset_s +_wcsset_s +_wcstoui64 +_wcsupr +_wmakepath_s +_wsplitpath_s +_wtoi +_wtoi64 +_wtol +abs +atan +atoi +atol +bsearch +ceil +cos +fabs +floor +isalnum +isalpha +iscntrl +isdigit +isgraph +islower +isprint +ispunct +isspace +isupper +iswalpha +iswctype +iswdigit +iswlower +iswspace +iswxdigit +isxdigit +labs +log +longjmp +mbstowcs +memchr +memcmp +memcpy +memcpy_s +memmove +memmove_s +memset +pow +qsort +sin +sprintf +sprintf_s +sqrt +sscanf +sscanf_s +strcat +strcat_s +strchr +strcmp +strcpy +strcpy_s +strcspn +strlen +strncat +strncat_s +strncmp +strncpy +strncpy_s +strnlen +strpbrk +strrchr +strspn +strstr +strtok_s +strtol +strtoul +swprintf +swprintf_s +swscanf_s +tan +tolower +toupper +towlower +towupper +vDbgPrintEx +vDbgPrintExWithPrefix +vsprintf +vsprintf_s +vswprintf_s +wcscat +wcscat_s +wcschr +wcscmp +wcscpy +wcscpy_s +wcscspn +wcslen +wcsncat +wcsncat_s +wcsncmp +wcsncpy +wcsncpy_s +wcsnlen +wcspbrk +wcsrchr +wcsspn +wcsstr +wcstol +wcstombs +wcstoul diff --git a/Sandboxie/common/NtCRT/x86/except_handler3.asm b/Sandboxie/common/NtCRT/x86/except_handler3.asm index c5e17f72..75036ef0 100644 --- a/Sandboxie/common/NtCRT/x86/except_handler3.asm +++ b/Sandboxie/common/NtCRT/x86/except_handler3.asm @@ -1,552 +1,552 @@ -;---------------------------------------------------------------------------- -; __except_handler3 support routine is not longer available on ntdll.lib -; -; this is a copy of __except_handler3 procedure and required procedures from -; the c:\WinDDK\7600.16385.1\lib\wnet\i386\ntdll.lib -; -;---------------------------------------------------------------------------- - -.386 - -_TEXT segment use32 para public 'CODE' - - -public __except_handler3 - -;__except_handler3 proc near - - push esi - inc ebx - xor dh,byte ptr [eax] - pop eax - inc ebx - xor byte ptr [eax],dh -__except_handler3: - push ebp - mov ebp,esp - sub esp,8 - push ebx - push esi - push edi - push ebp - cld - mov ebx,dword ptr [ebp+0Ch] - mov eax,dword ptr [ebp+8] - test dword ptr [eax+4],6 - nop ; 00 - jne _lh_unwinding - mov dword ptr [ebp-8],eax - mov eax,dword ptr [ebp+10h] - mov dword ptr [ebp-4],eax - lea eax,[ebp-8] - mov dword ptr [ebx-4],eax - mov esi,dword ptr [ebx+0Ch] - mov edi,dword ptr [ebx+8] - push ebx - call __ValidateEH3RN - add esp,4 - or eax,eax - je _lh_abort -_lh_top: - cmp esi,0FFFFFFFFh - je _lh_bagit - lea ecx,[esi+esi*2] - mov eax,dword ptr [edi+ecx*4+4] - or eax,eax - je _lh_continue - push esi - push ebp - lea ebp,[ebx+10h] - xor ebx,ebx - xor ecx,ecx - xor edx,edx - xor esi,esi - xor edi,edi - call eax - pop ebp - pop esi - mov ebx,dword ptr [ebp+0Ch] - or eax,eax - je _lh_continue - js _lh_dismiss - mov edi,dword ptr [ebx+8] - push ebx - call __global_unwind2 - add esp,4 - lea ebp,[ebx+10h] - push esi - push ebx - call __local_unwind2 - add esp,8 - lea ecx,[esi+esi*2] - push 1 - mov eax,dword ptr [edi+ecx*4+8] - call __NLG_Notify - mov eax,dword ptr [edi+ecx*4] - mov dword ptr [ebx+0Ch],eax - mov eax,dword ptr [edi+ecx*4+8] - xor ebx,ebx - xor ecx,ecx - xor edx,edx - xor esi,esi - xor edi,edi - call eax -_lh_continue: - mov edi,dword ptr [ebx+8] - lea ecx,[esi+esi*2] - mov esi,dword ptr [edi+ecx*4] - jmp _lh_top -_lh_dismiss: - mov eax,0 - jmp _lh_return -_lh_abort: - mov eax,dword ptr [ebp+8] - or dword ptr [eax+4],8 -_lh_bagit: - mov eax,1 - jmp _lh_return -_lh_unwinding: - push ebp - lea ebp,[ebx+10h] - push 0FFFFFFFFh - push ebx - call __local_unwind2 - add esp,8 - pop ebp - mov eax,1 -_lh_return: - pop ebp - pop edi - pop esi - pop ebx - mov esp,ebp - pop ebp - ret -__seh_longjmp_unwind@4: - push ebp - mov ecx,dword ptr [esp+8] - mov ebp,dword ptr [ecx] - mov eax,dword ptr [ecx+1Ch] - push eax - mov eax,dword ptr [ecx+18h] - push eax - call __local_unwind2 - add esp,8 - pop ebp - ret 4 - -;__except_handler3 endp - -EXTERN _RtlUnwind@16 : PROC - -;__global_unwind2 proc near - -__global_unwind2: - push ebp - mov ebp,esp - push ebx - push esi - push edi - push ebp - push 0 - push 0 - push offset _gu_return - push dword ptr [ebp+8] - ;call P_RtlUnwind - call _RtlUnwind@16 ; call it from ntdll.lib -_gu_return: - pop ebp - pop edi - pop esi - pop ebx - mov esp,ebp - pop ebp - ret -__unwind_handler: - mov ecx,dword ptr [esp+4] - test dword ptr [ecx+4],6 - nop ; 00 - mov eax,1 - je _uh_return - mov eax,dword ptr [esp+14h] - push ebp - mov ebp,dword ptr [eax+10h] - mov edx,dword ptr [eax+28h] - push edx - mov edx,dword ptr [eax+24h] - push edx - call __local_unwind2 - add esp,8 - pop ebp - mov eax,dword ptr [esp+8] - mov edx,dword ptr [esp+10h] - mov dword ptr [edx],eax - mov eax,3 -_uh_return: - ret -__local_unwind2: - push ebx - push esi - push edi - mov eax,dword ptr [esp+10h] - push ebp - push eax - push 0FFFFFFFEh - push offset __unwind_handler - push dword ptr fs:[0] - nop ; 00 - mov dword ptr fs:[0],esp - nop ; 00 -_lu_top: - mov eax,dword ptr [esp+24h] - mov ebx,dword ptr [eax+8] - mov esi,dword ptr [eax+0Ch] - cmp esi,0FFFFFFFFh - je _lu_done - cmp dword ptr [esp+28h],0FFFFFFFFh - je _continue_ - cmp esi,dword ptr [esp+28h] - jbe _lu_done -_continue_: - lea esi,[esi+esi*2] - mov ecx,dword ptr [ebx+esi*4] - mov dword ptr [esp+8],ecx - mov dword ptr [eax+0Ch],ecx - cmp dword ptr [ebx+esi*4+4],0 - jne __NLG_Return2 - push 101h - mov eax,dword ptr [ebx+esi*4+8] - call __NLG_Notify - call dword ptr [ebx+esi*4+8] -__NLG_Return2: - jmp _lu_top -_lu_done: - pop dword ptr fs:[0] - nop ; 00 - add esp,10h - pop edi - pop esi - pop ebx - ret -__abnormal_termination: - xor eax,eax - mov ecx,dword ptr fs:[0] - nop ; 00 - cmp dword ptr [ecx+4],offset __unwind_handler - nop ; 00 - jne _at_done - mov edx,dword ptr [ecx+0Ch] - mov edx,dword ptr [edx+0Ch] - cmp dword ptr [ecx+8],edx - jne _at_done - mov eax,1 -_at_done: - ret -__NLG_Notify1: - push ebx - push ecx - mov ebx,offset __NLG_Destination - jmp __NLG_Go -__NLG_Notify: - push ebx - push ecx - mov ebx,offset __NLG_Destination - mov ecx,dword ptr [ebp+8] -__NLG_Go: - mov dword ptr [ebx+8],ecx - mov dword ptr [ebx+4],eax - mov dword ptr [ebx+0Ch],ebp - push ebp - push ecx - push eax -__NLG_Dispatch: - pop eax - pop ecx - pop ebp - pop ecx - pop ebx - ret 4 - -;__global_unwind2 endp - - -EXTERN _NtQueryVirtualMemory@24: PROC - -;__ValidateEH3RN proc near - -__ValidateEH3RN: - mov edi,edi - push ebp - mov ebp,esp - sub esp,20h - push ebx - push esi - mov esi,dword ptr [ebp+8] - mov ebx,dword ptr [esi+8] - test bl,3 - jne label01 - mov eax,dword ptr fs:[00000004h] - mov dword ptr [ebp+8],eax - mov eax,dword ptr fs:[00000008h] - mov dword ptr [ebp-4],eax - cmp ebx,dword ptr [ebp-4] - jb label02 - cmp ebx,dword ptr [ebp+8] - jae label02 -label01: - xor eax,eax - jmp label03 -label02: - push edi - mov edi,dword ptr [esi+0Ch] - cmp edi,0FFFFFFFFh - jne label04 - xor eax,eax - inc eax - jmp label05 -label04: - xor edx,edx - mov dword ptr [ebp+8],edx - mov eax,ebx -label30: - mov ecx,dword ptr [eax] - cmp ecx,0FFFFFFFFh - je label06 - cmp ecx,edx - jae label07 -label06: - cmp dword ptr [eax+4],0 - je label10 - inc dword ptr [ebp+8] -label10: - inc edx - add eax,0Ch - cmp edx,edi - jbe label30 - cmp dword ptr [ebp+8],0 - je label11 - mov eax,dword ptr [esi-8] - cmp eax,dword ptr [ebp-4] - jb label07 - cmp eax,esi - jae label07 -label11: - mov ecx,dword ptr [_nValidPages] - mov esi,ebx - and esi,0FFFFF000h - xor eax,eax - test ecx,ecx - jle label08 -label12: - cmp dword ptr _rgValidPages[eax*4],esi - nop ; 00 - je label09 - inc eax - cmp eax,ecx - jl label12 -label08: - lea eax,[ebp+8] - push eax - push 1Ch - lea eax,[ebp-20h] - push eax - push 0 - push ebx - or edi,0FFFFFFFFh - push edi - ;call _NtQueryVirtualMemory - call _NtQueryVirtualMemory@24 ; call it from ntdll.lib - test eax,eax - jl label13 - mov eax,dword ptr [ebp+8] - jmp label14 - xor eax,eax -label07: - jmp label05 - test eax,eax -label09: - jle label15 - xor edx,edx - mov ebx,offset _lModifying - inc edx - mov edi,ebx - xchg edx,dword ptr [edi] - test edx,edx - jne label15 - cmp dword ptr _rgValidPages[eax*4],esi - nop ; 00 - je label15 - lea eax,[ecx-1] - test eax,eax - jl label16 -label18: - cmp dword ptr _rgValidPages[eax*4],esi - nop ; 00 - je label17 - dec eax - jns label18 -label17: - test eax,eax - jge label19 - cmp ecx,10h -label16: - jge label20 - inc ecx - mov dword ptr [_nValidPages],ecx -label20: - lea eax,[ecx-1] - jmp label15 -label19: - je label21 -label15: - xor edx,edx - test eax,eax - jl label21 -label22: - lea ecx,_rgValidPages[edx*4] - nop ; 00 - mov edi,dword ptr [ecx] - inc edx - cmp edx,eax - mov dword ptr [ecx],esi - mov esi,edi - jle label22 -label21: - xor eax,eax - xchg eax,dword ptr [ebx] - jmp label15 -label13: - xor eax,eax -label14: - test eax,eax - je label23 - cmp dword ptr [ebp-8],1000000h - nop ; 01 - jne label23 - test byte ptr [ebp-0Ch],0CCh - je label0 - mov ecx,dword ptr [ebp-1Ch] - cmp word ptr [ecx],5A4Dh - jne label23 - mov eax,dword ptr [ecx+3Ch] - add eax,ecx - cmp dword ptr [eax],4550h - jne label23 - cmp word ptr [eax+18h],10Bh - jne label23 - sub ebx,ecx - cmp word ptr [eax+6],0 - movzx ecx,word ptr [eax+14h] - lea ecx,[ecx+eax+18h] - jbe label23 - mov eax,dword ptr [ecx+0Ch] - cmp ebx,eax - jb label0 - mov edx,dword ptr [ecx+8] - add edx,eax - cmp ebx,edx - jae label0 - test byte ptr [ecx+27h],80h - jne label07 -label0: - xor eax,eax - inc eax - mov ecx,eax - mov edx,offset _lModifying - xchg ecx,dword ptr [edx] - test ecx,ecx - jne label05 - mov ecx,dword ptr [_nValidPages] - test ecx,ecx - mov edx,ecx - jle label24 - lea eax,_rgValidPages[ecx*4+0FFFFFFFCh] - nop ; FF -label25: - cmp dword ptr [eax],esi - je label24 - dec edx - sub eax,4 - test edx,edx - jg label25 -label24: - test edx,edx - jne label26 - push 0Fh - pop ebx - cmp ecx,ebx - jg label27 - mov ebx,ecx -label27: - xor edx,edx - test ebx,ebx - jl label28 -label29: - lea eax,_rgValidPages[edx*4] - nop ; 00 - mov edi,dword ptr [eax] - inc edx - cmp edx,ebx - mov dword ptr [eax],esi - mov esi,edi - jle label29 -label28: - cmp ecx,10h - jge label26 - inc ecx - mov dword ptr [_nValidPages],ecx -label26: - xor eax,eax - mov ecx,offset _lModifying - xchg eax,dword ptr [ecx] - jmp label15 -label23: - mov eax,edi -label05: - pop edi -label03: - pop esi - pop ebx - leave - ret - -;__ValidateEH3RN endp - -_TEXT ends - - -.model flat -.data - -; Global variables for __NLG_Destination -;typedef struct { -; unsigned long dwSig; -; unsigned long uoffDestination; -; unsigned long dwCode; -; unsigned long uoffFramePointer; -;} _NLG_INFO; -;_NLG_INFO _NLG_Destination = { 0x019930520, 0, 0, 0 }; -__NLG_Destination LABEL DWORD - dd 1 dup (019930520h) ; MAGIC_NUMBER1 - dd 1 dup (0) - dd 1 dup (0) - dd 1 dup (0) - public __NLG_Destination - - -; Global variables for __ValidateEH3RN -;INT _nValidPages = 0; -_nValidPages LABEL DWORD - dd 1 dup (0) - public _nValidPages -;PVOID _rgValidPages[0x10] = { NULL }; -_rgValidPages LABEL DWORD - dd 16 dup (0) - public _rgValidPages -;BOOL _lModifying = FALSE; -_lModifying LABEL DWORD - dd 1 dup (0) - public _lModifying - - +;---------------------------------------------------------------------------- +; __except_handler3 support routine is not longer available on ntdll.lib +; +; this is a copy of __except_handler3 procedure and required procedures from +; the c:\WinDDK\7600.16385.1\lib\wnet\i386\ntdll.lib +; +;---------------------------------------------------------------------------- + +.386 + +_TEXT segment use32 para public 'CODE' + + +public __except_handler3 + +;__except_handler3 proc near + + push esi + inc ebx + xor dh,byte ptr [eax] + pop eax + inc ebx + xor byte ptr [eax],dh +__except_handler3: + push ebp + mov ebp,esp + sub esp,8 + push ebx + push esi + push edi + push ebp + cld + mov ebx,dword ptr [ebp+0Ch] + mov eax,dword ptr [ebp+8] + test dword ptr [eax+4],6 + nop ; 00 + jne _lh_unwinding + mov dword ptr [ebp-8],eax + mov eax,dword ptr [ebp+10h] + mov dword ptr [ebp-4],eax + lea eax,[ebp-8] + mov dword ptr [ebx-4],eax + mov esi,dword ptr [ebx+0Ch] + mov edi,dword ptr [ebx+8] + push ebx + call __ValidateEH3RN + add esp,4 + or eax,eax + je _lh_abort +_lh_top: + cmp esi,0FFFFFFFFh + je _lh_bagit + lea ecx,[esi+esi*2] + mov eax,dword ptr [edi+ecx*4+4] + or eax,eax + je _lh_continue + push esi + push ebp + lea ebp,[ebx+10h] + xor ebx,ebx + xor ecx,ecx + xor edx,edx + xor esi,esi + xor edi,edi + call eax + pop ebp + pop esi + mov ebx,dword ptr [ebp+0Ch] + or eax,eax + je _lh_continue + js _lh_dismiss + mov edi,dword ptr [ebx+8] + push ebx + call __global_unwind2 + add esp,4 + lea ebp,[ebx+10h] + push esi + push ebx + call __local_unwind2 + add esp,8 + lea ecx,[esi+esi*2] + push 1 + mov eax,dword ptr [edi+ecx*4+8] + call __NLG_Notify + mov eax,dword ptr [edi+ecx*4] + mov dword ptr [ebx+0Ch],eax + mov eax,dword ptr [edi+ecx*4+8] + xor ebx,ebx + xor ecx,ecx + xor edx,edx + xor esi,esi + xor edi,edi + call eax +_lh_continue: + mov edi,dword ptr [ebx+8] + lea ecx,[esi+esi*2] + mov esi,dword ptr [edi+ecx*4] + jmp _lh_top +_lh_dismiss: + mov eax,0 + jmp _lh_return +_lh_abort: + mov eax,dword ptr [ebp+8] + or dword ptr [eax+4],8 +_lh_bagit: + mov eax,1 + jmp _lh_return +_lh_unwinding: + push ebp + lea ebp,[ebx+10h] + push 0FFFFFFFFh + push ebx + call __local_unwind2 + add esp,8 + pop ebp + mov eax,1 +_lh_return: + pop ebp + pop edi + pop esi + pop ebx + mov esp,ebp + pop ebp + ret +__seh_longjmp_unwind@4: + push ebp + mov ecx,dword ptr [esp+8] + mov ebp,dword ptr [ecx] + mov eax,dword ptr [ecx+1Ch] + push eax + mov eax,dword ptr [ecx+18h] + push eax + call __local_unwind2 + add esp,8 + pop ebp + ret 4 + +;__except_handler3 endp + +EXTERN _RtlUnwind@16 : PROC + +;__global_unwind2 proc near + +__global_unwind2: + push ebp + mov ebp,esp + push ebx + push esi + push edi + push ebp + push 0 + push 0 + push offset _gu_return + push dword ptr [ebp+8] + ;call P_RtlUnwind + call _RtlUnwind@16 ; call it from ntdll.lib +_gu_return: + pop ebp + pop edi + pop esi + pop ebx + mov esp,ebp + pop ebp + ret +__unwind_handler: + mov ecx,dword ptr [esp+4] + test dword ptr [ecx+4],6 + nop ; 00 + mov eax,1 + je _uh_return + mov eax,dword ptr [esp+14h] + push ebp + mov ebp,dword ptr [eax+10h] + mov edx,dword ptr [eax+28h] + push edx + mov edx,dword ptr [eax+24h] + push edx + call __local_unwind2 + add esp,8 + pop ebp + mov eax,dword ptr [esp+8] + mov edx,dword ptr [esp+10h] + mov dword ptr [edx],eax + mov eax,3 +_uh_return: + ret +__local_unwind2: + push ebx + push esi + push edi + mov eax,dword ptr [esp+10h] + push ebp + push eax + push 0FFFFFFFEh + push offset __unwind_handler + push dword ptr fs:[0] + nop ; 00 + mov dword ptr fs:[0],esp + nop ; 00 +_lu_top: + mov eax,dword ptr [esp+24h] + mov ebx,dword ptr [eax+8] + mov esi,dword ptr [eax+0Ch] + cmp esi,0FFFFFFFFh + je _lu_done + cmp dword ptr [esp+28h],0FFFFFFFFh + je _continue_ + cmp esi,dword ptr [esp+28h] + jbe _lu_done +_continue_: + lea esi,[esi+esi*2] + mov ecx,dword ptr [ebx+esi*4] + mov dword ptr [esp+8],ecx + mov dword ptr [eax+0Ch],ecx + cmp dword ptr [ebx+esi*4+4],0 + jne __NLG_Return2 + push 101h + mov eax,dword ptr [ebx+esi*4+8] + call __NLG_Notify + call dword ptr [ebx+esi*4+8] +__NLG_Return2: + jmp _lu_top +_lu_done: + pop dword ptr fs:[0] + nop ; 00 + add esp,10h + pop edi + pop esi + pop ebx + ret +__abnormal_termination: + xor eax,eax + mov ecx,dword ptr fs:[0] + nop ; 00 + cmp dword ptr [ecx+4],offset __unwind_handler + nop ; 00 + jne _at_done + mov edx,dword ptr [ecx+0Ch] + mov edx,dword ptr [edx+0Ch] + cmp dword ptr [ecx+8],edx + jne _at_done + mov eax,1 +_at_done: + ret +__NLG_Notify1: + push ebx + push ecx + mov ebx,offset __NLG_Destination + jmp __NLG_Go +__NLG_Notify: + push ebx + push ecx + mov ebx,offset __NLG_Destination + mov ecx,dword ptr [ebp+8] +__NLG_Go: + mov dword ptr [ebx+8],ecx + mov dword ptr [ebx+4],eax + mov dword ptr [ebx+0Ch],ebp + push ebp + push ecx + push eax +__NLG_Dispatch: + pop eax + pop ecx + pop ebp + pop ecx + pop ebx + ret 4 + +;__global_unwind2 endp + + +EXTERN _NtQueryVirtualMemory@24: PROC + +;__ValidateEH3RN proc near + +__ValidateEH3RN: + mov edi,edi + push ebp + mov ebp,esp + sub esp,20h + push ebx + push esi + mov esi,dword ptr [ebp+8] + mov ebx,dword ptr [esi+8] + test bl,3 + jne label01 + mov eax,dword ptr fs:[00000004h] + mov dword ptr [ebp+8],eax + mov eax,dword ptr fs:[00000008h] + mov dword ptr [ebp-4],eax + cmp ebx,dword ptr [ebp-4] + jb label02 + cmp ebx,dword ptr [ebp+8] + jae label02 +label01: + xor eax,eax + jmp label03 +label02: + push edi + mov edi,dword ptr [esi+0Ch] + cmp edi,0FFFFFFFFh + jne label04 + xor eax,eax + inc eax + jmp label05 +label04: + xor edx,edx + mov dword ptr [ebp+8],edx + mov eax,ebx +label30: + mov ecx,dword ptr [eax] + cmp ecx,0FFFFFFFFh + je label06 + cmp ecx,edx + jae label07 +label06: + cmp dword ptr [eax+4],0 + je label10 + inc dword ptr [ebp+8] +label10: + inc edx + add eax,0Ch + cmp edx,edi + jbe label30 + cmp dword ptr [ebp+8],0 + je label11 + mov eax,dword ptr [esi-8] + cmp eax,dword ptr [ebp-4] + jb label07 + cmp eax,esi + jae label07 +label11: + mov ecx,dword ptr [_nValidPages] + mov esi,ebx + and esi,0FFFFF000h + xor eax,eax + test ecx,ecx + jle label08 +label12: + cmp dword ptr _rgValidPages[eax*4],esi + nop ; 00 + je label09 + inc eax + cmp eax,ecx + jl label12 +label08: + lea eax,[ebp+8] + push eax + push 1Ch + lea eax,[ebp-20h] + push eax + push 0 + push ebx + or edi,0FFFFFFFFh + push edi + ;call _NtQueryVirtualMemory + call _NtQueryVirtualMemory@24 ; call it from ntdll.lib + test eax,eax + jl label13 + mov eax,dword ptr [ebp+8] + jmp label14 + xor eax,eax +label07: + jmp label05 + test eax,eax +label09: + jle label15 + xor edx,edx + mov ebx,offset _lModifying + inc edx + mov edi,ebx + xchg edx,dword ptr [edi] + test edx,edx + jne label15 + cmp dword ptr _rgValidPages[eax*4],esi + nop ; 00 + je label15 + lea eax,[ecx-1] + test eax,eax + jl label16 +label18: + cmp dword ptr _rgValidPages[eax*4],esi + nop ; 00 + je label17 + dec eax + jns label18 +label17: + test eax,eax + jge label19 + cmp ecx,10h +label16: + jge label20 + inc ecx + mov dword ptr [_nValidPages],ecx +label20: + lea eax,[ecx-1] + jmp label15 +label19: + je label21 +label15: + xor edx,edx + test eax,eax + jl label21 +label22: + lea ecx,_rgValidPages[edx*4] + nop ; 00 + mov edi,dword ptr [ecx] + inc edx + cmp edx,eax + mov dword ptr [ecx],esi + mov esi,edi + jle label22 +label21: + xor eax,eax + xchg eax,dword ptr [ebx] + jmp label15 +label13: + xor eax,eax +label14: + test eax,eax + je label23 + cmp dword ptr [ebp-8],1000000h + nop ; 01 + jne label23 + test byte ptr [ebp-0Ch],0CCh + je label0 + mov ecx,dword ptr [ebp-1Ch] + cmp word ptr [ecx],5A4Dh + jne label23 + mov eax,dword ptr [ecx+3Ch] + add eax,ecx + cmp dword ptr [eax],4550h + jne label23 + cmp word ptr [eax+18h],10Bh + jne label23 + sub ebx,ecx + cmp word ptr [eax+6],0 + movzx ecx,word ptr [eax+14h] + lea ecx,[ecx+eax+18h] + jbe label23 + mov eax,dword ptr [ecx+0Ch] + cmp ebx,eax + jb label0 + mov edx,dword ptr [ecx+8] + add edx,eax + cmp ebx,edx + jae label0 + test byte ptr [ecx+27h],80h + jne label07 +label0: + xor eax,eax + inc eax + mov ecx,eax + mov edx,offset _lModifying + xchg ecx,dword ptr [edx] + test ecx,ecx + jne label05 + mov ecx,dword ptr [_nValidPages] + test ecx,ecx + mov edx,ecx + jle label24 + lea eax,_rgValidPages[ecx*4+0FFFFFFFCh] + nop ; FF +label25: + cmp dword ptr [eax],esi + je label24 + dec edx + sub eax,4 + test edx,edx + jg label25 +label24: + test edx,edx + jne label26 + push 0Fh + pop ebx + cmp ecx,ebx + jg label27 + mov ebx,ecx +label27: + xor edx,edx + test ebx,ebx + jl label28 +label29: + lea eax,_rgValidPages[edx*4] + nop ; 00 + mov edi,dword ptr [eax] + inc edx + cmp edx,ebx + mov dword ptr [eax],esi + mov esi,edi + jle label29 +label28: + cmp ecx,10h + jge label26 + inc ecx + mov dword ptr [_nValidPages],ecx +label26: + xor eax,eax + mov ecx,offset _lModifying + xchg eax,dword ptr [ecx] + jmp label15 +label23: + mov eax,edi +label05: + pop edi +label03: + pop esi + pop ebx + leave + ret + +;__ValidateEH3RN endp + +_TEXT ends + + +.model flat +.data + +; Global variables for __NLG_Destination +;typedef struct { +; unsigned long dwSig; +; unsigned long uoffDestination; +; unsigned long dwCode; +; unsigned long uoffFramePointer; +;} _NLG_INFO; +;_NLG_INFO _NLG_Destination = { 0x019930520, 0, 0, 0 }; +__NLG_Destination LABEL DWORD + dd 1 dup (019930520h) ; MAGIC_NUMBER1 + dd 1 dup (0) + dd 1 dup (0) + dd 1 dup (0) + public __NLG_Destination + + +; Global variables for __ValidateEH3RN +;INT _nValidPages = 0; +_nValidPages LABEL DWORD + dd 1 dup (0) + public _nValidPages +;PVOID _rgValidPages[0x10] = { NULL }; +_rgValidPages LABEL DWORD + dd 16 dup (0) + public _rgValidPages +;BOOL _lModifying = FALSE; +_lModifying LABEL DWORD + dd 1 dup (0) + public _lModifying + + end \ No newline at end of file diff --git a/Sandboxie/common/NtCRT/x86/ntdll.def b/Sandboxie/common/NtCRT/x86/ntdll.def index 2ebdac02..155645e1 100644 --- a/Sandboxie/common/NtCRT/x86/ntdll.def +++ b/Sandboxie/common/NtCRT/x86/ntdll.def @@ -1,184 +1,184 @@ -EXPORTS -_CIcos -_CIlog -_CIpow -_CIsin -_CIsqrt -__isascii -__iscsym -__iscsymf -__toascii -_alldiv -_alldvrm -_allmul -_alloca_probe -_alloca_probe_16 -_alloca_probe_8 -_allrem -_allshl -_allshr -_atoi64 -_aulldiv -_aulldvrm -_aullrem -_aullshr -_chkstk -_fltused -_ftol -_i64toa -_i64toa_s -_i64tow -_i64tow_s -_itoa -_itoa_s -_itow -_itow_s -_lfind -_ltoa -_ltoa_s -_ltow -_ltow_s -_makepath_s -_memccpy -_memicmp -_snprintf -_snprintf_s -_snscanf_s -_snwprintf -_snwprintf_s -_snwscanf_s -_splitpath -_splitpath_s -_strcmpi -_stricmp -_strlwr -_strnicmp -_strnset_s -_strset_s -_strupr -_swprintf -_ui64toa -_ui64toa_s -_ui64tow -_ui64tow_s -_ultoa -_ultoa_s -_ultow -_ultow_s -_vscwprintf -_vsnprintf -_vsnprintf_s -_vsnwprintf -_vsnwprintf_s -_vswprintf -_wcsicmp -_wcslwr -_wcsnicmp -_wcsnset_s -_wcsset_s -_wcstoui64 -_wcsupr -_wmakepath_s -_wsplitpath_s -_wtoi -_wtoi64 -_wtol -abs -atan -atoi -atol -bsearch -ceil -cos -fabs -floor -isalnum -isalpha -iscntrl -isdigit -isgraph -islower -isprint -ispunct -isspace -isupper -iswalpha -iswctype -iswdigit -iswlower -iswspace -iswxdigit -isxdigit -labs -log -mbstowcs -memchr -memcmp -memcpy -memcpy_s -memmove -memmove_s -memset -pow -qsort -sin -sprintf -sprintf_s -sqrt -sscanf -sscanf_s -strcat -strcat_s -strchr -strcmp -strcpy -strcpy_s -strcspn -strlen -strncat -strncat_s -strncmp -strncpy -strncpy_s -strnlen -strpbrk -strrchr -strspn -strstr -strtok_s -strtol -strtoul -swprintf -swprintf_s -swscanf_s -tan -tolower -toupper -towlower -towupper -vDbgPrintEx -vDbgPrintExWithPrefix -vsprintf -vsprintf_s -vswprintf_s -wcscat -wcscat_s -wcschr -wcscmp -wcscpy -wcscpy_s -wcscspn -wcslen -wcsncat -wcsncat_s -wcsncmp -wcsncpy -wcsncpy_s -wcsnlen -wcspbrk -wcsrchr -wcsspn -wcsstr -wcstol -wcstombs -wcstoul +EXPORTS +_CIcos +_CIlog +_CIpow +_CIsin +_CIsqrt +__isascii +__iscsym +__iscsymf +__toascii +_alldiv +_alldvrm +_allmul +_alloca_probe +_alloca_probe_16 +_alloca_probe_8 +_allrem +_allshl +_allshr +_atoi64 +_aulldiv +_aulldvrm +_aullrem +_aullshr +_chkstk +_fltused +_ftol +_i64toa +_i64toa_s +_i64tow +_i64tow_s +_itoa +_itoa_s +_itow +_itow_s +_lfind +_ltoa +_ltoa_s +_ltow +_ltow_s +_makepath_s +_memccpy +_memicmp +_snprintf +_snprintf_s +_snscanf_s +_snwprintf +_snwprintf_s +_snwscanf_s +_splitpath +_splitpath_s +_strcmpi +_stricmp +_strlwr +_strnicmp +_strnset_s +_strset_s +_strupr +_swprintf +_ui64toa +_ui64toa_s +_ui64tow +_ui64tow_s +_ultoa +_ultoa_s +_ultow +_ultow_s +_vscwprintf +_vsnprintf +_vsnprintf_s +_vsnwprintf +_vsnwprintf_s +_vswprintf +_wcsicmp +_wcslwr +_wcsnicmp +_wcsnset_s +_wcsset_s +_wcstoui64 +_wcsupr +_wmakepath_s +_wsplitpath_s +_wtoi +_wtoi64 +_wtol +abs +atan +atoi +atol +bsearch +ceil +cos +fabs +floor +isalnum +isalpha +iscntrl +isdigit +isgraph +islower +isprint +ispunct +isspace +isupper +iswalpha +iswctype +iswdigit +iswlower +iswspace +iswxdigit +isxdigit +labs +log +mbstowcs +memchr +memcmp +memcpy +memcpy_s +memmove +memmove_s +memset +pow +qsort +sin +sprintf +sprintf_s +sqrt +sscanf +sscanf_s +strcat +strcat_s +strchr +strcmp +strcpy +strcpy_s +strcspn +strlen +strncat +strncat_s +strncmp +strncpy +strncpy_s +strnlen +strpbrk +strrchr +strspn +strstr +strtok_s +strtol +strtoul +swprintf +swprintf_s +swscanf_s +tan +tolower +toupper +towlower +towupper +vDbgPrintEx +vDbgPrintExWithPrefix +vsprintf +vsprintf_s +vswprintf_s +wcscat +wcscat_s +wcschr +wcscmp +wcscpy +wcscpy_s +wcscspn +wcslen +wcsncat +wcsncat_s +wcsncmp +wcsncpy +wcsncpy_s +wcsnlen +wcspbrk +wcsrchr +wcsspn +wcsstr +wcstol +wcstombs +wcstoul diff --git a/Sandboxie/core/dll/SboxDll.def b/Sandboxie/core/dll/SboxDll.def index 4f3605e7..47308714 100644 --- a/Sandboxie/core/dll/SboxDll.def +++ b/Sandboxie/core/dll/SboxDll.def @@ -1,3 +1,3 @@ -LIBRARY SboxDll -#define SBIEDLL_LIBRARY_STATEMENT_ISSUED -#include "sbiedll.def" +LIBRARY SboxDll +#define SBIEDLL_LIBRARY_STATEMENT_ISSUED +#include "sbiedll.def" diff --git a/Sandboxie/core/dll/SboxDll32.def b/Sandboxie/core/dll/SboxDll32.def index d20ee20a..085fae16 100644 --- a/Sandboxie/core/dll/SboxDll32.def +++ b/Sandboxie/core/dll/SboxDll32.def @@ -1,115 +1,115 @@ - -EXPORTS - -;;; -;;; Ordinal 1 -;;; - -Dll_Ordinal1 @1 NONAME - -;;; -;;; SbieApiSbieApi_LogEx -;;; - - -SbieApi_CheckInternetAccess=_SbieApi_CheckInternetAccess@12 - -SbieApi_DisableForceProcess=_SbieApi_DisableForceProcess@8 - -SbieApi_EnumBoxes=_SbieApi_EnumBoxes@8 -SbieApi_EnumProcessEx=_SbieApi_EnumProcessEx@20 - -SbieApi_GetFileName=_SbieApi_GetFileName@12 -SbieApi_GetHomePath=_SbieApi_GetHomePath@16 -SbieApi_GetUnmountHive=_SbieApi_GetUnmountHive@4 -SbieApi_GetVersion=_SbieApi_GetVersion@4 -;;; SbieApi_GetWork=_SbieApi_GetWork@12 -SbieApi_GetMessage=_SbieApi_GetMessage@24 - -SbieApi_HookTramp=_SbieApi_HookTramp@8 - -SbieApi_IsBoxEnabled=_SbieApi_IsBoxEnabled@4 - -SbieApi_MonitorControl=_SbieApi_MonitorControl@8 -;;; SbieApi_MonitorGet=_SbieApi_MonitorGet@8 -SbieApi_MonitorGetEx=_SbieApi_MonitorGetEx@16 -SbieApi_MonitorPut=_SbieApi_MonitorPut@8 -SbieApi_MonitorPut2=_SbieApi_MonitorPut2@12 - -SbieApi_OpenProcess=_SbieApi_OpenProcess@8 - -SbieApi_QueryBoxPath=_SbieApi_QueryBoxPath@28 -SbieApi_QueryConf=_SbieApi_QueryConf@20 -SbieApi_QueryConfBool=_SbieApi_QueryConfBool@12 -SbieApi_QueryPathList=_SbieApi_QueryPathList@16 -SbieApi_QueryProcess=_SbieApi_QueryProcess@20 -SbieApi_QueryProcessEx=_SbieApi_QueryProcessEx@24 -SbieApi_QueryProcessInfo=_SbieApi_QueryProcessInfo@8 -SbieApi_QueryProcessPath=_SbieApi_QueryProcessPath@28 - -SbieApi_ReloadConf=_SbieApi_ReloadConf@8 - -SbieApi_SessionLeader=_SbieApi_SessionLeader@8 -SbieApi_SetUserName=_SbieApi_SetUserName@8 - -;;; -;;; SbieDll -;;; - -SbieDll_CallServer=_SbieDll_CallServer@4 - -SbieDll_ComCreateProxy=_SbieDll_ComCreateProxy@16 -SbieDll_ComCreateStub=_SbieDll_ComCreateStub@16 - -SbieDll_DeviceChange=_SbieDll_DeviceChange@8 -SbieDll_DisableElevationHook=_SbieDll_DisableElevationHook@0 - -SbieDll_ExpandAndRunProgram=_SbieDll_ExpandAndRunProgram@4 - -SbieDll_FormatMessage=_SbieDll_FormatMessage@8 -SbieDll_FormatMessage0=_SbieDll_FormatMessage0@4 -SbieDll_FormatMessage1=_SbieDll_FormatMessage1@8 -SbieDll_FormatMessage2=_SbieDll_FormatMessage2@12 -SbieDll_FreeMem=_SbieDll_FreeMem@4 - -SbieDll_GetDrivePath=_SbieDll_GetDrivePath@4 -SbieDll_GetHandlePath=_SbieDll_GetHandlePath@12 -SbieDll_GetLanguage=_SbieDll_GetLanguage@4 -SbieDll_GetServiceRegistryValue=_SbieDll_GetServiceRegistryValue@12 -SbieDll_GetStartError=_SbieDll_GetStartError@0 -SbieDll_GetTokenElevationType=_SbieDll_GetTokenElevationType@0 -SbieDll_GetUserPathEx=_SbieDll_GetUserPathEx@4 - -SbieDll_Hook=_SbieDll_Hook@12 - -SbieDll_InitPStore=_SbieDll_InitPStore@0 -SbieDll_IsBoxedService=_SbieDll_IsBoxedService@4 -SbieDll_IsDirectory=_SbieDll_IsDirectory@4 -SbieDll_IsOpenCOM=_SbieDll_IsOpenCOM@0 -SbieDll_IsOpenClsid=_SbieDll_IsOpenClsid@12 - -SbieDll_PortName=_SbieDll_PortName@0 - -SbieDll_QueueCreate=_SbieDll_QueueCreate@8 -SbieDll_QueueGetReq=_SbieDll_QueueGetReq@24 -SbieDll_QueueGetRpl=_SbieDll_QueueGetRpl@16 -SbieDll_QueuePutReq=_SbieDll_QueuePutReq@20 -SbieDll_QueuePutRpl=_SbieDll_QueuePutRpl@16 - -SbieDll_UpdateConf=_SbieDll_UpdateConf@20 - -SbieDll_AssocQueryCommand=_SbieDll_AssocQueryCommand@4 -SbieDll_AssocQueryProgram=_SbieDll_AssocQueryProgram@4 - -SbieDll_KillAll=_SbieDll_KillAll@8 -SbieDll_KillOne=_SbieDll_KillOne@4 - -SbieDll_RegisterDllCallback=_SbieDll_RegisterDllCallback@4 -SbieDll_RunFromHome=_SbieDll_RunFromHome@16 -SbieDll_RunSandboxed=_SbieDll_RunSandboxed@24 - -SbieDll_StartBoxedService=_SbieDll_StartBoxedService@8 -SbieDll_StartCOM=_SbieDll_StartCOM@4 -SbieDll_StartSbieSvc=_SbieDll_StartSbieSvc@4 - + +EXPORTS + +;;; +;;; Ordinal 1 +;;; + +Dll_Ordinal1 @1 NONAME + +;;; +;;; SbieApiSbieApi_LogEx +;;; + + +SbieApi_CheckInternetAccess=_SbieApi_CheckInternetAccess@12 + +SbieApi_DisableForceProcess=_SbieApi_DisableForceProcess@8 + +SbieApi_EnumBoxes=_SbieApi_EnumBoxes@8 +SbieApi_EnumProcessEx=_SbieApi_EnumProcessEx@20 + +SbieApi_GetFileName=_SbieApi_GetFileName@12 +SbieApi_GetHomePath=_SbieApi_GetHomePath@16 +SbieApi_GetUnmountHive=_SbieApi_GetUnmountHive@4 +SbieApi_GetVersion=_SbieApi_GetVersion@4 +;;; SbieApi_GetWork=_SbieApi_GetWork@12 +SbieApi_GetMessage=_SbieApi_GetMessage@24 + +SbieApi_HookTramp=_SbieApi_HookTramp@8 + +SbieApi_IsBoxEnabled=_SbieApi_IsBoxEnabled@4 + +SbieApi_MonitorControl=_SbieApi_MonitorControl@8 +;;; SbieApi_MonitorGet=_SbieApi_MonitorGet@8 +SbieApi_MonitorGetEx=_SbieApi_MonitorGetEx@16 +SbieApi_MonitorPut=_SbieApi_MonitorPut@8 +SbieApi_MonitorPut2=_SbieApi_MonitorPut2@12 + +SbieApi_OpenProcess=_SbieApi_OpenProcess@8 + +SbieApi_QueryBoxPath=_SbieApi_QueryBoxPath@28 +SbieApi_QueryConf=_SbieApi_QueryConf@20 +SbieApi_QueryConfBool=_SbieApi_QueryConfBool@12 +SbieApi_QueryPathList=_SbieApi_QueryPathList@16 +SbieApi_QueryProcess=_SbieApi_QueryProcess@20 +SbieApi_QueryProcessEx=_SbieApi_QueryProcessEx@24 +SbieApi_QueryProcessInfo=_SbieApi_QueryProcessInfo@8 +SbieApi_QueryProcessPath=_SbieApi_QueryProcessPath@28 + +SbieApi_ReloadConf=_SbieApi_ReloadConf@8 + +SbieApi_SessionLeader=_SbieApi_SessionLeader@8 +SbieApi_SetUserName=_SbieApi_SetUserName@8 + +;;; +;;; SbieDll +;;; + +SbieDll_CallServer=_SbieDll_CallServer@4 + +SbieDll_ComCreateProxy=_SbieDll_ComCreateProxy@16 +SbieDll_ComCreateStub=_SbieDll_ComCreateStub@16 + +SbieDll_DeviceChange=_SbieDll_DeviceChange@8 +SbieDll_DisableElevationHook=_SbieDll_DisableElevationHook@0 + +SbieDll_ExpandAndRunProgram=_SbieDll_ExpandAndRunProgram@4 + +SbieDll_FormatMessage=_SbieDll_FormatMessage@8 +SbieDll_FormatMessage0=_SbieDll_FormatMessage0@4 +SbieDll_FormatMessage1=_SbieDll_FormatMessage1@8 +SbieDll_FormatMessage2=_SbieDll_FormatMessage2@12 +SbieDll_FreeMem=_SbieDll_FreeMem@4 + +SbieDll_GetDrivePath=_SbieDll_GetDrivePath@4 +SbieDll_GetHandlePath=_SbieDll_GetHandlePath@12 +SbieDll_GetLanguage=_SbieDll_GetLanguage@4 +SbieDll_GetServiceRegistryValue=_SbieDll_GetServiceRegistryValue@12 +SbieDll_GetStartError=_SbieDll_GetStartError@0 +SbieDll_GetTokenElevationType=_SbieDll_GetTokenElevationType@0 +SbieDll_GetUserPathEx=_SbieDll_GetUserPathEx@4 + +SbieDll_Hook=_SbieDll_Hook@12 + +SbieDll_InitPStore=_SbieDll_InitPStore@0 +SbieDll_IsBoxedService=_SbieDll_IsBoxedService@4 +SbieDll_IsDirectory=_SbieDll_IsDirectory@4 +SbieDll_IsOpenCOM=_SbieDll_IsOpenCOM@0 +SbieDll_IsOpenClsid=_SbieDll_IsOpenClsid@12 + +SbieDll_PortName=_SbieDll_PortName@0 + +SbieDll_QueueCreate=_SbieDll_QueueCreate@8 +SbieDll_QueueGetReq=_SbieDll_QueueGetReq@24 +SbieDll_QueueGetRpl=_SbieDll_QueueGetRpl@16 +SbieDll_QueuePutReq=_SbieDll_QueuePutReq@20 +SbieDll_QueuePutRpl=_SbieDll_QueuePutRpl@16 + +SbieDll_UpdateConf=_SbieDll_UpdateConf@20 + +SbieDll_AssocQueryCommand=_SbieDll_AssocQueryCommand@4 +SbieDll_AssocQueryProgram=_SbieDll_AssocQueryProgram@4 + +SbieDll_KillAll=_SbieDll_KillAll@8 +SbieDll_KillOne=_SbieDll_KillOne@4 + +SbieDll_RegisterDllCallback=_SbieDll_RegisterDllCallback@4 +SbieDll_RunFromHome=_SbieDll_RunFromHome@16 +SbieDll_RunSandboxed=_SbieDll_RunSandboxed@24 + +SbieDll_StartBoxedService=_SbieDll_StartBoxedService@8 +SbieDll_StartCOM=_SbieDll_StartCOM@4 +SbieDll_StartSbieSvc=_SbieDll_StartSbieSvc@4 + SbieDll_TranslateNtToDosPath=_SbieDll_TranslateNtToDosPath@4 \ No newline at end of file diff --git a/Sandboxie/core/dll/SboxDll64.def b/Sandboxie/core/dll/SboxDll64.def index 9a6e096e..5c5522f6 100644 --- a/Sandboxie/core/dll/SboxDll64.def +++ b/Sandboxie/core/dll/SboxDll64.def @@ -1,8 +1,8 @@ - -EXPORTS - -;;; -;;; Ordinal 1 -;;; - -Dll_Ordinal1 @1 NONAME + +EXPORTS + +;;; +;;; Ordinal 1 +;;; + +Dll_Ordinal1 @1 NONAME diff --git a/Sandboxie/core/dll/pstore.idl b/Sandboxie/core/dll/pstore.idl index fc25d0f9..aedac921 100644 --- a/Sandboxie/core/dll/pstore.idl +++ b/Sandboxie/core/dll/pstore.idl @@ -1,255 +1,255 @@ -import "oaidl.idl"; - -cpp_quote("#define PST_KEY_CURRENT_USER 0") -cpp_quote("#define PST_KEY_LOCAL_MACHINE 1") - -cpp_quote("#define PST_E_OK 0x00000000L") -cpp_quote("#define PST_E_TYPE_EXISTS 0x800C0004L") -cpp_quote("#define PST_E_TYPE_NO_EXISTS 0x800C0005L") -cpp_quote("#define PST_E_ITEM_EXISTS 0x800C000FL") -cpp_quote("#define PST_E_ITEM_NO_EXISTS 0x800C0010L") - -cpp_quote("#define PST_NO_OVERWRITE 0x00000002L") -cpp_quote("#define PST_UNRESTRICTED_ITEMDATA 0x00000004L") - - -//#define PST_PF_ALWAYS_SHOW 0x00000001 -#define PST_PF_NEVER_SHOW 0x00000002 -//#define PST_CF_DEFAULT 0x00000000 -//#define PST_CF_NONE 0x00000001 - - -cpp_quote("#define PST_AUTHENTICODE 1") -cpp_quote("#define PST_BINARY_CHECK 2") -cpp_quote("#define PST_SECURITY_DESCRIPTOR 4") - -typedef DWORD PST_ACCESSMODE; -typedef DWORD PST_ACCESSCLAUSETYPE; -typedef DWORD PST_KEY; -typedef DWORD PST_PROVIDERCAPABILITIES; -typedef GUID PST_PROVIDERID, *PPST_PROVIDERID; - -typedef struct _PST_PROVIDERINFO -{ - DWORD cbSize; - PST_PROVIDERID ID; - PST_PROVIDERCAPABILITIES Capabilities; - LPWSTR szProviderName; -} PST_PROVIDERINFO, *PPST_PROVIDERINFO; - -typedef struct { - DWORD cbSize; - PST_ACCESSCLAUSETYPE ClauseType; - DWORD cbClauseData; - BYTE* pbClauseData; -} PST_ACCESSCLAUSE, *PPST_ACCESSCLAUSE; - -typedef struct { - DWORD cbSize; - PST_ACCESSMODE AccessModeFlags; - DWORD cClauses; - PST_ACCESSCLAUSE* rgClauses; -} PST_ACCESSRULE, *PPST_ACCESSRULE; - -typedef struct { - DWORD cbSize; - DWORD cClause; - PST_ACCESSRULE* rgRules; -} PST_ACCESSRULESET, *PPST_ACCESSRULESET; - -typedef struct { - DWORD cbSize; - LPWSTR szDisplayName; -} PST_TYPEINFO, *PPST_TYPEINFO; - -typedef struct { - DWORD cbSize; - DWORD dwPromptFlags; - DWORD *hwndApp; - LPCWSTR szPrompt; -} PST_PROMPTINFO, *PPST_PROMPTINFO; - -[ - object, - uuid(4C83B307-0B70-4726-8F75-396EBBDAA401), - pointer_default(unique) -] -interface IEnumPStoreItems : IUnknown -{ - HRESULT Next( - [in] DWORD celt, - [in] LPWSTR* rgelt, - [in] DWORD* pceltFetched ); - - HRESULT Skip( - [in] DWORD celt ); - - HRESULT Reset(); - - HRESULT Clone( - [in] IEnumPStoreItems** ppenum ); -} - -[ - object, - uuid(4C83B307-0B70-4726-8F75-396EBBDAA402), - pointer_default(unique) -] -interface IEnumPStoreTypes : IUnknown -{ - HRESULT Next( - [in] DWORD celt, - [in] GUID* rgelt, - [in] DWORD* pceltFetched ); - - HRESULT Skip( - [in] DWORD celt ); - - HRESULT Reset(); - - HRESULT Clone( - [in] IEnumPStoreTypes** ppenum ); -} - -/***************************************************************************** - * IPStore interface - */ -[ - object, - uuid(4C83B307-0B70-4726-8F75-396EBBDAA403), - pointer_default(unique) -] -interface IPStore : IUnknown -{ - HRESULT GetInfo( - [in] PPST_PROVIDERINFO* ppProperties ); - - HRESULT GetProvParam( - [in] DWORD dwParam, - [out] DWORD* pcbData, - [out] BYTE** ppbData, - [in] DWORD dwFlags ); - - HRESULT SetProvParam( - [in] DWORD dwParam, - [in] DWORD cbData, - [in] BYTE* pbData, - [in] DWORD* dwFlags ); - - HRESULT CreateType( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] PPST_TYPEINFO pInfo, - [in] DWORD dwFlags ); - - HRESULT GetTypeInfo( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] PPST_TYPEINFO** ppInfo, - [in] DWORD dwFlags ); - - HRESULT DeleteType( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] DWORD dwFlags ); - - HRESULT CreateSubtype( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] const GUID* pSubtype, - [in] PPST_TYPEINFO pInfo, - [in] PPST_ACCESSRULESET pRules, - [in] DWORD dwFlags ); - - HRESULT GetSubtypeInfo( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] const GUID* pSubtype, - [in] PPST_TYPEINFO** ppInfo, - [in] DWORD dwFlags ); - - HRESULT DeleteSubtype( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] const GUID* pSubtype, - [in] DWORD dwFlags ); - - HRESULT ReadAccessRuleset( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] const GUID* pSubtype, - [in] PPST_TYPEINFO pInfo, - [in] PPST_ACCESSRULESET** ppRules, - [in] DWORD dwFlags ); - - HRESULT WriteAccessRuleset( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] const GUID* pSubtype, - [in] PPST_TYPEINFO pInfo, - [in] PPST_ACCESSRULESET pRules, - [in] DWORD dwFlags ); - - HRESULT EnumTypes( - [in] PST_KEY Key, - [in] DWORD dwFlags, - [in] IEnumPStoreTypes** ppenum ); - - HRESULT EnumSubtypes( - [in] PST_KEY Key, - [in] const GUID* pType, - [in] DWORD dwFlags, - [in] IEnumPStoreTypes** ppenum ); - - HRESULT DeleteItem( - [in] PST_KEY Key, - [in] const GUID* pItemType, - [in] const GUID* pItemSubType, - [in] LPCWSTR szItemName, - [in] PPST_PROMPTINFO pPromptInfo, - [in] DWORD dwFlags ); - - HRESULT ReadItem( - [in] PST_KEY Key, - [in] const GUID* pItemType, - [in] const GUID* pItemSubtype, - [in] LPCWSTR szItemName, - [in] DWORD *cbData, - [in] BYTE** ppbData, - [in] PPST_PROMPTINFO pPromptInfo, - [in] DWORD dwFlags ); - - HRESULT WriteItem( - [in] PST_KEY Key, - [in] const GUID* pItemType, - [in] const GUID* pItemSubtype, - [in] LPCWSTR szItemName, - [in] DWORD cbData, - [in,size_is(cbData)] BYTE *pbData, - [in] PPST_PROMPTINFO pPromptInfo, - [in] DWORD dwDefaultConfirmationStyle, - [in] DWORD dwFlags); - - HRESULT OpenItem( - [in] PST_KEY Key, - [in] const GUID* pItemType, - [in] const GUID* pItemSubtype, - [in] LPCWSTR szItemName, - [in] PST_ACCESSMODE ModeFlags, - [in] PPST_PROMPTINFO pProomptInfo, - [in] DWORD dwFlags ); - - HRESULT CloseItem( - [in] PST_KEY Key, - [in] const GUID* pItemType, - [in] const GUID* pItemSubtype, - [in] LPCWSTR* szItemName, - [in] DWORD dwFlags ); - - HRESULT EnumItems( - [in] PST_KEY Key, - [in] const GUID* pItemType, - [in] const GUID* pItemSubtype, - [in] DWORD dwFlags, - [in] IEnumPStoreItems** ppenum ); -} +import "oaidl.idl"; + +cpp_quote("#define PST_KEY_CURRENT_USER 0") +cpp_quote("#define PST_KEY_LOCAL_MACHINE 1") + +cpp_quote("#define PST_E_OK 0x00000000L") +cpp_quote("#define PST_E_TYPE_EXISTS 0x800C0004L") +cpp_quote("#define PST_E_TYPE_NO_EXISTS 0x800C0005L") +cpp_quote("#define PST_E_ITEM_EXISTS 0x800C000FL") +cpp_quote("#define PST_E_ITEM_NO_EXISTS 0x800C0010L") + +cpp_quote("#define PST_NO_OVERWRITE 0x00000002L") +cpp_quote("#define PST_UNRESTRICTED_ITEMDATA 0x00000004L") + + +//#define PST_PF_ALWAYS_SHOW 0x00000001 +#define PST_PF_NEVER_SHOW 0x00000002 +//#define PST_CF_DEFAULT 0x00000000 +//#define PST_CF_NONE 0x00000001 + + +cpp_quote("#define PST_AUTHENTICODE 1") +cpp_quote("#define PST_BINARY_CHECK 2") +cpp_quote("#define PST_SECURITY_DESCRIPTOR 4") + +typedef DWORD PST_ACCESSMODE; +typedef DWORD PST_ACCESSCLAUSETYPE; +typedef DWORD PST_KEY; +typedef DWORD PST_PROVIDERCAPABILITIES; +typedef GUID PST_PROVIDERID, *PPST_PROVIDERID; + +typedef struct _PST_PROVIDERINFO +{ + DWORD cbSize; + PST_PROVIDERID ID; + PST_PROVIDERCAPABILITIES Capabilities; + LPWSTR szProviderName; +} PST_PROVIDERINFO, *PPST_PROVIDERINFO; + +typedef struct { + DWORD cbSize; + PST_ACCESSCLAUSETYPE ClauseType; + DWORD cbClauseData; + BYTE* pbClauseData; +} PST_ACCESSCLAUSE, *PPST_ACCESSCLAUSE; + +typedef struct { + DWORD cbSize; + PST_ACCESSMODE AccessModeFlags; + DWORD cClauses; + PST_ACCESSCLAUSE* rgClauses; +} PST_ACCESSRULE, *PPST_ACCESSRULE; + +typedef struct { + DWORD cbSize; + DWORD cClause; + PST_ACCESSRULE* rgRules; +} PST_ACCESSRULESET, *PPST_ACCESSRULESET; + +typedef struct { + DWORD cbSize; + LPWSTR szDisplayName; +} PST_TYPEINFO, *PPST_TYPEINFO; + +typedef struct { + DWORD cbSize; + DWORD dwPromptFlags; + DWORD *hwndApp; + LPCWSTR szPrompt; +} PST_PROMPTINFO, *PPST_PROMPTINFO; + +[ + object, + uuid(4C83B307-0B70-4726-8F75-396EBBDAA401), + pointer_default(unique) +] +interface IEnumPStoreItems : IUnknown +{ + HRESULT Next( + [in] DWORD celt, + [in] LPWSTR* rgelt, + [in] DWORD* pceltFetched ); + + HRESULT Skip( + [in] DWORD celt ); + + HRESULT Reset(); + + HRESULT Clone( + [in] IEnumPStoreItems** ppenum ); +} + +[ + object, + uuid(4C83B307-0B70-4726-8F75-396EBBDAA402), + pointer_default(unique) +] +interface IEnumPStoreTypes : IUnknown +{ + HRESULT Next( + [in] DWORD celt, + [in] GUID* rgelt, + [in] DWORD* pceltFetched ); + + HRESULT Skip( + [in] DWORD celt ); + + HRESULT Reset(); + + HRESULT Clone( + [in] IEnumPStoreTypes** ppenum ); +} + +/***************************************************************************** + * IPStore interface + */ +[ + object, + uuid(4C83B307-0B70-4726-8F75-396EBBDAA403), + pointer_default(unique) +] +interface IPStore : IUnknown +{ + HRESULT GetInfo( + [in] PPST_PROVIDERINFO* ppProperties ); + + HRESULT GetProvParam( + [in] DWORD dwParam, + [out] DWORD* pcbData, + [out] BYTE** ppbData, + [in] DWORD dwFlags ); + + HRESULT SetProvParam( + [in] DWORD dwParam, + [in] DWORD cbData, + [in] BYTE* pbData, + [in] DWORD* dwFlags ); + + HRESULT CreateType( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] PPST_TYPEINFO pInfo, + [in] DWORD dwFlags ); + + HRESULT GetTypeInfo( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] PPST_TYPEINFO** ppInfo, + [in] DWORD dwFlags ); + + HRESULT DeleteType( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] DWORD dwFlags ); + + HRESULT CreateSubtype( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] const GUID* pSubtype, + [in] PPST_TYPEINFO pInfo, + [in] PPST_ACCESSRULESET pRules, + [in] DWORD dwFlags ); + + HRESULT GetSubtypeInfo( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] const GUID* pSubtype, + [in] PPST_TYPEINFO** ppInfo, + [in] DWORD dwFlags ); + + HRESULT DeleteSubtype( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] const GUID* pSubtype, + [in] DWORD dwFlags ); + + HRESULT ReadAccessRuleset( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] const GUID* pSubtype, + [in] PPST_TYPEINFO pInfo, + [in] PPST_ACCESSRULESET** ppRules, + [in] DWORD dwFlags ); + + HRESULT WriteAccessRuleset( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] const GUID* pSubtype, + [in] PPST_TYPEINFO pInfo, + [in] PPST_ACCESSRULESET pRules, + [in] DWORD dwFlags ); + + HRESULT EnumTypes( + [in] PST_KEY Key, + [in] DWORD dwFlags, + [in] IEnumPStoreTypes** ppenum ); + + HRESULT EnumSubtypes( + [in] PST_KEY Key, + [in] const GUID* pType, + [in] DWORD dwFlags, + [in] IEnumPStoreTypes** ppenum ); + + HRESULT DeleteItem( + [in] PST_KEY Key, + [in] const GUID* pItemType, + [in] const GUID* pItemSubType, + [in] LPCWSTR szItemName, + [in] PPST_PROMPTINFO pPromptInfo, + [in] DWORD dwFlags ); + + HRESULT ReadItem( + [in] PST_KEY Key, + [in] const GUID* pItemType, + [in] const GUID* pItemSubtype, + [in] LPCWSTR szItemName, + [in] DWORD *cbData, + [in] BYTE** ppbData, + [in] PPST_PROMPTINFO pPromptInfo, + [in] DWORD dwFlags ); + + HRESULT WriteItem( + [in] PST_KEY Key, + [in] const GUID* pItemType, + [in] const GUID* pItemSubtype, + [in] LPCWSTR szItemName, + [in] DWORD cbData, + [in,size_is(cbData)] BYTE *pbData, + [in] PPST_PROMPTINFO pPromptInfo, + [in] DWORD dwDefaultConfirmationStyle, + [in] DWORD dwFlags); + + HRESULT OpenItem( + [in] PST_KEY Key, + [in] const GUID* pItemType, + [in] const GUID* pItemSubtype, + [in] LPCWSTR szItemName, + [in] PST_ACCESSMODE ModeFlags, + [in] PPST_PROMPTINFO pProomptInfo, + [in] DWORD dwFlags ); + + HRESULT CloseItem( + [in] PST_KEY Key, + [in] const GUID* pItemType, + [in] const GUID* pItemSubtype, + [in] LPCWSTR* szItemName, + [in] DWORD dwFlags ); + + HRESULT EnumItems( + [in] PST_KEY Key, + [in] const GUID* pItemType, + [in] const GUID* pItemSubtype, + [in] DWORD dwFlags, + [in] IEnumPStoreItems** ppenum ); +} diff --git a/Sandboxie/core/dll/util_32.asm b/Sandboxie/core/dll/util_32.asm index bdaad37a..3fc225ef 100644 --- a/Sandboxie/core/dll/util_32.asm +++ b/Sandboxie/core/dll/util_32.asm @@ -1,279 +1,279 @@ -;------------------------------------------------------------------------ -; Copyright 2004-2020 Sandboxie Holdings, LLC -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see . -;------------------------------------------------------------------------ - -;---------------------------------------------------------------------------- -; Assembler Utilities -- 32-bit -;---------------------------------------------------------------------------- - - -;---------------------------------------------------------------------------- -; ProtectCall2 -;---------------------------------------------------------------------------- - - -_ProtectCall2@12 PROC - - push ebp - mov ebp,esp - push edi - mov edi,esp - push [ebp+16] ; push Arg2 - push [ebp+12] ; push Arg1 - call [ebp+8] ; call CallAddress - mov esp,edi - pop edi - pop ebp - ret 12 - -_ProtectCall2@12 ENDP - -PUBLIC _ProtectCall2@12 - - -;---------------------------------------------------------------------------- -; ProtectCall3 -;---------------------------------------------------------------------------- - - -_ProtectCall3@16 PROC - - push ebp - mov ebp,esp - push edi - mov edi,esp - push [ebp+20] ; push Arg3 - push [ebp+16] ; push Arg2 - push [ebp+12] ; push Arg1 - call [ebp+8] ; call CallAddress - mov esp,edi - pop edi - pop ebp - ret 16 - -_ProtectCall3@16 ENDP - -PUBLIC _ProtectCall3@16 - - -;---------------------------------------------------------------------------- -; ProtectCall4 -;---------------------------------------------------------------------------- - - -_ProtectCall4@20 PROC - - push ebp - mov ebp,esp - push edi - mov edi,esp - push [ebp+24] ; push Arg4 - push [ebp+20] ; push Arg3 - push [ebp+16] ; push Arg2 - push [ebp+12] ; push Arg1 - call [ebp+8] ; call CallAddress - mov esp,edi - pop edi - pop ebp - ret 20 - -_ProtectCall4@20 ENDP - -PUBLIC _ProtectCall4@20 - - -;---------------------------------------------------------------------------- -; RpcRt_NdrAsyncClientCall -;---------------------------------------------------------------------------- - - -EXTERN C RpcRt_NdrAsyncClientCall_x86 : PROC -EXTERN C Secure_HandleElevation : PROC -EXTERN C __sys_NdrAsyncClientCall : DWORD - -RpcRt_NdrAsyncClientCall PROC C PUBLIC - - call RpcRt_NdrAsyncClientCall_x86 - test al,al - jnz WeHandleElevation - - jmp dword ptr [__sys_NdrAsyncClientCall] - -WeHandleElevation: - - jmp Secure_HandleElevation - -RpcRt_NdrAsyncClientCall ENDP - -PUBLIC C RpcRt_NdrAsyncClientCall - - -;---------------------------------------------------------------------------- -; Ldr_Inject_Entry32 -;---------------------------------------------------------------------------- - - -EXTERN _Ldr_Inject_Entry@4 : PROC - -Ldr_Inject_Entry32@0 PROC C PUBLIC - - push esp ; pRetAddr parameter - call _Ldr_Inject_Entry@4 - - ; - ; clear the stack of any leftovers from Ldr_Inject_Entry. - ; necessary because some injected code (e.g. F-Secure) - ; assumes the stack is zero - ; - - lea edi,[esp-200h] - mov ecx,200h/4 - xor eax,eax - cld - rep stosd - - ret - -Ldr_Inject_Entry32@0 ENDP - -PUBLIC C Ldr_Inject_Entry32@0 - - -;---------------------------------------------------------------------------- -; Gui_FixupCallbackPointers -;---------------------------------------------------------------------------- - - -Gui_FixupCallbackPointers@4 PROC C PUBLIC - - ; - ; copy of USER32!FixupCallbackPointers - ; with additional zeroing of the dword at [ecx+8] before returning - ; - - push ebp - mov ebp,esp - mov ecx,dword ptr [ebp+8] - mov edx,dword ptr [ecx+10h] - push esi - xor esi,esi - add edx,ecx - cmp dword ptr [ecx+8],esi - jbe l02 -l01: mov eax,dword ptr [edx] - add eax,ecx - add dword ptr [eax],ecx - inc esi - add edx,4 - cmp esi,dword ptr [ecx+8] - jb l01 - xor edx,edx - mov dword ptr [ecx+8],edx -l02: pop esi - pop ebp - ret 4 - -Gui_FixupCallbackPointers@4 ENDP - -PUBLIC C Gui_FixupCallbackPointers@4 - - -;---------------------------------------------------------------------------- -; Gui_MsgWaitForMultipleObjects -;---------------------------------------------------------------------------- - - -EXTERN C __sys_MsgWaitForMultipleObjects : DWORD - -Gui_MsgWaitForMultipleObjects@20 PROC C PUBLIC - - test esp,3 - jnz l03 - ; stack is dword aligned, jump directly to MsgWaitForMultipleObjects - jmp __sys_MsgWaitForMultipleObjects - ; align stack before calling MsgWaitForMultipleObjects -l03: mov eax, esp -l04: dec esp - test esp,3 - jnz l04 - push eax ; save unaligned esp - push [eax+20] ; arg 5 - push [eax+16] ; arg 4 - push [eax+12] ; arg 3 - push [eax+8] ; arg 2 - push [eax+4] ; arg 1 - call __sys_MsgWaitForMultipleObjects - pop esp ; restore unaligned esp - ret 20 - -Gui_MsgWaitForMultipleObjects@20 ENDP - -PUBLIC C Gui_MsgWaitForMultipleObjects@20 - - -;---------------------------------------------------------------------------- -; RpcRt_NdrClientCall -;---------------------------------------------------------------------------- - - -EXTERN C RpcRt_NdrClientCall_x86 : PROC -;EXTERN C RpcRt_NdrClientCall_... : PROC -EXTERN C __sys_NdrClientCall : DWORD - -RpcRt_NdrClientCall PROC C PUBLIC - - call RpcRt_NdrClientCall_x86 - test al,al - jnz CancelCall - - jmp dword ptr [__sys_NdrClientCall] - -CancelCall: - -; jmp RpcRt_NdrClientCall_... - ret - -RpcRt_NdrClientCall ENDP - -PUBLIC C RpcRt_NdrClientCall - - -;---------------------------------------------------------------------------- -; RpcRt_NdrClientCall2 -;---------------------------------------------------------------------------- - - -EXTERN C RpcRt_NdrClientCall2_x86 : PROC -;EXTERN C RpcRt_NdrClientCall2_... : PROC -EXTERN C __sys_NdrClientCall2 : DWORD - -RpcRt_NdrClientCall2 PROC C PUBLIC - - call RpcRt_NdrClientCall2_x86 - test al,al - jnz CancelCall2 - - jmp dword ptr [__sys_NdrClientCall2] - -CancelCall2: - -; jmp RpcRt_NdrClientCall2_... - ret - -RpcRt_NdrClientCall2 ENDP - -PUBLIC C RpcRt_NdrClientCall2 - +;------------------------------------------------------------------------ +; Copyright 2004-2020 Sandboxie Holdings, LLC +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +;------------------------------------------------------------------------ + +;---------------------------------------------------------------------------- +; Assembler Utilities -- 32-bit +;---------------------------------------------------------------------------- + + +;---------------------------------------------------------------------------- +; ProtectCall2 +;---------------------------------------------------------------------------- + + +_ProtectCall2@12 PROC + + push ebp + mov ebp,esp + push edi + mov edi,esp + push [ebp+16] ; push Arg2 + push [ebp+12] ; push Arg1 + call [ebp+8] ; call CallAddress + mov esp,edi + pop edi + pop ebp + ret 12 + +_ProtectCall2@12 ENDP + +PUBLIC _ProtectCall2@12 + + +;---------------------------------------------------------------------------- +; ProtectCall3 +;---------------------------------------------------------------------------- + + +_ProtectCall3@16 PROC + + push ebp + mov ebp,esp + push edi + mov edi,esp + push [ebp+20] ; push Arg3 + push [ebp+16] ; push Arg2 + push [ebp+12] ; push Arg1 + call [ebp+8] ; call CallAddress + mov esp,edi + pop edi + pop ebp + ret 16 + +_ProtectCall3@16 ENDP + +PUBLIC _ProtectCall3@16 + + +;---------------------------------------------------------------------------- +; ProtectCall4 +;---------------------------------------------------------------------------- + + +_ProtectCall4@20 PROC + + push ebp + mov ebp,esp + push edi + mov edi,esp + push [ebp+24] ; push Arg4 + push [ebp+20] ; push Arg3 + push [ebp+16] ; push Arg2 + push [ebp+12] ; push Arg1 + call [ebp+8] ; call CallAddress + mov esp,edi + pop edi + pop ebp + ret 20 + +_ProtectCall4@20 ENDP + +PUBLIC _ProtectCall4@20 + + +;---------------------------------------------------------------------------- +; RpcRt_NdrAsyncClientCall +;---------------------------------------------------------------------------- + + +EXTERN C RpcRt_NdrAsyncClientCall_x86 : PROC +EXTERN C Secure_HandleElevation : PROC +EXTERN C __sys_NdrAsyncClientCall : DWORD + +RpcRt_NdrAsyncClientCall PROC C PUBLIC + + call RpcRt_NdrAsyncClientCall_x86 + test al,al + jnz WeHandleElevation + + jmp dword ptr [__sys_NdrAsyncClientCall] + +WeHandleElevation: + + jmp Secure_HandleElevation + +RpcRt_NdrAsyncClientCall ENDP + +PUBLIC C RpcRt_NdrAsyncClientCall + + +;---------------------------------------------------------------------------- +; Ldr_Inject_Entry32 +;---------------------------------------------------------------------------- + + +EXTERN _Ldr_Inject_Entry@4 : PROC + +Ldr_Inject_Entry32@0 PROC C PUBLIC + + push esp ; pRetAddr parameter + call _Ldr_Inject_Entry@4 + + ; + ; clear the stack of any leftovers from Ldr_Inject_Entry. + ; necessary because some injected code (e.g. F-Secure) + ; assumes the stack is zero + ; + + lea edi,[esp-200h] + mov ecx,200h/4 + xor eax,eax + cld + rep stosd + + ret + +Ldr_Inject_Entry32@0 ENDP + +PUBLIC C Ldr_Inject_Entry32@0 + + +;---------------------------------------------------------------------------- +; Gui_FixupCallbackPointers +;---------------------------------------------------------------------------- + + +Gui_FixupCallbackPointers@4 PROC C PUBLIC + + ; + ; copy of USER32!FixupCallbackPointers + ; with additional zeroing of the dword at [ecx+8] before returning + ; + + push ebp + mov ebp,esp + mov ecx,dword ptr [ebp+8] + mov edx,dword ptr [ecx+10h] + push esi + xor esi,esi + add edx,ecx + cmp dword ptr [ecx+8],esi + jbe l02 +l01: mov eax,dword ptr [edx] + add eax,ecx + add dword ptr [eax],ecx + inc esi + add edx,4 + cmp esi,dword ptr [ecx+8] + jb l01 + xor edx,edx + mov dword ptr [ecx+8],edx +l02: pop esi + pop ebp + ret 4 + +Gui_FixupCallbackPointers@4 ENDP + +PUBLIC C Gui_FixupCallbackPointers@4 + + +;---------------------------------------------------------------------------- +; Gui_MsgWaitForMultipleObjects +;---------------------------------------------------------------------------- + + +EXTERN C __sys_MsgWaitForMultipleObjects : DWORD + +Gui_MsgWaitForMultipleObjects@20 PROC C PUBLIC + + test esp,3 + jnz l03 + ; stack is dword aligned, jump directly to MsgWaitForMultipleObjects + jmp __sys_MsgWaitForMultipleObjects + ; align stack before calling MsgWaitForMultipleObjects +l03: mov eax, esp +l04: dec esp + test esp,3 + jnz l04 + push eax ; save unaligned esp + push [eax+20] ; arg 5 + push [eax+16] ; arg 4 + push [eax+12] ; arg 3 + push [eax+8] ; arg 2 + push [eax+4] ; arg 1 + call __sys_MsgWaitForMultipleObjects + pop esp ; restore unaligned esp + ret 20 + +Gui_MsgWaitForMultipleObjects@20 ENDP + +PUBLIC C Gui_MsgWaitForMultipleObjects@20 + + +;---------------------------------------------------------------------------- +; RpcRt_NdrClientCall +;---------------------------------------------------------------------------- + + +EXTERN C RpcRt_NdrClientCall_x86 : PROC +;EXTERN C RpcRt_NdrClientCall_... : PROC +EXTERN C __sys_NdrClientCall : DWORD + +RpcRt_NdrClientCall PROC C PUBLIC + + call RpcRt_NdrClientCall_x86 + test al,al + jnz CancelCall + + jmp dword ptr [__sys_NdrClientCall] + +CancelCall: + +; jmp RpcRt_NdrClientCall_... + ret + +RpcRt_NdrClientCall ENDP + +PUBLIC C RpcRt_NdrClientCall + + +;---------------------------------------------------------------------------- +; RpcRt_NdrClientCall2 +;---------------------------------------------------------------------------- + + +EXTERN C RpcRt_NdrClientCall2_x86 : PROC +;EXTERN C RpcRt_NdrClientCall2_... : PROC +EXTERN C __sys_NdrClientCall2 : DWORD + +RpcRt_NdrClientCall2 PROC C PUBLIC + + call RpcRt_NdrClientCall2_x86 + test al,al + jnz CancelCall2 + + jmp dword ptr [__sys_NdrClientCall2] + +CancelCall2: + +; jmp RpcRt_NdrClientCall2_... + ret + +RpcRt_NdrClientCall2 ENDP + +PUBLIC C RpcRt_NdrClientCall2 + diff --git a/Sandboxie/core/dll/util_64.asm b/Sandboxie/core/dll/util_64.asm index d0a84810..6c3d3b7a 100644 --- a/Sandboxie/core/dll/util_64.asm +++ b/Sandboxie/core/dll/util_64.asm @@ -1,343 +1,343 @@ -;------------------------------------------------------------------------ -; Copyright 2004-2020 Sandboxie Holdings, LLC -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see . -;------------------------------------------------------------------------ - -;---------------------------------------------------------------------------- -; Assembler Utilities -- 64-bit -;---------------------------------------------------------------------------- - - -;---------------------------------------------------------------------------- -; ProtectCall2 -;---------------------------------------------------------------------------- - - -ProtectCall2 PROC - - sub rsp,8+(4*8) - mov rax,rcx - mov rcx,rdx - mov rdx,r8 - call rax - add rsp,8+(4*8) - ret - -ProtectCall2 ENDP - - -;---------------------------------------------------------------------------- -; ProtectCall3 -;---------------------------------------------------------------------------- - - -;ProtectCall3 PROC -; -; sub rsp,8+(4*8) -; mov rax,rcx -; mov rcx,rdx -; mov rdx,r8 -; mov r8,r9 -; call rax -; add rsp,8+(4*8) -; ret -; -;ProtectCall3 ENDP - - -;---------------------------------------------------------------------------- -; ProtectCall4 -;---------------------------------------------------------------------------- - - -ProtectCall4 PROC - - sub rsp,8+(4*8) - mov rax,rcx - mov rcx,rdx - mov rdx,r8 - mov r8,r9 - mov r9,qword ptr [rsp+50h] - call rax - add rsp,8+(4*8) - ret - -ProtectCall4 ENDP - - -;---------------------------------------------------------------------------- -; RpcRt_Ndr64AsyncClientCall -;---------------------------------------------------------------------------- - -EXTERN RpcRt_Ndr64AsyncClientCall_x64 : PROC -EXTERN Secure_HandleElevation : PROC -EXTERN __sys_Ndr64AsyncClientCall : QWORD - -RpcRt_Ndr64AsyncClientCall PROC - - mov rax,rsp - mov [rax+1*8],rcx ; spill pProxyInfo - mov [rax+2*8],rdx ; spill nProcNum - mov [rax+3*8],r8 ; spill pReturnValue - mov [rax+4*8],r9 ; spill first variadic parameter - sub rsp,8+(4*8) - -;; xor rcx,rcx ; clear pProxyInfo -;; xor rdx,rdx ; clear nProcNum -;; xor r8,r8 ; clear pReturnValue -; mov r8,[rsp + 8+(4*8)] ; return poitner - lea r9,[rsp + 8+(4*8) + 4*8] ; setup Args -> SECURE_UAC_ARGS - call RpcRt_Ndr64AsyncClientCall_x64 - test al,al - jnz WeHandleElevation - - lea rax,[rsp+8+(4*8)] - mov rcx,[rax+1*8] ; restore pProxyInfo - mov rdx,[rax+2*8] ; restore nProcNum - mov r8,[rax+3*8] ; restore pReturnValue - mov r9,[rax+4*8] ; restore first variadic parameter - - add rsp,8+(4*8) - jmp [__sys_Ndr64AsyncClientCall] - -WeHandleElevation: - - xor rcx,rcx ; clear pStubDescriptor - xor rdx,rdx ; clear pFormat - lea r8,[rsp + 8+(4*8) + 4*8] ; setup Args -> SECURE_UAC_ARGS - xor r9,r9 ; clear unused parameter - call Secure_HandleElevation - - add rsp,8+(4*8) - ret - -RpcRt_Ndr64AsyncClientCall ENDP - - -;---------------------------------------------------------------------------- -; Ldr_Inject_Entry64 -;---------------------------------------------------------------------------- - - -EXTERN Ldr_Inject_Entry : PROC - -Ldr_Inject_Entry64 PROC - - ; - ; Normally we would start with sub rsp,8+(4*8) but in this case - ; we know the caller has not aligned the stack correctly - ; - - sub rsp,8+8+(4*8) - lea rcx,[rsp+8+8+(4*8)] ; setup pRetAddr parameter - call Ldr_Inject_Entry - add rsp,8+8+(4*8) - - ; - ; clear the stack of any leftovers from Ldr_Inject_Entry. - ; necessary because some injected code (e.g. F-Secure) - ; assumes the stack is zero - ; - - lea rdi,[rsp-200h] - mov rcx,200h/8 - xor rax,rax - cld - rep stosq - - ret - -Ldr_Inject_Entry64 ENDP - - -;---------------------------------------------------------------------------- -; Gui_FixupCallbackPointers -;---------------------------------------------------------------------------- - - -Gui_FixupCallbackPointers PROC - - ; - ; copy of USER32!FixupCallbackPointers - ; with additional zeroing of the dword at [rcx+8] before returning - ; - - mov edx,dword ptr [rcx+18h] - xor r8d,r8d - add rdx,rcx - cmp dword ptr [rcx+8],r8d - jbe l02 -l01: mov eax,dword ptr [rdx] - inc r8d - add rdx,4 - add qword ptr [rax+rcx],rcx - cmp r8d,dword ptr [rcx+8] - jb l01 - xor r8d,r8d - mov dword ptr [rcx+8],r8d -l02: ret - -Gui_FixupCallbackPointers ENDP - - -;---------------------------------------------------------------------------- -; Secure_NdrAsyncClientCall -;---------------------------------------------------------------------------- - - -EXTERN RpcRt_NdrAsyncClientCall_x64 : PROC -EXTERN __sys_NdrAsyncClientCall : QWORD - -RpcRt_NdrAsyncClientCall PROC - - mov rax,rsp - mov [rax+1*8],rcx ; spill pStubDescriptor - mov [rax+2*8],rdx ; spill pFormat - mov [rax+3*8],r8 ; spill first variadic parameter - mov [rax+4*8],r9 ; spill second variadic parameter - sub rsp,8+(4*8) - -;; xor rcx,rcx ; clear pStubDescriptor -;; xor rdx,rdx ; clear pFormat -; mov r8,[rsp + 8+(4*8)] ; return poitner - lea r8,[rsp + 8+(4*8) + 3*8] ; Args - call RpcRt_NdrAsyncClientCall_x64 - test al,al - jnz CancelCallA - - lea rax,[rsp+8+(4*8)] - mov rcx,[rax+1*8] ; restore pStubDescriptor - mov rdx,[rax+2*8] ; restore pFormat - mov r8,[rax+3*8] ; restore first variadic parameter - mov r9,[rax+4*8] ; restore second variadic parameter - - add rsp,8+(4*8) - jmp [__sys_NdrAsyncClientCall] - -CancelCallA: - -;;; xor rcx,rcx ; clear pProxyInfo -;;; xor rdx,rdx ; clear nProcNum -;;; xor r8,r8 ; clear pReturnValue -;; mov r8,[rsp + 8+(4*8)] ; return poitner -; lea r8,[rsp + 8+(4*8) + 3*8] ; Args -; call RpcRt_NdrAsyncClientCall_... - - add rsp,8+(4*8) - ret - -RpcRt_NdrAsyncClientCall ENDP - - -;---------------------------------------------------------------------------- -; RpcRt_NdrClientCall2 -;---------------------------------------------------------------------------- - - -EXTERN RpcRt_NdrClientCall2_x64 : PROC -EXTERN __sys_NdrClientCall2 : QWORD - -RpcRt_NdrClientCall2 PROC - - mov rax,rsp - mov [rax+1*8],rcx ; spill pStubDescriptor - mov [rax+2*8],rdx ; spill pFormat - mov [rax+3*8],r8 ; spill first variadic parameter - mov [rax+4*8],r9 ; spill second variadic parameter - sub rsp,8+(4*8) - -;; xor rcx,rcx ; clear pStubDescriptor -;; xor rdx,rdx ; clear pFormat -; mov r8,[rsp + 8+(4*8)] ; return poitner - lea r8,[rsp + 8+(4*8) + 3*8] ; Args - call RpcRt_NdrClientCall2_x64 - test al,al - jnz CancelCall2 - - lea rax,[rsp+8+(4*8)] - mov rcx,[rax+1*8] ; restore pStubDescriptor - mov rdx,[rax+2*8] ; restore pFormat - mov r8,[rax+3*8] ; restore first variadic parameter - mov r9,[rax+4*8] ; restore second variadic parameter - - add rsp,8+(4*8) - jmp [__sys_NdrClientCall2] - -CancelCall2: - -;;; xor rcx,rcx ; clear pProxyInfo -;;; xor rdx,rdx ; clear nProcNum -;;; xor r8,r8 ; clear pReturnValue -;; mov r8,[rsp + 8+(4*8)] ; return poitner -; lea r8,[rsp + 8+(4*8) + 3*8] ; Args -; call RpcRt_NdrClientCall2_... - - add rsp,8+(4*8) - ret - -RpcRt_NdrClientCall2 ENDP - - -;---------------------------------------------------------------------------- -; RpcRt_NdrClientCall3 -;---------------------------------------------------------------------------- - - -EXTERN RpcRt_NdrClientCall3_x64 : PROC -;EXTERN RpcRt_NdrClientCall3_... : PROC -EXTERN __sys_NdrClientCall3 : QWORD - -RpcRt_NdrClientCall3 PROC - - mov rax,rsp - mov [rax+1*8],rcx ; spill pProxyInfo - mov [rax+2*8],rdx ; spill nProcNum - mov [rax+3*8],r8 ; spill pReturnValue - mov [rax+4*8],r9 ; spill first variadic parameter - sub rsp,8+(4*8) - -;; xor rcx,rcx ; clear pProxyInfo -;; xor rdx,rdx ; clear nProcNum -;; xor r8,r8 ; clear pReturnValue -; mov r8,[rsp + 8+(4*8)] ; return poitner - lea r9,[rsp + 8+(4*8) + 4*8] ; Args - call RpcRt_NdrClientCall3_x64 - test al,al - jnz CancelCall3 - - lea rax,[rsp+8+(4*8)] - mov rcx,[rax+1*8] ; restore pProxyInfo - mov rdx,[rax+2*8] ; restore nProcNum - mov r8,[rax+3*8] ; restore pReturnValue - mov r9,[rax+4*8] ; restore first variadic parameter - - add rsp,8+(4*8) - jmp [__sys_NdrClientCall3] - -CancelCall3: - -;;; xor rcx,rcx ; clear pProxyInfo -;;; xor rdx,rdx ; clear nProcNum -;;; xor r8,r8 ; clear pReturnValue -;; mov r8,[rsp + 8+(4*8)] ; return poitner -; lea r9,[rsp + 8+(4*8) + 4*8] ; Args -; call RpcRt_NdrClientCall3_... - - add rsp,8+(4*8) - ret - -RpcRt_NdrClientCall3 ENDP - - +;------------------------------------------------------------------------ +; Copyright 2004-2020 Sandboxie Holdings, LLC +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +;------------------------------------------------------------------------ + +;---------------------------------------------------------------------------- +; Assembler Utilities -- 64-bit +;---------------------------------------------------------------------------- + + +;---------------------------------------------------------------------------- +; ProtectCall2 +;---------------------------------------------------------------------------- + + +ProtectCall2 PROC + + sub rsp,8+(4*8) + mov rax,rcx + mov rcx,rdx + mov rdx,r8 + call rax + add rsp,8+(4*8) + ret + +ProtectCall2 ENDP + + +;---------------------------------------------------------------------------- +; ProtectCall3 +;---------------------------------------------------------------------------- + + +;ProtectCall3 PROC +; +; sub rsp,8+(4*8) +; mov rax,rcx +; mov rcx,rdx +; mov rdx,r8 +; mov r8,r9 +; call rax +; add rsp,8+(4*8) +; ret +; +;ProtectCall3 ENDP + + +;---------------------------------------------------------------------------- +; ProtectCall4 +;---------------------------------------------------------------------------- + + +ProtectCall4 PROC + + sub rsp,8+(4*8) + mov rax,rcx + mov rcx,rdx + mov rdx,r8 + mov r8,r9 + mov r9,qword ptr [rsp+50h] + call rax + add rsp,8+(4*8) + ret + +ProtectCall4 ENDP + + +;---------------------------------------------------------------------------- +; RpcRt_Ndr64AsyncClientCall +;---------------------------------------------------------------------------- + +EXTERN RpcRt_Ndr64AsyncClientCall_x64 : PROC +EXTERN Secure_HandleElevation : PROC +EXTERN __sys_Ndr64AsyncClientCall : QWORD + +RpcRt_Ndr64AsyncClientCall PROC + + mov rax,rsp + mov [rax+1*8],rcx ; spill pProxyInfo + mov [rax+2*8],rdx ; spill nProcNum + mov [rax+3*8],r8 ; spill pReturnValue + mov [rax+4*8],r9 ; spill first variadic parameter + sub rsp,8+(4*8) + +;; xor rcx,rcx ; clear pProxyInfo +;; xor rdx,rdx ; clear nProcNum +;; xor r8,r8 ; clear pReturnValue +; mov r8,[rsp + 8+(4*8)] ; return poitner + lea r9,[rsp + 8+(4*8) + 4*8] ; setup Args -> SECURE_UAC_ARGS + call RpcRt_Ndr64AsyncClientCall_x64 + test al,al + jnz WeHandleElevation + + lea rax,[rsp+8+(4*8)] + mov rcx,[rax+1*8] ; restore pProxyInfo + mov rdx,[rax+2*8] ; restore nProcNum + mov r8,[rax+3*8] ; restore pReturnValue + mov r9,[rax+4*8] ; restore first variadic parameter + + add rsp,8+(4*8) + jmp [__sys_Ndr64AsyncClientCall] + +WeHandleElevation: + + xor rcx,rcx ; clear pStubDescriptor + xor rdx,rdx ; clear pFormat + lea r8,[rsp + 8+(4*8) + 4*8] ; setup Args -> SECURE_UAC_ARGS + xor r9,r9 ; clear unused parameter + call Secure_HandleElevation + + add rsp,8+(4*8) + ret + +RpcRt_Ndr64AsyncClientCall ENDP + + +;---------------------------------------------------------------------------- +; Ldr_Inject_Entry64 +;---------------------------------------------------------------------------- + + +EXTERN Ldr_Inject_Entry : PROC + +Ldr_Inject_Entry64 PROC + + ; + ; Normally we would start with sub rsp,8+(4*8) but in this case + ; we know the caller has not aligned the stack correctly + ; + + sub rsp,8+8+(4*8) + lea rcx,[rsp+8+8+(4*8)] ; setup pRetAddr parameter + call Ldr_Inject_Entry + add rsp,8+8+(4*8) + + ; + ; clear the stack of any leftovers from Ldr_Inject_Entry. + ; necessary because some injected code (e.g. F-Secure) + ; assumes the stack is zero + ; + + lea rdi,[rsp-200h] + mov rcx,200h/8 + xor rax,rax + cld + rep stosq + + ret + +Ldr_Inject_Entry64 ENDP + + +;---------------------------------------------------------------------------- +; Gui_FixupCallbackPointers +;---------------------------------------------------------------------------- + + +Gui_FixupCallbackPointers PROC + + ; + ; copy of USER32!FixupCallbackPointers + ; with additional zeroing of the dword at [rcx+8] before returning + ; + + mov edx,dword ptr [rcx+18h] + xor r8d,r8d + add rdx,rcx + cmp dword ptr [rcx+8],r8d + jbe l02 +l01: mov eax,dword ptr [rdx] + inc r8d + add rdx,4 + add qword ptr [rax+rcx],rcx + cmp r8d,dword ptr [rcx+8] + jb l01 + xor r8d,r8d + mov dword ptr [rcx+8],r8d +l02: ret + +Gui_FixupCallbackPointers ENDP + + +;---------------------------------------------------------------------------- +; Secure_NdrAsyncClientCall +;---------------------------------------------------------------------------- + + +EXTERN RpcRt_NdrAsyncClientCall_x64 : PROC +EXTERN __sys_NdrAsyncClientCall : QWORD + +RpcRt_NdrAsyncClientCall PROC + + mov rax,rsp + mov [rax+1*8],rcx ; spill pStubDescriptor + mov [rax+2*8],rdx ; spill pFormat + mov [rax+3*8],r8 ; spill first variadic parameter + mov [rax+4*8],r9 ; spill second variadic parameter + sub rsp,8+(4*8) + +;; xor rcx,rcx ; clear pStubDescriptor +;; xor rdx,rdx ; clear pFormat +; mov r8,[rsp + 8+(4*8)] ; return poitner + lea r8,[rsp + 8+(4*8) + 3*8] ; Args + call RpcRt_NdrAsyncClientCall_x64 + test al,al + jnz CancelCallA + + lea rax,[rsp+8+(4*8)] + mov rcx,[rax+1*8] ; restore pStubDescriptor + mov rdx,[rax+2*8] ; restore pFormat + mov r8,[rax+3*8] ; restore first variadic parameter + mov r9,[rax+4*8] ; restore second variadic parameter + + add rsp,8+(4*8) + jmp [__sys_NdrAsyncClientCall] + +CancelCallA: + +;;; xor rcx,rcx ; clear pProxyInfo +;;; xor rdx,rdx ; clear nProcNum +;;; xor r8,r8 ; clear pReturnValue +;; mov r8,[rsp + 8+(4*8)] ; return poitner +; lea r8,[rsp + 8+(4*8) + 3*8] ; Args +; call RpcRt_NdrAsyncClientCall_... + + add rsp,8+(4*8) + ret + +RpcRt_NdrAsyncClientCall ENDP + + +;---------------------------------------------------------------------------- +; RpcRt_NdrClientCall2 +;---------------------------------------------------------------------------- + + +EXTERN RpcRt_NdrClientCall2_x64 : PROC +EXTERN __sys_NdrClientCall2 : QWORD + +RpcRt_NdrClientCall2 PROC + + mov rax,rsp + mov [rax+1*8],rcx ; spill pStubDescriptor + mov [rax+2*8],rdx ; spill pFormat + mov [rax+3*8],r8 ; spill first variadic parameter + mov [rax+4*8],r9 ; spill second variadic parameter + sub rsp,8+(4*8) + +;; xor rcx,rcx ; clear pStubDescriptor +;; xor rdx,rdx ; clear pFormat +; mov r8,[rsp + 8+(4*8)] ; return poitner + lea r8,[rsp + 8+(4*8) + 3*8] ; Args + call RpcRt_NdrClientCall2_x64 + test al,al + jnz CancelCall2 + + lea rax,[rsp+8+(4*8)] + mov rcx,[rax+1*8] ; restore pStubDescriptor + mov rdx,[rax+2*8] ; restore pFormat + mov r8,[rax+3*8] ; restore first variadic parameter + mov r9,[rax+4*8] ; restore second variadic parameter + + add rsp,8+(4*8) + jmp [__sys_NdrClientCall2] + +CancelCall2: + +;;; xor rcx,rcx ; clear pProxyInfo +;;; xor rdx,rdx ; clear nProcNum +;;; xor r8,r8 ; clear pReturnValue +;; mov r8,[rsp + 8+(4*8)] ; return poitner +; lea r8,[rsp + 8+(4*8) + 3*8] ; Args +; call RpcRt_NdrClientCall2_... + + add rsp,8+(4*8) + ret + +RpcRt_NdrClientCall2 ENDP + + +;---------------------------------------------------------------------------- +; RpcRt_NdrClientCall3 +;---------------------------------------------------------------------------- + + +EXTERN RpcRt_NdrClientCall3_x64 : PROC +;EXTERN RpcRt_NdrClientCall3_... : PROC +EXTERN __sys_NdrClientCall3 : QWORD + +RpcRt_NdrClientCall3 PROC + + mov rax,rsp + mov [rax+1*8],rcx ; spill pProxyInfo + mov [rax+2*8],rdx ; spill nProcNum + mov [rax+3*8],r8 ; spill pReturnValue + mov [rax+4*8],r9 ; spill first variadic parameter + sub rsp,8+(4*8) + +;; xor rcx,rcx ; clear pProxyInfo +;; xor rdx,rdx ; clear nProcNum +;; xor r8,r8 ; clear pReturnValue +; mov r8,[rsp + 8+(4*8)] ; return poitner + lea r9,[rsp + 8+(4*8) + 4*8] ; Args + call RpcRt_NdrClientCall3_x64 + test al,al + jnz CancelCall3 + + lea rax,[rsp+8+(4*8)] + mov rcx,[rax+1*8] ; restore pProxyInfo + mov rdx,[rax+2*8] ; restore nProcNum + mov r8,[rax+3*8] ; restore pReturnValue + mov r9,[rax+4*8] ; restore first variadic parameter + + add rsp,8+(4*8) + jmp [__sys_NdrClientCall3] + +CancelCall3: + +;;; xor rcx,rcx ; clear pProxyInfo +;;; xor rdx,rdx ; clear nProcNum +;;; xor r8,r8 ; clear pReturnValue +;; mov r8,[rsp + 8+(4*8)] ; return poitner +; lea r9,[rsp + 8+(4*8) + 4*8] ; Args +; call RpcRt_NdrClientCall3_... + + add rsp,8+(4*8) + ret + +RpcRt_NdrClientCall3 ENDP + + diff --git a/Sandboxie/core/dll/util_asm.asm b/Sandboxie/core/dll/util_asm.asm index c23754ac..3e97f523 100644 --- a/Sandboxie/core/dll/util_asm.asm +++ b/Sandboxie/core/dll/util_asm.asm @@ -1,41 +1,41 @@ -;------------------------------------------------------------------------ -; Copyright 2004-2020 Sandboxie Holdings, LLC -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see . -;------------------------------------------------------------------------ - -;---------------------------------------------------------------------------- -; Assembler Utilities -;---------------------------------------------------------------------------- - -ifndef _WIN64 - -.386p -.model flat - -endif - -.code - -ifdef _WIN64 - -include util_64.asm - -else - -include util_32.asm - -endif - -end +;------------------------------------------------------------------------ +; Copyright 2004-2020 Sandboxie Holdings, LLC +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +;------------------------------------------------------------------------ + +;---------------------------------------------------------------------------- +; Assembler Utilities +;---------------------------------------------------------------------------- + +ifndef _WIN64 + +.386p +.model flat + +endif + +.code + +ifdef _WIN64 + +include util_64.asm + +else + +include util_32.asm + +endif + +end diff --git a/Sandboxie/core/drv/SbieDrv.inf b/Sandboxie/core/drv/SbieDrv.inf index 9032802a..c8cde60c 100644 --- a/Sandboxie/core/drv/SbieDrv.inf +++ b/Sandboxie/core/drv/SbieDrv.inf @@ -1,60 +1,60 @@ -;------------------------------------------------------------------------- -; Copyright 2004 – 2020 Sandboxie Holdings, LLC -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see . -;------------------------------------------------------------------------- - -[Version] -Signature = "$WINDOWS NT$" -Class = "SecurityEnhancer" ;This is determined by the work this filter driver does -ClassGuid = {d02bc3da-0c8e-4945-9bd5-f1883c226c8c} ;This value is determined by the Class -Provider = "Sandboxie Holdings, LLC" -DriverVer = 01/01/2018,5.23.5 -CatalogFile = SbieDrv.cat - -[DestinationDirs] -DefaultDestDir = 12 -MiniFilter.DriverFiles = 12 ;%windir%\system32\drivers - -[MiniFilter.DriverFiles] -SbieDrv.sys - -[SourceDisksFiles] -SbieDrv.sys = 1,, - -[SourceDisksNames] -1 = %DiskId1%,,, - -[DefaultInstall] -OptionDesc = %ServiceDescription% -CopyFiles = MiniFilter.DriverFiles - -[DefaultInstall.Services] -AddService = %ServiceName%,,MiniFilter.Service - -[MiniFilter.Service] -DisplayName = %ServiceName% -Description = %ServiceDescription% -ServiceBinary = %12%\examplefilesystem.sys -ServiceType = 2 ; SERVICE_FILE_SYSTEM_DRIVER -StartType = 1 ; SERVICE_SYSTEM_START -ErrorControl = 1 ; SERVICE_ERROR_NORMAL -LoadOrderGroup = "File System" - -[Strings] -SG = "Sandboxie" -ServiceDescription = "Sandboxie Mini-Filter Driver" -ServiceName = "Sandboxie Service" -DriverName = "SbieDrv" +;------------------------------------------------------------------------- +; Copyright 2004 – 2020 Sandboxie Holdings, LLC +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +;------------------------------------------------------------------------- + +[Version] +Signature = "$WINDOWS NT$" +Class = "SecurityEnhancer" ;This is determined by the work this filter driver does +ClassGuid = {d02bc3da-0c8e-4945-9bd5-f1883c226c8c} ;This value is determined by the Class +Provider = "Sandboxie Holdings, LLC" +DriverVer = 01/01/2018,5.23.5 +CatalogFile = SbieDrv.cat + +[DestinationDirs] +DefaultDestDir = 12 +MiniFilter.DriverFiles = 12 ;%windir%\system32\drivers + +[MiniFilter.DriverFiles] +SbieDrv.sys + +[SourceDisksFiles] +SbieDrv.sys = 1,, + +[SourceDisksNames] +1 = %DiskId1%,,, + +[DefaultInstall] +OptionDesc = %ServiceDescription% +CopyFiles = MiniFilter.DriverFiles + +[DefaultInstall.Services] +AddService = %ServiceName%,,MiniFilter.Service + +[MiniFilter.Service] +DisplayName = %ServiceName% +Description = %ServiceDescription% +ServiceBinary = %12%\examplefilesystem.sys +ServiceType = 2 ; SERVICE_FILE_SYSTEM_DRIVER +StartType = 1 ; SERVICE_SYSTEM_START +ErrorControl = 1 ; SERVICE_ERROR_NORMAL +LoadOrderGroup = "File System" + +[Strings] +SG = "Sandboxie" +ServiceDescription = "Sandboxie Mini-Filter Driver" +ServiceName = "Sandboxie Service" +DriverName = "SbieDrv" DiskId1 = "Sandboxie Driver Installation Disk" \ No newline at end of file diff --git a/Sandboxie/core/drv/SbieDrv_x32.ddf b/Sandboxie/core/drv/SbieDrv_x32.ddf index efaf0394..dd8edca8 100644 --- a/Sandboxie/core/drv/SbieDrv_x32.ddf +++ b/Sandboxie/core/drv/SbieDrv_x32.ddf @@ -1,16 +1,16 @@ -; \Sandbox\Projects\core\drv\SbieDvr_x32.ddf - ; - .OPTION EXPLICIT ; Generate errors - .Set CabinetFileCountThreshold=0 - .Set FolderFileCountThreshold=0 - .Set FolderSizeThreshold=0 - .Set MaxCabinetSize=0 - .Set MaxDiskFileCount=0 - .Set MaxDiskSize=0 - .Set CompressionType=MSZIP - .Set Cabinet=on - .Set Compress=on - .Set CabinetNameTemplate=SbieDrv_x32.cab - .Set DestinationDir=..\Projects\Bin\SbieRelease - SbieDrv.inf +; \Sandbox\Projects\core\drv\SbieDvr_x32.ddf + ; + .OPTION EXPLICIT ; Generate errors + .Set CabinetFileCountThreshold=0 + .Set FolderFileCountThreshold=0 + .Set FolderSizeThreshold=0 + .Set MaxCabinetSize=0 + .Set MaxDiskFileCount=0 + .Set MaxDiskSize=0 + .Set CompressionType=MSZIP + .Set Cabinet=on + .Set Compress=on + .Set CabinetNameTemplate=SbieDrv_x32.cab + .Set DestinationDir=..\Projects\Bin\SbieRelease + SbieDrv.inf ..\..\Bin\Win32\SbieRelease\SbieDrv.sys \ No newline at end of file diff --git a/Sandboxie/core/drv/SbieDrv_x64.ddf b/Sandboxie/core/drv/SbieDrv_x64.ddf index fbeeb661..2c27ea3d 100644 --- a/Sandboxie/core/drv/SbieDrv_x64.ddf +++ b/Sandboxie/core/drv/SbieDrv_x64.ddf @@ -1,16 +1,16 @@ -; \Sandbox\Projects\core\drv\SbieDvr_x64.ddf - ; - .OPTION EXPLICIT ; Generate errors - .Set CabinetFileCountThreshold=0 - .Set FolderFileCountThreshold=0 - .Set FolderSizeThreshold=0 - .Set MaxCabinetSize=0 - .Set MaxDiskFileCount=0 - .Set MaxDiskSize=0 - .Set CompressionType=MSZIP - .Set Cabinet=on - .Set Compress=on - .Set CabinetNameTemplate=SbieDrv_x64.cab - .Set DestinationDir=..\Projects\Bin\x64\SbieRelease - SbieDrv.inf +; \Sandbox\Projects\core\drv\SbieDvr_x64.ddf + ; + .OPTION EXPLICIT ; Generate errors + .Set CabinetFileCountThreshold=0 + .Set FolderFileCountThreshold=0 + .Set FolderSizeThreshold=0 + .Set MaxCabinetSize=0 + .Set MaxDiskFileCount=0 + .Set MaxDiskSize=0 + .Set CompressionType=MSZIP + .Set Cabinet=on + .Set Compress=on + .Set CabinetNameTemplate=SbieDrv_x64.cab + .Set DestinationDir=..\Projects\Bin\x64\SbieRelease + SbieDrv.inf ..\..\Bin\x64\SbieRelease\SbieDrv.sys \ No newline at end of file diff --git a/Sandboxie/core/drv/aulldvrm.asm b/Sandboxie/core/drv/aulldvrm.asm index 1ccb870d..33dedd65 100644 --- a/Sandboxie/core/drv/aulldvrm.asm +++ b/Sandboxie/core/drv/aulldvrm.asm @@ -1,105 +1,105 @@ -;------------------------------------------------------------------------ -; Copyright 2004-2020 Sandboxie Holdings, LLC -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see . -;------------------------------------------------------------------------ - -;---------------------------------------------------------------------------- -; _aulldvrm support routine is not available on Windows 2000 -; -; this is an exact copy of _aulldvrm procedure from ulldvrm.obj object file -; in the c:\work\tools\winddk\lib\crt\i386\libcmt.lib library -; -; it also the same as the copy of _aulldvrm in the Windows kernel -;---------------------------------------------------------------------------- - -ifdef _WIN64 - -; - -else - -.386p -.model flat - -.code - -__aulldvrm proc - - push esi - mov eax,dword ptr [esp+14h] - or eax,eax - jne label01 - mov ecx,dword ptr [esp+10h] - mov eax,dword ptr [esp+0Ch] - xor edx,edx - div ecx - mov ebx,eax - mov eax,dword ptr [esp+8] - div ecx - mov esi,eax - mov eax,ebx - mul dword ptr [esp+10h] - mov ecx,eax - mov eax,esi - mul dword ptr [esp+10h] - add edx,ecx - jmp label05 -label01: mov ecx,eax - mov ebx,dword ptr [esp+10h] - mov edx,dword ptr [esp+0Ch] - mov eax,dword ptr [esp+8] -label02: shr ecx,1 - rcr ebx,1 - shr edx,1 - rcr eax,1 - or ecx,ecx - jne label02 - div ebx - mov esi,eax - mul dword ptr [esp+14h] - mov ecx,eax - mov eax,dword ptr [esp+10h] - mul esi - add edx,ecx - jb label03 - cmp edx,dword ptr [esp+0Ch] - ja label03 - jb label04 - cmp eax,dword ptr [esp+8] - jbe label04 -label03: dec esi - sub eax,dword ptr [esp+10h] - sbb edx,dword ptr [esp+14h] -label04: xor ebx,ebx -label05: sub eax,dword ptr [esp+8] - sbb edx,dword ptr [esp+0Ch] - neg edx - neg eax - sbb edx,0 - mov ecx,edx - mov edx,ebx - mov ebx,ecx - mov ecx,eax - mov eax,esi - pop esi - ret 10h - -__aulldvrm endp - -public __aulldvrm - -endif - -end +;------------------------------------------------------------------------ +; Copyright 2004-2020 Sandboxie Holdings, LLC +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +;------------------------------------------------------------------------ + +;---------------------------------------------------------------------------- +; _aulldvrm support routine is not available on Windows 2000 +; +; this is an exact copy of _aulldvrm procedure from ulldvrm.obj object file +; in the c:\work\tools\winddk\lib\crt\i386\libcmt.lib library +; +; it also the same as the copy of _aulldvrm in the Windows kernel +;---------------------------------------------------------------------------- + +ifdef _WIN64 + +; + +else + +.386p +.model flat + +.code + +__aulldvrm proc + + push esi + mov eax,dword ptr [esp+14h] + or eax,eax + jne label01 + mov ecx,dword ptr [esp+10h] + mov eax,dword ptr [esp+0Ch] + xor edx,edx + div ecx + mov ebx,eax + mov eax,dword ptr [esp+8] + div ecx + mov esi,eax + mov eax,ebx + mul dword ptr [esp+10h] + mov ecx,eax + mov eax,esi + mul dword ptr [esp+10h] + add edx,ecx + jmp label05 +label01: mov ecx,eax + mov ebx,dword ptr [esp+10h] + mov edx,dword ptr [esp+0Ch] + mov eax,dword ptr [esp+8] +label02: shr ecx,1 + rcr ebx,1 + shr edx,1 + rcr eax,1 + or ecx,ecx + jne label02 + div ebx + mov esi,eax + mul dword ptr [esp+14h] + mov ecx,eax + mov eax,dword ptr [esp+10h] + mul esi + add edx,ecx + jb label03 + cmp edx,dword ptr [esp+0Ch] + ja label03 + jb label04 + cmp eax,dword ptr [esp+8] + jbe label04 +label03: dec esi + sub eax,dword ptr [esp+10h] + sbb edx,dword ptr [esp+14h] +label04: xor ebx,ebx +label05: sub eax,dword ptr [esp+8] + sbb edx,dword ptr [esp+0Ch] + neg edx + neg eax + sbb edx,0 + mov ecx,edx + mov edx,ebx + mov ebx,ecx + mov ecx,eax + mov eax,esi + pop esi + ret 10h + +__aulldvrm endp + +public __aulldvrm + +endif + +end diff --git a/Sandboxie/core/drv/util_asm.asm b/Sandboxie/core/drv/util_asm.asm index 1ddde4b9..284eef3f 100644 --- a/Sandboxie/core/drv/util_asm.asm +++ b/Sandboxie/core/drv/util_asm.asm @@ -1,268 +1,268 @@ -;------------------------------------------------------------------------ -; Copyright 2004-2020 Sandboxie Holdings, LLC -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see . -;------------------------------------------------------------------------ - -;---------------------------------------------------------------------------- -; Assembler Utilities -;---------------------------------------------------------------------------- - -ifdef _WIN64 - -; - -else - -.386p -.model flat - -endif - -;---------------------------------------------------------------------------- - -.code - -;---------------------------------------------------------------------------- - -mov_eax_cr0 MACRO -ifdef _WIN64 - mov rax, cr0 -else - mov eax, cr0 -endif - ENDM - -mov_cr0_eax MACRO -ifdef _WIN64 - mov cr0, rax -else - mov cr0, eax -endif - ENDM - -;---------------------------------------------------------------------------- - -ifdef _WIN64 -DisableWriteProtect PROC -else -_DisableWriteProtect@0 PROC -endif - - mov_eax_cr0 - and eax, not 10000h ; clear WP bit - mov_cr0_eax - - ret - -ifdef _WIN64 -DisableWriteProtect ENDP -else -_DisableWriteProtect@0 ENDP -PUBLIC _DisableWriteProtect@0 -endif - -;---------------------------------------------------------------------------- - -ifdef _WIN64 -EnableWriteProtect PROC -else -_EnableWriteProtect@0 PROC -endif - - mov_eax_cr0 - or eax, 10000h ; set WP bit - mov_cr0_eax - - ret - -ifdef _WIN64 -EnableWriteProtect ENDP -else -_EnableWriteProtect@0 ENDP -PUBLIC _EnableWriteProtect@0 -endif - -;---------------------------------------------------------------------------- - -ifdef _WIN64 - -EXTERN Process_FindSandboxed : proc - - align 16 - -Process_FindSandboxed64 PROC FRAME - - ; prolog - sub rsp,50h - .allocstack(50h) - .endprolog - ; save caller's registers. - mov [rsp+28h+00h],rcx - mov [rsp+28h+08h],rdx - mov [rsp+28h+10h],r8 - mov [rsp+28h+18h],r9 - ; call Process_FindSandboxed(NULL, NULL) - xor rcx,rcx - xor rdx,rdx - call Process_FindSandboxed - mov r10,rax - ; restore caller's registers - mov rcx,[rsp+28h+00h] - mov rdx,[rsp+28h+08h] - mov r8, [rsp+28h+10h] - mov r9, [rsp+28h+18h] - ; epilog - add rsp,50h - ret - -Process_FindSandboxed64 ENDP - -endif - -;---------------------------------------------------------------------------- - -ifdef _WIN64 -Process_GetCurrent PROC - - align 16 - - ; 64-bit: Process_FindSandboxed64 stores current process in R10 - - mov rax, r10 - ret - -Process_GetCurrent ENDP - -else - - align 4 - -_Process_GetCurrent@0 PROC - - ; 32-bit: current process is passed in EAX - - ret - -_Process_GetCurrent@0 ENDP -PUBLIC _Process_GetCurrent@0 - -endif - -;---------------------------------------------------------------------------- - -ifdef _WIN64 - -InvokeCPUID PROC - - mov r11, rbx - - xor rax, rax - mov eax, ecx - mov r10, rdx - db 0Fh, 0A2h ; cpuid - - mov dword ptr [r10+0], eax - mov dword ptr [r10+4], ebx - mov dword ptr [r10+8], ecx - mov dword ptr [r10+12], edx - - mov rbx, r11 - ret - -InvokeCPUID ENDP - -else - -_InvokeCPUID@8 PROC - - push ebx - push esi - - mov esi, dword ptr [esp+8+8] ; +8 for push ebx,esi - - pushfd - pop ebx ; ebx = flags - xor ebx, 200000h ; toggle cpuid flag - push ebx - popfd ; flags = ebx - pushfd - pop ecx ; ecx = flags - and ebx, 200000h - and ecx, 200000h - cmp ebx, ecx - je cont - - xor eax, eax - xor ebx, ebx - xor ecx, ecx - xor edx, edx - jmp done - -cont: mov eax, dword ptr [esp+8+4] ; +8 for push ebx,esi - db 0Fh, 0A2h ; cpuid - -done: mov dword ptr [esi+0], eax - mov dword ptr [esi+4], ebx - mov dword ptr [esi+8], ecx - mov dword ptr [esi+12], edx - pop esi - pop ebx - ret 8 - -_InvokeCPUID@8 ENDP -PUBLIC _InvokeCPUID@8 - -endif - -;---------------------------------------------------------------------------- - -ifdef _WIN64 -EXTERN Token_SepFilterToken : QWORD - -Sbie_SepFilterTokenHandler_asm PROC - - mov qword ptr [rsp+20h],r9 - mov qword ptr [rsp+18h],r8 - mov qword ptr [rsp+10h],rdx - mov qword ptr [rsp+8],rcx - sub rsp,78h - mov dword ptr [rsp+60h],0 - mov rax,qword ptr [rsp+00000000000000A0h] - mov qword ptr [rsp+50h],rax - mov rax,qword ptr [rsp+0000000000000098h] - mov qword ptr [rsp+48h],rax - mov rax,qword ptr [rsp+0000000000000090h] - mov qword ptr [rsp+40h],rax - mov rax,qword ptr [rsp+0000000000000088h] - mov qword ptr [rsp+38h],rax - mov qword ptr [rsp+30h],0 - mov qword ptr [rsp+28h],0 - mov qword ptr [rsp+20h],0 - xor r9d,r9d - xor r8d,r8d - xor edx,edx - mov rcx,qword ptr [rsp+0000000000000080h] - call Token_SepFilterToken - mov dword ptr [rsp+60h],eax - mov eax,dword ptr [rsp+60h] - add rsp,78h - ret - -Sbie_SepFilterTokenHandler_asm ENDP -endif - -;---------------------------------------------------------------------------- - -end +;------------------------------------------------------------------------ +; Copyright 2004-2020 Sandboxie Holdings, LLC +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +;------------------------------------------------------------------------ + +;---------------------------------------------------------------------------- +; Assembler Utilities +;---------------------------------------------------------------------------- + +ifdef _WIN64 + +; + +else + +.386p +.model flat + +endif + +;---------------------------------------------------------------------------- + +.code + +;---------------------------------------------------------------------------- + +mov_eax_cr0 MACRO +ifdef _WIN64 + mov rax, cr0 +else + mov eax, cr0 +endif + ENDM + +mov_cr0_eax MACRO +ifdef _WIN64 + mov cr0, rax +else + mov cr0, eax +endif + ENDM + +;---------------------------------------------------------------------------- + +ifdef _WIN64 +DisableWriteProtect PROC +else +_DisableWriteProtect@0 PROC +endif + + mov_eax_cr0 + and eax, not 10000h ; clear WP bit + mov_cr0_eax + + ret + +ifdef _WIN64 +DisableWriteProtect ENDP +else +_DisableWriteProtect@0 ENDP +PUBLIC _DisableWriteProtect@0 +endif + +;---------------------------------------------------------------------------- + +ifdef _WIN64 +EnableWriteProtect PROC +else +_EnableWriteProtect@0 PROC +endif + + mov_eax_cr0 + or eax, 10000h ; set WP bit + mov_cr0_eax + + ret + +ifdef _WIN64 +EnableWriteProtect ENDP +else +_EnableWriteProtect@0 ENDP +PUBLIC _EnableWriteProtect@0 +endif + +;---------------------------------------------------------------------------- + +ifdef _WIN64 + +EXTERN Process_FindSandboxed : proc + + align 16 + +Process_FindSandboxed64 PROC FRAME + + ; prolog + sub rsp,50h + .allocstack(50h) + .endprolog + ; save caller's registers. + mov [rsp+28h+00h],rcx + mov [rsp+28h+08h],rdx + mov [rsp+28h+10h],r8 + mov [rsp+28h+18h],r9 + ; call Process_FindSandboxed(NULL, NULL) + xor rcx,rcx + xor rdx,rdx + call Process_FindSandboxed + mov r10,rax + ; restore caller's registers + mov rcx,[rsp+28h+00h] + mov rdx,[rsp+28h+08h] + mov r8, [rsp+28h+10h] + mov r9, [rsp+28h+18h] + ; epilog + add rsp,50h + ret + +Process_FindSandboxed64 ENDP + +endif + +;---------------------------------------------------------------------------- + +ifdef _WIN64 +Process_GetCurrent PROC + + align 16 + + ; 64-bit: Process_FindSandboxed64 stores current process in R10 + + mov rax, r10 + ret + +Process_GetCurrent ENDP + +else + + align 4 + +_Process_GetCurrent@0 PROC + + ; 32-bit: current process is passed in EAX + + ret + +_Process_GetCurrent@0 ENDP +PUBLIC _Process_GetCurrent@0 + +endif + +;---------------------------------------------------------------------------- + +ifdef _WIN64 + +InvokeCPUID PROC + + mov r11, rbx + + xor rax, rax + mov eax, ecx + mov r10, rdx + db 0Fh, 0A2h ; cpuid + + mov dword ptr [r10+0], eax + mov dword ptr [r10+4], ebx + mov dword ptr [r10+8], ecx + mov dword ptr [r10+12], edx + + mov rbx, r11 + ret + +InvokeCPUID ENDP + +else + +_InvokeCPUID@8 PROC + + push ebx + push esi + + mov esi, dword ptr [esp+8+8] ; +8 for push ebx,esi + + pushfd + pop ebx ; ebx = flags + xor ebx, 200000h ; toggle cpuid flag + push ebx + popfd ; flags = ebx + pushfd + pop ecx ; ecx = flags + and ebx, 200000h + and ecx, 200000h + cmp ebx, ecx + je cont + + xor eax, eax + xor ebx, ebx + xor ecx, ecx + xor edx, edx + jmp done + +cont: mov eax, dword ptr [esp+8+4] ; +8 for push ebx,esi + db 0Fh, 0A2h ; cpuid + +done: mov dword ptr [esi+0], eax + mov dword ptr [esi+4], ebx + mov dword ptr [esi+8], ecx + mov dword ptr [esi+12], edx + pop esi + pop ebx + ret 8 + +_InvokeCPUID@8 ENDP +PUBLIC _InvokeCPUID@8 + +endif + +;---------------------------------------------------------------------------- + +ifdef _WIN64 +EXTERN Token_SepFilterToken : QWORD + +Sbie_SepFilterTokenHandler_asm PROC + + mov qword ptr [rsp+20h],r9 + mov qword ptr [rsp+18h],r8 + mov qword ptr [rsp+10h],rdx + mov qword ptr [rsp+8],rcx + sub rsp,78h + mov dword ptr [rsp+60h],0 + mov rax,qword ptr [rsp+00000000000000A0h] + mov qword ptr [rsp+50h],rax + mov rax,qword ptr [rsp+0000000000000098h] + mov qword ptr [rsp+48h],rax + mov rax,qword ptr [rsp+0000000000000090h] + mov qword ptr [rsp+40h],rax + mov rax,qword ptr [rsp+0000000000000088h] + mov qword ptr [rsp+38h],rax + mov qword ptr [rsp+30h],0 + mov qword ptr [rsp+28h],0 + mov qword ptr [rsp+20h],0 + xor r9d,r9d + xor r8d,r8d + xor edx,edx + mov rcx,qword ptr [rsp+0000000000000080h] + call Token_SepFilterToken + mov dword ptr [rsp+60h],eax + mov eax,dword ptr [rsp+60h] + add rsp,78h + ret + +Sbie_SepFilterTokenHandler_asm ENDP +endif + +;---------------------------------------------------------------------------- + +end diff --git a/Sandboxie/core/low/LowLevel.def b/Sandboxie/core/low/LowLevel.def index afc08c65..e5b42c40 100644 --- a/Sandboxie/core/low/LowLevel.def +++ b/Sandboxie/core/low/LowLevel.def @@ -1 +1 @@ -LIBRARY .TAIL. +LIBRARY .TAIL. diff --git a/Sandboxie/core/low/entry.asm b/Sandboxie/core/low/entry.asm index b82875c1..efaaa868 100644 --- a/Sandboxie/core/low/entry.asm +++ b/Sandboxie/core/low/entry.asm @@ -1,720 +1,720 @@ -;------------------------------------------------------------------------ -; Copyright 2004-2020 Sandboxie Holdings, LLC -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see . -;------------------------------------------------------------------------ - -;---------------------------------------------------------------------------- -; Low Level DLL, entrypoint and boundary signatures -; The code section of this DLL is not executed as a typical "loaded" module -; in virtual address space. Instead this dll is loaded from a resource in -; SbieSrv.exe named Lowlevel. The code section is copied from this resource -; and load directly in to memory and injected in to various targets. Thus the -; code section of this dll is executed like shell code because of the manual -; load techinque used by SbieSrv.exe and needs to execute in various memory locations -; since it is the injected code. SbieSrv.exe will parse the PE Header of -; lowlevel.dll to locate the code section and copy it. To simplify the work -; needed to locate key locations with in the object code generated -; by entry.asm, lowlevel.dll needs to have the base address set to 0 in its PE Header. -; There is a dependency on the linker setting that sets the base address of the dll to zero. -; A non-zero address in the base address section of the PE header will result in a error from -; SbieSrv.exe. There is also a dependency on the section names ".text" and "zzzz". -; SbieSrv.exe uses these section names to find the code section and critical symbol -; locations. Currently these two sections need to be the first two sections defined -; in lowlevel.dll: ".text" must be the first section followed by "zzzz" -;---------------------------------------------------------------------------- - - - -ifndef _WIN64 - -.386p -.model flat - -endif - - -;---------------------------------------------------------------------------- -;Removed hard coded Head and Tail Signature dependency -;Head Signature - deprecated -;---------------------------------------------------------------------------- - - .code - start: - -;---------------------------------------------------------------------------- -; Entrypoint at _Start -;---------------------------------------------------------------------------- - -ifdef _WIN64 ; 64-bit - -EXTERN EntrypointC : PROC - -_Start: - sub rsp, 28h ; standard stack frame - mov qword ptr [rsp+4*8], rcx - mov qword ptr [rsp+5*8], rdx - mov qword ptr [rsp+6*8], r8 - mov qword ptr [rsp+7*8], r9 - - call $+5 -_001: pop rcx - ; removed hard coded position dependency - ; key symbols are now passed as arguments to EntrypointC - ; 64 bit version takes 4 arguments - ; _EntrypointC(SbieLowData,_RtlFindActivationContextSectionString,_SystemService,_RtlFindActivationContextSectionString64) - - mov rbx,rcx - add rcx, offset SbieLowData - _001 - mov rdx,rbx - add rdx, offset _RtlFindActivationContextSectionString - _001 - mov r8,rbx - add r8, offset _SystemService - _001 - mov r9,rbx - add r9, offset _RtlFindActivationContextSectionString64 - _001 - - call EntrypointC - - mov rcx, qword ptr [rsp+4*8] - mov rdx, qword ptr [rsp+5*8] - mov r8, qword ptr [rsp+6*8] - mov r9, qword ptr [rsp+7*8] - add rsp, 28h - jmp rax ; jump to LdrInitializeThunk trampoline - -else ; 32-bit - -EXTERN _EntrypointC@12 : PROC -_Start: - call $+5 -_001: pop eax - mov edx,eax - ; removed hard coded position dependency - ; key symbols are now passed as arguments to EntrypointC - ; 32 bit version takes 3 arguments - ;_EntrypointC(SbieLowData,_RtlFindActivationContextSectionString,_SystemService) - add eax, offset _SystemService - _001 ;old + 96 offset - push eax - mov eax,edx - add eax, offset _RtlFindActivationContextSectionString - _001; old + 256 offset - push eax - mov eax, edx - add eax, offset SbieLowData - _001 - push eax - call _EntrypointC@12 - jmp eax ; jump to LdrInitializeThunk trampoline - -endif ; 32-bit or 64-bit - - -;---------------------------------------------------------------------------- -; SystemService -;---------------------------------------------------------------------------- - - -_SystemService: - -;---------------------------------------------------------------------------- -ifdef _WIN64 ; 64-bit -myService Proc - db 48h, 0B8h ; rax -> SbieLowData - dq ? - ; - ; make room for several qwords on the stack: - ; ULONG64 arg_space_for_NtDeviceIoControlFile[10] - ; IO_STATUS_BLOCK IoStatusBlock64; #10 on stack - ; ULONG64 IoStatusBlock32; #12 on stack - ; ULONG64 parms[API_NUM_ARGS]; #13 on stack - ; note that stack pointer is known to be xxxx8 on entry, - ; because of x64 calling convention. - ; - - push rbp; target rsp - push rbx; target rip - - mov r11,[rax + 0e0h] ; real NtDeviceIOControlFile - add r11b,0fh - - mov rbx, r11 ; pass new rip in rbx - mov r11, rsp ; restore stack in r11 - add r11, 10h - - mov rbp, r11 ; pass stack frame in rbp - - API_NUM_ARGS = 8 - sub rsp, (API_NUM_ARGS + 1 + 2 + 10) * 8 - - ; - ; spill parameters in registers onto the stack - ; - - mov qword ptr [r11+1*8], rcx - mov qword ptr [r11+2*8], rdx - mov qword ptr [r11+3*8], r8 - mov qword ptr [r11+4*8], r9 - - - ; - ; parms[1] = syscall_index - ; parms[2] = pointer to system service arguments on stack - ; parms[0] = API_INVOKE_SYSCALL (from SbieLowData) - ; - - lea rcx, [rsp+13*8] ; rcx -> parms - - mov qword ptr [rcx+1*8], r10 ; syscall index - mov r10, rax ; r10 -> SbieLowData - - lea r11, [r11+8] - mov qword ptr [rcx+2*8], r11 ; stack address - - mov eax, dword ptr [r10+3*8+4] ; API_INVOKE_SYSCALL - mov qword ptr [rcx+0*8], rax - - ; - ; the 64-bit kernel function for NtDeviceIoControlFile - ; expects the 64-bit IoStatusBlock argument to contain a - ; 32-bit pointer to a 32-bit IoStatusBlock structure. - ; we can allocate the 32-bit structure on the stack - ; because the stack is 32-bits in a 32-bit program - ; - - lea rax, [rsp+12*8] ; rax -> IoStatusBlock32 - lea rdx, [rsp+10*8] ; rdx -> MyIoStatusBlock64 - mov qword ptr [rdx], rax - - ; - ; invoke SbieLow.NtDeviceIoControlFile( - ; data->api_device_handle, - ; NULL, NULL, NULL, - ; &MyIoStatusBlock, - ; API_SBIEDRV_CTLCODE, - ; parms, - ; API_NUM_ARGS * sizeof(ULONG64), - ; NULL, 0); - ; - - mov qword ptr [rsp+4*8], rdx ; MyIoStatusBlock64 - - mov eax, [r10+3*8+0] ; API_SBIEDRV_CTLCODE - mov qword ptr [rsp+5*8], rax - - mov qword ptr [rsp+6*8], rcx ; parms - - mov eax, (API_NUM_ARGS * 8) - mov qword ptr [rsp+7*8], rax - - mov rcx, qword ptr [r10+2*8] ; file handle - - xor rdx, rdx - mov r8, rdx - mov r9, rdx - - mov qword ptr [rsp+8*8], rdx - mov qword ptr [rsp+9*8], rdx - - lea r10, [r10+80h] ; r10 -> SbieLow.NtDeviceIoControlFile - - call r10 - add rsp, (API_NUM_ARGS + 1 + 2 + 10) * 8 - - pop rbx - pop rbp - ret - -myService ENDP -;---------------------------------------------------------------------------- - -else ; 32-bit - - mov edx, 0 ; edx -> SbieLowData - push eax ; save syscall index and param count - push ebp - mov ebp, esp - - ; - ; make room for several qwords on the stack: - ; IO_STATUS_BLOCK MyIoStatusBlock; - ; __declspec(align(8)) ULONG64 parms[API_NUM_ARGS]; - ; align stack on 8-bytes for call to NtDeviceIoControlFile - ; - ; keep API_NUM_ARGS in sync with core/drv/api_defs.h - - API_NUM_ARGS = 8 - - sub esp, (API_NUM_ARGS + 1) * 8 + 7 - and esp, 0FFFFFFF8h - - ; - ; parms[1] = syscall_index - ; parms[2] = pointer to system service arguments on stack - ; parms[0] = API_INVOKE_SYSCALL (from SbieLowData) - ; - - and eax, 0FFFh ; keep just service index number - mov dword ptr [esp+2*8], eax - - lea eax, [ebp+4*3] ; eax -> orig arg 1 on stack - mov dword ptr [esp+3*8], eax - - mov eax, [edx+3*8+4] ; eax = SbieLow.api_invoke_syscall - mov dword ptr [esp+1*8], eax - - ; - ; invoke SbieLow.NtDeviceIoControlFile( - ; data->api_device_handle, - ; NULL, NULL, NULL, - ; &MyIoStatusBlock, - ; API_SBIEDRV_CTLCODE, - ; parms, - ; API_NUM_ARGS * sizeof(ULONG64), - ; NULL, 0); - ; - - mov ecx, esp ; ecx = address of IoStatusBlock - lea eax, [esp+1*8] ; eax = address of parms - - push 0 - push 0 - push (API_NUM_ARGS * 8) - push eax ; push address of parms - push [edx+3*8+0] ; push API_SBIEDRV_CTLCODE - push ecx ; push address of IoStatusBlock - push 0 - push 0 - push 0 - push [edx+2*8] ; push SbieLow.api_device_handle - - lea eax, [edx+80h] ; eax -> SbieLow.NtDeviceIoControlFile - call eax - - ; - ; restore stack and return to caller. we can't do "ret n" - ; because n is not a known constant, so we manually pop the - ; arguments off the stack and jump to the return address - ; - - mov esp, ebp - pop ebp - - pop ecx ; restore original eax - shr ecx, 24 ; keep just param count - add ecx, 4 - add esp, ecx ; pop arguments for service call - neg ecx - mov ecx, [esp+ecx] - jmp ecx ; return to caller -endif ; 32-bit or 64-bit - - -;---------------------------------------------------------------------------- -; Inject Data Area for our RtlFindActivationContextSectionString -;---------------------------------------------------------------------------- - - -InjectData struct ; keep in sync with inject.c - dq ? -LdrLoadDll dq ? -LdrGetProcAddr dq ? -NtRaiseHardError dq ? -RtlFindActCtx dq ? -RtlFindActCtx_Protect dd ? -RtlFindActCtx_Bytes db 12 dup (?) -KernelDll_Unicode dq 2 dup (?) -SbieDll_Unicode dq 2 dup (?) -ModuleHandle dq ? -SbieDllOrdinal1 dq ? -InjectData ends - - -;---------------------------------------------------------------------------- -; 32-bit RtlFindActivationContextSectionString detour code -;---------------------------------------------------------------------------- - -_RtlFindActivationContextSectionString: -ifdef _WIN64 ; 64-bit - - ; - ; we need the 32-bit version of RtlFindActivationContextSectionString - ; on both 32-bit and 64-bit versions of SbieLow, because of wow64 - ; - ; it will not compile correctly as assembly on 64-bit, so we simply - ; dump the machine code bytes here - ; - ; the code bytes below are copied by InitInjectWow64 (see inject.c), - ; make sure to keep the length in that function in sync with the code - ; - - db 0BAh, 0, 0, 0, 0 ; mov edx, 0 - db 056h ; push esi - db 08Bh, 0F2h ; mov esi, edx - ; - db 08Bh, 046h, 020h ; mov eax,dword ptr [esi+20h] - db 08Ah, 056h, 02Ch ; mov dl,byte ptr [esi+2Ch] - db 088h, 010h ; mov byte ptr [eax],dl - db 08Bh, 056h, 02Dh ; mov edx,dword ptr [esi+2Dh] - db 089h, 050h, 001h ; mov dword ptr [eax+1],edx - ;;;;;new code for retry loop - db 0b9h, 010h, 0, 0, 0 ; mov ecx, 10h - ;;;;;; - ;for(i = 0; i < 0x10; i++) { - db 051h ; push ecx - db 08Dh, 046h, 058h ; lea eax,[esi+58h] - db 050h ; push eax - db 08Dh, 046h, 038h ; lea eax,[esi+38h] - db 050h ; push eax - db 06Ah, 000h ; push 0 - db 06Ah, 000h ; push 0 - db 0FFh, 056h, 008h ; call dword ptr [esi+8] - ;;;;; - db 059h ; pop ecx - ;;;;; - db 085h, 0C0h ; test eax,eax - db 074h, 004h ; jz good - ;} - db 0e2h, 0e9h ; loop retry - db 0ebh, 034h ; jmp error - ; - - db 08Dh, 046h, 058h ; lea eax,[esi+58h] - db 050h ; push eax - db 08Dh, 046h, 048h ; lea eax,[esi+48h] - db 050h ; push eax - db 06Ah, 000h ; push 0 - db 06Ah, 000h ; push 0 - db 0FFh, 056h, 008h ; call dword ptr [esi+8] - ; - db 085h, 0C0h ; test eax,eax - db 075h, 021h ; jnz error - ; - db 08Dh, 046h, 060h ; lea eax,[esi+60h] - db 050h ; push eax - db 06Ah, 001h ; push 1 - db 06Ah, 000h ; push 0 - db 0FFh, 076h, 058h ; push dword ptr [esi+58h] - db 0FFh, 056h, 010h ; call dword ptr [esi+10h] - ; - db 085h, 0C0h ; test eax,eax - db 075h, 00Fh ; jnz error - ; - db 08Bh, 0C6h ; mov eax, esi - db 087h, 044h, 024h, 008h ; xchg eax, dword ptr [esp+8] - db 089h, 046h, 008h ; mov dword ptr [esi+8],eax - db 08Bh, 0C6h ; mov eax, esi - db 05Eh ; pop esi - db 0FFh, 060h, 060h ; jmp dword ptr [eax+60h] - ; - db 050h ; push eax - db 08Dh, 056h, 048h ; lea edx,[esi+48h] - db 089h, 056h, 008h ; mov dword ptr [esi+8],edx - db 08dh, 056h, 010h ; lea edx,[esi+10h] - db 052h ; push edx - db 06Ah, 001h ; push 1 - db 08Dh, 056h, 008h ; lea edx,[esi+8] - db 052h ; push edx - db 06Ah, 001h ; push 1 - db 06Ah, 001h ; push 1 - db 068h, 042h, 001h, 000h, 0D0h ; push 0D0000142h - db 0FFh, 056h, 018h ; call dword ptr [esi+18h] - db 058h ; pop eax - db 05Eh ; pop esi - db 0C2h, 14h, 00h ; ret 14h - -else ; 32-bit - - mov edx, 0 ; edx -> inject data area - - push esi - mov esi, edx ; esi -> inject data area - - mov eax, dword ptr [esi].InjectData.RtlFindActCtx - mov dl, byte ptr [esi].InjectData.RtlFindActCtx_Bytes - mov byte ptr [eax], dl - mov edx, dword ptr [esi].InjectData.RtlFindActCtx_Bytes+1 - mov dword ptr [eax+1], edx - - ; - ; call LdrLoadDll for kernel32 - ; - mov ecx, 10h ;number of retries -LdrLoadDll_Retry: - push ecx - lea eax, [esi].InjectData.ModuleHandle - push eax - lea eax, [esi].InjectData.KernelDll_Unicode - push eax - push 0 - push 0 - call dword ptr [esi].InjectData.LdrLoadDll - pop ecx - test eax, eax - jz LdrLoadDll_Good - loop LdrLoadDll_Retry - ; retry failed 16 times: raise error - jmp RtlFindActivationContextSectionStringError -LdrLoadDll_Good: - ; - ; call LdrLoadDll for sbiedll - ; - - lea eax, [esi].InjectData.ModuleHandle - push eax - lea eax, [esi].InjectData.SbieDll_Unicode - push eax - push 0 - push 0 - call dword ptr [esi].InjectData.LdrLoadDll - - test eax, eax - jnz RtlFindActivationContextSectionStringError - - ; - ; call LdrGetProcedureAddress for sbiedll ordinal 1, - ; which forces ntdll to initialize sbiedll - ; - - lea eax, [esi].InjectData.SbieDllOrdinal1 - push eax - push 1 - push 0 - push dword ptr [esi].InjectData.ModuleHandle - call dword ptr [esi].InjectData.LdrGetProcAddr - - test eax, eax - jnz RtlFindActivationContextSectionStringError - - ; - ; pass control to ordinal 1, which will free the inject - ; data area, and pass control to the original function - ; RtlFindActivationContextSectionString - ; - ; note that we need to pass the address of the inject - ; data area to ordinal 1, which we do by overwriting the - ; first argument. the original argument is saved in - ; the inject data area - ; - - mov eax, esi - xchg eax, dword ptr [esp+4*2] - mov dword ptr [esi].InjectData.LdrLoadDll, eax - mov eax, esi - pop esi - jmp dword ptr [eax].InjectData.SbieDllOrdinal1 - - ; - ; display error message, invoke NtRaiseHardError( - ; NTSTATUS ntstatus_message_code, - ; ULONG number_of_parameters_in_list, - ; ULONG mask_of_strings_in_list, - ; ULONG_PTR *list_of_pointers_to_parameters, - ; ULONG response_buttons, - ; ULONG *out_response) - ; - -RtlFindActivationContextSectionStringError: - - STATUS_DLL_INIT_FAILED = 0C0000142h - FORCE_ERROR_MESSAGE_BOX = 010000000h - - push eax ; save ntstatus - - lea edx, [esi].InjectData.SbieDll_Unicode - mov dword ptr [esi].InjectData.LdrLoadDll, edx - - lea edx, [esi].InjectData.LdrGetProcAddr - push edx ; out_response - push 1 ; response_buttons - ERROR_OK - lea edx, [esi].InjectData.LdrLoadDll - push edx ; list_of_pointers_to_parameters - push 1 ; mask_of_strings_in_list - push 1 ; number_of_parameters_in_list - push (STATUS_DLL_INIT_FAILED or FORCE_ERROR_MESSAGE_BOX) - call dword ptr [esi].InjectData.NtRaiseHardError - - pop eax ; pop error ntstatus to return - pop esi - ret 14h ; return to caller with error - -endif ; 32-bit or 64-bit - - -;---------------------------------------------------------------------------- -; 64-bit RtlFindActivationContextSectionString detour code -;---------------------------------------------------------------------------- - - -ifdef _WIN64 ; 64-bit -dq 0h ;inject data area address - _RtlFindActivationContextSectionString64: - mov rax, qword ptr [$-8] ; rax -> inject data area - - push rsi ; save rsi, and align stack - sub rsp, 8*8 ; set up local stack - - mov qword ptr [rsp+4*8], rcx - mov qword ptr [rsp+5*8], rdx - mov qword ptr [rsp+6*8], r8 - mov qword ptr [rsp+7*8], r9 - - mov rsi, rax ; rsi -> inject data area - - mov rax, qword ptr [rsi].InjectData.RtlFindActCtx - - ;replace 12bytes - mov rdx, qword ptr [rsi].InjectData.RtlFindActCtx_Bytes - mov qword ptr [rax], rdx - mov edx, dword ptr [rsi].InjectData.RtlFindActCtx_Bytes + 8 - mov dword ptr [rax+8], edx - ; - ; call LdrLoadDll for kernel32 - ; - ;; retry loop - mov qword ptr [rsi].InjectData.RtlFindActCtx_Bytes, rbx - mov rbx, 010h - -LdrLoadRetry: - xor rcx, rcx - xor rdx, rdx - lea r8, [rsi].InjectData.KernelDll_Unicode - lea r9, [rsi].InjectData.ModuleHandle - ;cmp rbx,1 - ;jnz LdrTestLoop - call qword ptr [rsi].InjectData.LdrLoadDll - test eax, eax - jz LdrLoadGood -;LdrTestLoop: - dec rbx - test rbx, rbx - jnz LdrLoadRetry ;loop LdrLoadRetry - jmp RtlFindActivationContextSectionStringError - ; - ; call LdrLoadDll for sbiedll - ; -LdrLoadGood: - mov rbx, qword ptr [rsi].InjectData.RtlFindActCtx_Bytes - xor rcx, rcx - xor rdx, rdx - lea r8, [rsi].InjectData.SbieDll_Unicode - lea r9, [rsi].InjectData.ModuleHandle - call qword ptr [rsi].InjectData.LdrLoadDll - - test eax, eax - jnz RtlFindActivationContextSectionStringError - - ; - ; call LdrGetProcedureAddress for sbiedll ordinal 1, - ; which forces ntdll to initialize sbiedll - ; - - mov rcx, qword ptr [rsi].InjectData.ModuleHandle - xor rdx, rdx - xor r8, r8 - inc r8 - lea r9, [rsi].InjectData.SbieDllOrdinal1 - call qword ptr [rsi].InjectData.LdrGetProcAddr - - test eax, eax - jnz RtlFindActivationContextSectionStringError - - ; - ; pass control to ordinal 1, which will free the inject - ; data area, and pass control to the original function - ; RtlFindActivationContextSectionString - ; - ; note that we need to pass the address of the inject - ; data area to ordinal 1, which we do by overwriting the - ; first argument. the original argument is saved in - ; the inject data area - ; - - mov rax, qword ptr [rsp+4*8] - mov qword ptr [rsi].InjectData.LdrLoadDll, rax - mov rcx, rsi - mov rdx, qword ptr [rsp+5*8] - mov r8, qword ptr [rsp+6*8] - mov r9, qword ptr [rsp+7*8] - - add rsp, 8*8 - pop rsi - jmp qword ptr [rcx].InjectData.SbieDllOrdinal1 - - ; - ; display error message, invoke NtRaiseHardError( - ; NTSTATUS ntstatus_message_code, - ; ULONG number_of_parameters_in_list, - ; ULONG mask_of_strings_in_list, - ; ULONG_PTR *list_of_pointers_to_parameters, - ; ULONG response_buttons, - ; ULONG *out_response) - ; - -RtlFindActivationContextSectionStringError: - - STATUS_DLL_INIT_FAILED = 0C0000142h - FORCE_ERROR_MESSAGE_BOX = 010000000h - - mov qword ptr [rsp+7*8], rax ; save ntstatus - - mov ecx, \ ; ntstatus_message_code - (STATUS_DLL_INIT_FAILED or FORCE_ERROR_MESSAGE_BOX) - - xor rdx, rdx ; number_of_parameters_in_list - inc rdx - - mov r8, rdx ; mask_of_strings_in_list - - lea r9, \ ; list_of_pointers_to_parameters - [esi].InjectData.LdrLoadDll - lea rax, [rsi].InjectData.SbieDll_Unicode - mov qword ptr [r9], rax - - mov \ ; response_buttons - ERROR_OK - qword ptr [rsp+4*8], rdx - - lea rax, [rsi].InjectData.LdrGetProcAddr - mov \ ; out_response - qword ptr [rsp+5*8], rax - - call qword ptr [rsi].InjectData.NtRaiseHardError - - mov rcx, qword ptr [rsp+7*8] ; restore ntstatus - add rsp, 8*8 - pop rsi - ret ; return to caller with error - -endif ; 64-bit - - -;---------------------------------------------------------------------------- -; Parameters stored by SbieSvc -;---------------------------------------------------------------------------- - -SbieLowData LABEL QWORD - - dq 48 dup (0) ; at least sizeof(SBIELOW_DATA) - - -;---------------------------------------------------------------------------- -; Tail Signature -;---------------------------------------------------------------------------- -; Replaced Tail signature in zzzz section with the two symbol locations -; _Start and SbiLowData used by SbieSvc - - .code zzzz - - dq _Start - dq SbieLowData - -;---------------------------------------------------------------------------- -end +;------------------------------------------------------------------------ +; Copyright 2004-2020 Sandboxie Holdings, LLC +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +;------------------------------------------------------------------------ + +;---------------------------------------------------------------------------- +; Low Level DLL, entrypoint and boundary signatures +; The code section of this DLL is not executed as a typical "loaded" module +; in virtual address space. Instead this dll is loaded from a resource in +; SbieSrv.exe named Lowlevel. The code section is copied from this resource +; and load directly in to memory and injected in to various targets. Thus the +; code section of this dll is executed like shell code because of the manual +; load techinque used by SbieSrv.exe and needs to execute in various memory locations +; since it is the injected code. SbieSrv.exe will parse the PE Header of +; lowlevel.dll to locate the code section and copy it. To simplify the work +; needed to locate key locations with in the object code generated +; by entry.asm, lowlevel.dll needs to have the base address set to 0 in its PE Header. +; There is a dependency on the linker setting that sets the base address of the dll to zero. +; A non-zero address in the base address section of the PE header will result in a error from +; SbieSrv.exe. There is also a dependency on the section names ".text" and "zzzz". +; SbieSrv.exe uses these section names to find the code section and critical symbol +; locations. Currently these two sections need to be the first two sections defined +; in lowlevel.dll: ".text" must be the first section followed by "zzzz" +;---------------------------------------------------------------------------- + + + +ifndef _WIN64 + +.386p +.model flat + +endif + + +;---------------------------------------------------------------------------- +;Removed hard coded Head and Tail Signature dependency +;Head Signature - deprecated +;---------------------------------------------------------------------------- + + .code + start: + +;---------------------------------------------------------------------------- +; Entrypoint at _Start +;---------------------------------------------------------------------------- + +ifdef _WIN64 ; 64-bit + +EXTERN EntrypointC : PROC + +_Start: + sub rsp, 28h ; standard stack frame + mov qword ptr [rsp+4*8], rcx + mov qword ptr [rsp+5*8], rdx + mov qword ptr [rsp+6*8], r8 + mov qword ptr [rsp+7*8], r9 + + call $+5 +_001: pop rcx + ; removed hard coded position dependency + ; key symbols are now passed as arguments to EntrypointC + ; 64 bit version takes 4 arguments + ; _EntrypointC(SbieLowData,_RtlFindActivationContextSectionString,_SystemService,_RtlFindActivationContextSectionString64) + + mov rbx,rcx + add rcx, offset SbieLowData - _001 + mov rdx,rbx + add rdx, offset _RtlFindActivationContextSectionString - _001 + mov r8,rbx + add r8, offset _SystemService - _001 + mov r9,rbx + add r9, offset _RtlFindActivationContextSectionString64 - _001 + + call EntrypointC + + mov rcx, qword ptr [rsp+4*8] + mov rdx, qword ptr [rsp+5*8] + mov r8, qword ptr [rsp+6*8] + mov r9, qword ptr [rsp+7*8] + add rsp, 28h + jmp rax ; jump to LdrInitializeThunk trampoline + +else ; 32-bit + +EXTERN _EntrypointC@12 : PROC +_Start: + call $+5 +_001: pop eax + mov edx,eax + ; removed hard coded position dependency + ; key symbols are now passed as arguments to EntrypointC + ; 32 bit version takes 3 arguments + ;_EntrypointC(SbieLowData,_RtlFindActivationContextSectionString,_SystemService) + add eax, offset _SystemService - _001 ;old + 96 offset + push eax + mov eax,edx + add eax, offset _RtlFindActivationContextSectionString - _001; old + 256 offset + push eax + mov eax, edx + add eax, offset SbieLowData - _001 + push eax + call _EntrypointC@12 + jmp eax ; jump to LdrInitializeThunk trampoline + +endif ; 32-bit or 64-bit + + +;---------------------------------------------------------------------------- +; SystemService +;---------------------------------------------------------------------------- + + +_SystemService: + +;---------------------------------------------------------------------------- +ifdef _WIN64 ; 64-bit +myService Proc + db 48h, 0B8h ; rax -> SbieLowData + dq ? + ; + ; make room for several qwords on the stack: + ; ULONG64 arg_space_for_NtDeviceIoControlFile[10] + ; IO_STATUS_BLOCK IoStatusBlock64; #10 on stack + ; ULONG64 IoStatusBlock32; #12 on stack + ; ULONG64 parms[API_NUM_ARGS]; #13 on stack + ; note that stack pointer is known to be xxxx8 on entry, + ; because of x64 calling convention. + ; + + push rbp; target rsp + push rbx; target rip + + mov r11,[rax + 0e0h] ; real NtDeviceIOControlFile + add r11b,0fh + + mov rbx, r11 ; pass new rip in rbx + mov r11, rsp ; restore stack in r11 + add r11, 10h + + mov rbp, r11 ; pass stack frame in rbp + + API_NUM_ARGS = 8 + sub rsp, (API_NUM_ARGS + 1 + 2 + 10) * 8 + + ; + ; spill parameters in registers onto the stack + ; + + mov qword ptr [r11+1*8], rcx + mov qword ptr [r11+2*8], rdx + mov qword ptr [r11+3*8], r8 + mov qword ptr [r11+4*8], r9 + + + ; + ; parms[1] = syscall_index + ; parms[2] = pointer to system service arguments on stack + ; parms[0] = API_INVOKE_SYSCALL (from SbieLowData) + ; + + lea rcx, [rsp+13*8] ; rcx -> parms + + mov qword ptr [rcx+1*8], r10 ; syscall index + mov r10, rax ; r10 -> SbieLowData + + lea r11, [r11+8] + mov qword ptr [rcx+2*8], r11 ; stack address + + mov eax, dword ptr [r10+3*8+4] ; API_INVOKE_SYSCALL + mov qword ptr [rcx+0*8], rax + + ; + ; the 64-bit kernel function for NtDeviceIoControlFile + ; expects the 64-bit IoStatusBlock argument to contain a + ; 32-bit pointer to a 32-bit IoStatusBlock structure. + ; we can allocate the 32-bit structure on the stack + ; because the stack is 32-bits in a 32-bit program + ; + + lea rax, [rsp+12*8] ; rax -> IoStatusBlock32 + lea rdx, [rsp+10*8] ; rdx -> MyIoStatusBlock64 + mov qword ptr [rdx], rax + + ; + ; invoke SbieLow.NtDeviceIoControlFile( + ; data->api_device_handle, + ; NULL, NULL, NULL, + ; &MyIoStatusBlock, + ; API_SBIEDRV_CTLCODE, + ; parms, + ; API_NUM_ARGS * sizeof(ULONG64), + ; NULL, 0); + ; + + mov qword ptr [rsp+4*8], rdx ; MyIoStatusBlock64 + + mov eax, [r10+3*8+0] ; API_SBIEDRV_CTLCODE + mov qword ptr [rsp+5*8], rax + + mov qword ptr [rsp+6*8], rcx ; parms + + mov eax, (API_NUM_ARGS * 8) + mov qword ptr [rsp+7*8], rax + + mov rcx, qword ptr [r10+2*8] ; file handle + + xor rdx, rdx + mov r8, rdx + mov r9, rdx + + mov qword ptr [rsp+8*8], rdx + mov qword ptr [rsp+9*8], rdx + + lea r10, [r10+80h] ; r10 -> SbieLow.NtDeviceIoControlFile + + call r10 + add rsp, (API_NUM_ARGS + 1 + 2 + 10) * 8 + + pop rbx + pop rbp + ret + +myService ENDP +;---------------------------------------------------------------------------- + +else ; 32-bit + + mov edx, 0 ; edx -> SbieLowData + push eax ; save syscall index and param count + push ebp + mov ebp, esp + + ; + ; make room for several qwords on the stack: + ; IO_STATUS_BLOCK MyIoStatusBlock; + ; __declspec(align(8)) ULONG64 parms[API_NUM_ARGS]; + ; align stack on 8-bytes for call to NtDeviceIoControlFile + ; + ; keep API_NUM_ARGS in sync with core/drv/api_defs.h + + API_NUM_ARGS = 8 + + sub esp, (API_NUM_ARGS + 1) * 8 + 7 + and esp, 0FFFFFFF8h + + ; + ; parms[1] = syscall_index + ; parms[2] = pointer to system service arguments on stack + ; parms[0] = API_INVOKE_SYSCALL (from SbieLowData) + ; + + and eax, 0FFFh ; keep just service index number + mov dword ptr [esp+2*8], eax + + lea eax, [ebp+4*3] ; eax -> orig arg 1 on stack + mov dword ptr [esp+3*8], eax + + mov eax, [edx+3*8+4] ; eax = SbieLow.api_invoke_syscall + mov dword ptr [esp+1*8], eax + + ; + ; invoke SbieLow.NtDeviceIoControlFile( + ; data->api_device_handle, + ; NULL, NULL, NULL, + ; &MyIoStatusBlock, + ; API_SBIEDRV_CTLCODE, + ; parms, + ; API_NUM_ARGS * sizeof(ULONG64), + ; NULL, 0); + ; + + mov ecx, esp ; ecx = address of IoStatusBlock + lea eax, [esp+1*8] ; eax = address of parms + + push 0 + push 0 + push (API_NUM_ARGS * 8) + push eax ; push address of parms + push [edx+3*8+0] ; push API_SBIEDRV_CTLCODE + push ecx ; push address of IoStatusBlock + push 0 + push 0 + push 0 + push [edx+2*8] ; push SbieLow.api_device_handle + + lea eax, [edx+80h] ; eax -> SbieLow.NtDeviceIoControlFile + call eax + + ; + ; restore stack and return to caller. we can't do "ret n" + ; because n is not a known constant, so we manually pop the + ; arguments off the stack and jump to the return address + ; + + mov esp, ebp + pop ebp + + pop ecx ; restore original eax + shr ecx, 24 ; keep just param count + add ecx, 4 + add esp, ecx ; pop arguments for service call + neg ecx + mov ecx, [esp+ecx] + jmp ecx ; return to caller +endif ; 32-bit or 64-bit + + +;---------------------------------------------------------------------------- +; Inject Data Area for our RtlFindActivationContextSectionString +;---------------------------------------------------------------------------- + + +InjectData struct ; keep in sync with inject.c + dq ? +LdrLoadDll dq ? +LdrGetProcAddr dq ? +NtRaiseHardError dq ? +RtlFindActCtx dq ? +RtlFindActCtx_Protect dd ? +RtlFindActCtx_Bytes db 12 dup (?) +KernelDll_Unicode dq 2 dup (?) +SbieDll_Unicode dq 2 dup (?) +ModuleHandle dq ? +SbieDllOrdinal1 dq ? +InjectData ends + + +;---------------------------------------------------------------------------- +; 32-bit RtlFindActivationContextSectionString detour code +;---------------------------------------------------------------------------- + +_RtlFindActivationContextSectionString: +ifdef _WIN64 ; 64-bit + + ; + ; we need the 32-bit version of RtlFindActivationContextSectionString + ; on both 32-bit and 64-bit versions of SbieLow, because of wow64 + ; + ; it will not compile correctly as assembly on 64-bit, so we simply + ; dump the machine code bytes here + ; + ; the code bytes below are copied by InitInjectWow64 (see inject.c), + ; make sure to keep the length in that function in sync with the code + ; + + db 0BAh, 0, 0, 0, 0 ; mov edx, 0 + db 056h ; push esi + db 08Bh, 0F2h ; mov esi, edx + ; + db 08Bh, 046h, 020h ; mov eax,dword ptr [esi+20h] + db 08Ah, 056h, 02Ch ; mov dl,byte ptr [esi+2Ch] + db 088h, 010h ; mov byte ptr [eax],dl + db 08Bh, 056h, 02Dh ; mov edx,dword ptr [esi+2Dh] + db 089h, 050h, 001h ; mov dword ptr [eax+1],edx + ;;;;;new code for retry loop + db 0b9h, 010h, 0, 0, 0 ; mov ecx, 10h + ;;;;;; + ;for(i = 0; i < 0x10; i++) { + db 051h ; push ecx + db 08Dh, 046h, 058h ; lea eax,[esi+58h] + db 050h ; push eax + db 08Dh, 046h, 038h ; lea eax,[esi+38h] + db 050h ; push eax + db 06Ah, 000h ; push 0 + db 06Ah, 000h ; push 0 + db 0FFh, 056h, 008h ; call dword ptr [esi+8] + ;;;;; + db 059h ; pop ecx + ;;;;; + db 085h, 0C0h ; test eax,eax + db 074h, 004h ; jz good + ;} + db 0e2h, 0e9h ; loop retry + db 0ebh, 034h ; jmp error + ; + + db 08Dh, 046h, 058h ; lea eax,[esi+58h] + db 050h ; push eax + db 08Dh, 046h, 048h ; lea eax,[esi+48h] + db 050h ; push eax + db 06Ah, 000h ; push 0 + db 06Ah, 000h ; push 0 + db 0FFh, 056h, 008h ; call dword ptr [esi+8] + ; + db 085h, 0C0h ; test eax,eax + db 075h, 021h ; jnz error + ; + db 08Dh, 046h, 060h ; lea eax,[esi+60h] + db 050h ; push eax + db 06Ah, 001h ; push 1 + db 06Ah, 000h ; push 0 + db 0FFh, 076h, 058h ; push dword ptr [esi+58h] + db 0FFh, 056h, 010h ; call dword ptr [esi+10h] + ; + db 085h, 0C0h ; test eax,eax + db 075h, 00Fh ; jnz error + ; + db 08Bh, 0C6h ; mov eax, esi + db 087h, 044h, 024h, 008h ; xchg eax, dword ptr [esp+8] + db 089h, 046h, 008h ; mov dword ptr [esi+8],eax + db 08Bh, 0C6h ; mov eax, esi + db 05Eh ; pop esi + db 0FFh, 060h, 060h ; jmp dword ptr [eax+60h] + ; + db 050h ; push eax + db 08Dh, 056h, 048h ; lea edx,[esi+48h] + db 089h, 056h, 008h ; mov dword ptr [esi+8],edx + db 08dh, 056h, 010h ; lea edx,[esi+10h] + db 052h ; push edx + db 06Ah, 001h ; push 1 + db 08Dh, 056h, 008h ; lea edx,[esi+8] + db 052h ; push edx + db 06Ah, 001h ; push 1 + db 06Ah, 001h ; push 1 + db 068h, 042h, 001h, 000h, 0D0h ; push 0D0000142h + db 0FFh, 056h, 018h ; call dword ptr [esi+18h] + db 058h ; pop eax + db 05Eh ; pop esi + db 0C2h, 14h, 00h ; ret 14h + +else ; 32-bit + + mov edx, 0 ; edx -> inject data area + + push esi + mov esi, edx ; esi -> inject data area + + mov eax, dword ptr [esi].InjectData.RtlFindActCtx + mov dl, byte ptr [esi].InjectData.RtlFindActCtx_Bytes + mov byte ptr [eax], dl + mov edx, dword ptr [esi].InjectData.RtlFindActCtx_Bytes+1 + mov dword ptr [eax+1], edx + + ; + ; call LdrLoadDll for kernel32 + ; + mov ecx, 10h ;number of retries +LdrLoadDll_Retry: + push ecx + lea eax, [esi].InjectData.ModuleHandle + push eax + lea eax, [esi].InjectData.KernelDll_Unicode + push eax + push 0 + push 0 + call dword ptr [esi].InjectData.LdrLoadDll + pop ecx + test eax, eax + jz LdrLoadDll_Good + loop LdrLoadDll_Retry + ; retry failed 16 times: raise error + jmp RtlFindActivationContextSectionStringError +LdrLoadDll_Good: + ; + ; call LdrLoadDll for sbiedll + ; + + lea eax, [esi].InjectData.ModuleHandle + push eax + lea eax, [esi].InjectData.SbieDll_Unicode + push eax + push 0 + push 0 + call dword ptr [esi].InjectData.LdrLoadDll + + test eax, eax + jnz RtlFindActivationContextSectionStringError + + ; + ; call LdrGetProcedureAddress for sbiedll ordinal 1, + ; which forces ntdll to initialize sbiedll + ; + + lea eax, [esi].InjectData.SbieDllOrdinal1 + push eax + push 1 + push 0 + push dword ptr [esi].InjectData.ModuleHandle + call dword ptr [esi].InjectData.LdrGetProcAddr + + test eax, eax + jnz RtlFindActivationContextSectionStringError + + ; + ; pass control to ordinal 1, which will free the inject + ; data area, and pass control to the original function + ; RtlFindActivationContextSectionString + ; + ; note that we need to pass the address of the inject + ; data area to ordinal 1, which we do by overwriting the + ; first argument. the original argument is saved in + ; the inject data area + ; + + mov eax, esi + xchg eax, dword ptr [esp+4*2] + mov dword ptr [esi].InjectData.LdrLoadDll, eax + mov eax, esi + pop esi + jmp dword ptr [eax].InjectData.SbieDllOrdinal1 + + ; + ; display error message, invoke NtRaiseHardError( + ; NTSTATUS ntstatus_message_code, + ; ULONG number_of_parameters_in_list, + ; ULONG mask_of_strings_in_list, + ; ULONG_PTR *list_of_pointers_to_parameters, + ; ULONG response_buttons, + ; ULONG *out_response) + ; + +RtlFindActivationContextSectionStringError: + + STATUS_DLL_INIT_FAILED = 0C0000142h + FORCE_ERROR_MESSAGE_BOX = 010000000h + + push eax ; save ntstatus + + lea edx, [esi].InjectData.SbieDll_Unicode + mov dword ptr [esi].InjectData.LdrLoadDll, edx + + lea edx, [esi].InjectData.LdrGetProcAddr + push edx ; out_response + push 1 ; response_buttons - ERROR_OK + lea edx, [esi].InjectData.LdrLoadDll + push edx ; list_of_pointers_to_parameters + push 1 ; mask_of_strings_in_list + push 1 ; number_of_parameters_in_list + push (STATUS_DLL_INIT_FAILED or FORCE_ERROR_MESSAGE_BOX) + call dword ptr [esi].InjectData.NtRaiseHardError + + pop eax ; pop error ntstatus to return + pop esi + ret 14h ; return to caller with error + +endif ; 32-bit or 64-bit + + +;---------------------------------------------------------------------------- +; 64-bit RtlFindActivationContextSectionString detour code +;---------------------------------------------------------------------------- + + +ifdef _WIN64 ; 64-bit +dq 0h ;inject data area address + _RtlFindActivationContextSectionString64: + mov rax, qword ptr [$-8] ; rax -> inject data area + + push rsi ; save rsi, and align stack + sub rsp, 8*8 ; set up local stack + + mov qword ptr [rsp+4*8], rcx + mov qword ptr [rsp+5*8], rdx + mov qword ptr [rsp+6*8], r8 + mov qword ptr [rsp+7*8], r9 + + mov rsi, rax ; rsi -> inject data area + + mov rax, qword ptr [rsi].InjectData.RtlFindActCtx + + ;replace 12bytes + mov rdx, qword ptr [rsi].InjectData.RtlFindActCtx_Bytes + mov qword ptr [rax], rdx + mov edx, dword ptr [rsi].InjectData.RtlFindActCtx_Bytes + 8 + mov dword ptr [rax+8], edx + ; + ; call LdrLoadDll for kernel32 + ; + ;; retry loop + mov qword ptr [rsi].InjectData.RtlFindActCtx_Bytes, rbx + mov rbx, 010h + +LdrLoadRetry: + xor rcx, rcx + xor rdx, rdx + lea r8, [rsi].InjectData.KernelDll_Unicode + lea r9, [rsi].InjectData.ModuleHandle + ;cmp rbx,1 + ;jnz LdrTestLoop + call qword ptr [rsi].InjectData.LdrLoadDll + test eax, eax + jz LdrLoadGood +;LdrTestLoop: + dec rbx + test rbx, rbx + jnz LdrLoadRetry ;loop LdrLoadRetry + jmp RtlFindActivationContextSectionStringError + ; + ; call LdrLoadDll for sbiedll + ; +LdrLoadGood: + mov rbx, qword ptr [rsi].InjectData.RtlFindActCtx_Bytes + xor rcx, rcx + xor rdx, rdx + lea r8, [rsi].InjectData.SbieDll_Unicode + lea r9, [rsi].InjectData.ModuleHandle + call qword ptr [rsi].InjectData.LdrLoadDll + + test eax, eax + jnz RtlFindActivationContextSectionStringError + + ; + ; call LdrGetProcedureAddress for sbiedll ordinal 1, + ; which forces ntdll to initialize sbiedll + ; + + mov rcx, qword ptr [rsi].InjectData.ModuleHandle + xor rdx, rdx + xor r8, r8 + inc r8 + lea r9, [rsi].InjectData.SbieDllOrdinal1 + call qword ptr [rsi].InjectData.LdrGetProcAddr + + test eax, eax + jnz RtlFindActivationContextSectionStringError + + ; + ; pass control to ordinal 1, which will free the inject + ; data area, and pass control to the original function + ; RtlFindActivationContextSectionString + ; + ; note that we need to pass the address of the inject + ; data area to ordinal 1, which we do by overwriting the + ; first argument. the original argument is saved in + ; the inject data area + ; + + mov rax, qword ptr [rsp+4*8] + mov qword ptr [rsi].InjectData.LdrLoadDll, rax + mov rcx, rsi + mov rdx, qword ptr [rsp+5*8] + mov r8, qword ptr [rsp+6*8] + mov r9, qword ptr [rsp+7*8] + + add rsp, 8*8 + pop rsi + jmp qword ptr [rcx].InjectData.SbieDllOrdinal1 + + ; + ; display error message, invoke NtRaiseHardError( + ; NTSTATUS ntstatus_message_code, + ; ULONG number_of_parameters_in_list, + ; ULONG mask_of_strings_in_list, + ; ULONG_PTR *list_of_pointers_to_parameters, + ; ULONG response_buttons, + ; ULONG *out_response) + ; + +RtlFindActivationContextSectionStringError: + + STATUS_DLL_INIT_FAILED = 0C0000142h + FORCE_ERROR_MESSAGE_BOX = 010000000h + + mov qword ptr [rsp+7*8], rax ; save ntstatus + + mov ecx, \ ; ntstatus_message_code + (STATUS_DLL_INIT_FAILED or FORCE_ERROR_MESSAGE_BOX) + + xor rdx, rdx ; number_of_parameters_in_list + inc rdx + + mov r8, rdx ; mask_of_strings_in_list + + lea r9, \ ; list_of_pointers_to_parameters + [esi].InjectData.LdrLoadDll + lea rax, [rsi].InjectData.SbieDll_Unicode + mov qword ptr [r9], rax + + mov \ ; response_buttons - ERROR_OK + qword ptr [rsp+4*8], rdx + + lea rax, [rsi].InjectData.LdrGetProcAddr + mov \ ; out_response + qword ptr [rsp+5*8], rax + + call qword ptr [rsi].InjectData.NtRaiseHardError + + mov rcx, qword ptr [rsp+7*8] ; restore ntstatus + add rsp, 8*8 + pop rsi + ret ; return to caller with error + +endif ; 64-bit + + +;---------------------------------------------------------------------------- +; Parameters stored by SbieSvc +;---------------------------------------------------------------------------- + +SbieLowData LABEL QWORD + + dq 48 dup (0) ; at least sizeof(SBIELOW_DATA) + + +;---------------------------------------------------------------------------- +; Tail Signature +;---------------------------------------------------------------------------- +; Replaced Tail signature in zzzz section with the two symbol locations +; _Start and SbiLowData used by SbieSvc + + .code zzzz + + dq _Start + dq SbieLowData + +;---------------------------------------------------------------------------- +end diff --git a/Sandboxie/install/Cmdline.nsh b/Sandboxie/install/Cmdline.nsh index 71ee8b16..10e1df42 100644 --- a/Sandboxie/install/Cmdline.nsh +++ b/Sandboxie/install/Cmdline.nsh @@ -1,46 +1,46 @@ - ; GetParameters - ; input, none - ; output, top of stack (replaces, with e.g. whatever) - ; modifies no other variables. - - Function GetParameters - - Push $R0 - Push $R1 - Push $R2 - Push $R3 - - StrCpy $R2 1 - StrLen $R3 $CMDLINE - - StrCpy $R0 "" - StrCmp $R3 1 done - - ;Check for quote or space - StrCpy $R0 $CMDLINE $R2 - StrCmp $R0 '"' 0 +3 - StrCpy $R1 '"' - Goto loop - StrCpy $R1 " " - - loop: - IntOp $R2 $R2 + 1 - StrCpy $R0 $CMDLINE 1 $R2 - StrCmp $R0 $R1 get - StrCmp $R2 $R3 get - Goto loop - - get: - IntOp $R2 $R2 + 1 - StrCpy $R0 $CMDLINE 1 $R2 - StrCmp $R0 " " get - StrCpy $R0 $CMDLINE "" $R2 - - done: - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 - - FunctionEnd + ; GetParameters + ; input, none + ; output, top of stack (replaces, with e.g. whatever) + ; modifies no other variables. + + Function GetParameters + + Push $R0 + Push $R1 + Push $R2 + Push $R3 + + StrCpy $R2 1 + StrLen $R3 $CMDLINE + + StrCpy $R0 "" + StrCmp $R3 1 done + + ;Check for quote or space + StrCpy $R0 $CMDLINE $R2 + StrCmp $R0 '"' 0 +3 + StrCpy $R1 '"' + Goto loop + StrCpy $R1 " " + + loop: + IntOp $R2 $R2 + 1 + StrCpy $R0 $CMDLINE 1 $R2 + StrCmp $R0 $R1 get + StrCmp $R2 $R3 get + Goto loop + + get: + IntOp $R2 $R2 + 1 + StrCpy $R0 $CMDLINE 1 $R2 + StrCmp $R0 " " get + StrCpy $R0 $CMDLINE "" $R2 + + done: + + Pop $R3 + Pop $R2 + Pop $R1 + Exch $R0 + + FunctionEnd diff --git a/Sandboxie/install/IsAdmin.nsh b/Sandboxie/install/IsAdmin.nsh index 6371ad04..336f2dd8 100644 --- a/Sandboxie/install/IsAdmin.nsh +++ b/Sandboxie/install/IsAdmin.nsh @@ -1,49 +1,49 @@ -;---------------------------------------------------------------------------- -; Is User Admin, Vista Enabled -;---------------------------------------------------------------------------- - -!verbose push -!verbose 0 - -;---------------------------------------------------------------------------- -; Public Defines -;---------------------------------------------------------------------------- - - -;---------------------------------------------------------------------------- -; IsUserAdmin -;---------------------------------------------------------------------------- - - -!macro IsUserAdmin_Macro RESULT - - !define Index "Line${__LINE__}" - StrCpy ${RESULT} 0 - System::Call '*(&i1 0,&i4 0,&i1 5)i.r0' - System::Call 'advapi32::AllocateAndInitializeSid(i r0,i 2,i 32,i 544,i 0,i 0,i 0,i 0,i 0, \ - i 0,*i .R0)i.r5' - System::Free $0 - System::Call 'advapi32::CheckTokenMembership(i n,i R0,*i .R1)i.r5' - StrCmp $5 0 ${Index}_Error - StrCpy ${RESULT} $R1 - Goto ${Index}_End - ${Index}_Error: - StrCpy ${RESULT} -1 - ${Index}_End: - System::Call 'advapi32::FreeSid(i R0)i.r5' - !undef Index - -!macroend - - -Function IsUserAdmin - - !insertmacro IsUserAdmin_Macro $0 - -FunctionEnd - - -;---------------------------------------------------------------------------- - - -!verbose pop +;---------------------------------------------------------------------------- +; Is User Admin, Vista Enabled +;---------------------------------------------------------------------------- + +!verbose push +!verbose 0 + +;---------------------------------------------------------------------------- +; Public Defines +;---------------------------------------------------------------------------- + + +;---------------------------------------------------------------------------- +; IsUserAdmin +;---------------------------------------------------------------------------- + + +!macro IsUserAdmin_Macro RESULT + + !define Index "Line${__LINE__}" + StrCpy ${RESULT} 0 + System::Call '*(&i1 0,&i4 0,&i1 5)i.r0' + System::Call 'advapi32::AllocateAndInitializeSid(i r0,i 2,i 32,i 544,i 0,i 0,i 0,i 0,i 0, \ + i 0,*i .R0)i.r5' + System::Free $0 + System::Call 'advapi32::CheckTokenMembership(i n,i R0,*i .R1)i.r5' + StrCmp $5 0 ${Index}_Error + StrCpy ${RESULT} $R1 + Goto ${Index}_End + ${Index}_Error: + StrCpy ${RESULT} -1 + ${Index}_End: + System::Call 'advapi32::FreeSid(i R0)i.r5' + !undef Index + +!macroend + + +Function IsUserAdmin + + !insertmacro IsUserAdmin_Macro $0 + +FunctionEnd + + +;---------------------------------------------------------------------------- + + +!verbose pop diff --git a/Sandboxie/install/IsWow64.nsh b/Sandboxie/install/IsWow64.nsh index 5d7af94d..8b2c983a 100644 --- a/Sandboxie/install/IsWow64.nsh +++ b/Sandboxie/install/IsWow64.nsh @@ -1,59 +1,59 @@ -;---------------------------------------------------------------------------- -; 64-bit (WOW64) Detection -;---------------------------------------------------------------------------- - - -!define IsWow64Process "Kernel32::IsWow64Process(i, i) i" - - -!macro IsWow64_Common UN -Function ${UN}IsWow64 - - ; Save $0, $1 - - Push $0 - Push $1 - - ; Set $0 --> Kernel32.IsWow64Process - - System::Get '${IsWow64Process}' - Pop $0 - StrCmp $0 'error' pushzero - - ; Set $R1 --> DWORD - - StrCpy $1 "" - System::Call "*(i) i (0) .r1" - - ; Call IsWow64Process(GetCurrentProcess(), $1) - - System::Call "kernel32::GetCurrentProcess() i .s" - System::Call "${IsWow64Process}(s, r1)" - - ; Set $0 = *(int *)$1 - - System::Call "*$1(&i4 .r0)" - IntCmp $0 0 pushzero - - ; Restore $0, $1 and return with positive result - - Pop $1 - Pop $0 - Push "Y" - Return - -pushzero: - - ; Restore $0, $1 and return with negative result - - Pop $1 - Pop $0 - Push "N" - Return - -FunctionEnd -!macroend - - -!insertmacro IsWow64_Common "" -; !insertmacro IsWow64_Common "un." +;---------------------------------------------------------------------------- +; 64-bit (WOW64) Detection +;---------------------------------------------------------------------------- + + +!define IsWow64Process "Kernel32::IsWow64Process(i, i) i" + + +!macro IsWow64_Common UN +Function ${UN}IsWow64 + + ; Save $0, $1 + + Push $0 + Push $1 + + ; Set $0 --> Kernel32.IsWow64Process + + System::Get '${IsWow64Process}' + Pop $0 + StrCmp $0 'error' pushzero + + ; Set $R1 --> DWORD + + StrCpy $1 "" + System::Call "*(i) i (0) .r1" + + ; Call IsWow64Process(GetCurrentProcess(), $1) + + System::Call "kernel32::GetCurrentProcess() i .s" + System::Call "${IsWow64Process}(s, r1)" + + ; Set $0 = *(int *)$1 + + System::Call "*$1(&i4 .r0)" + IntCmp $0 0 pushzero + + ; Restore $0, $1 and return with positive result + + Pop $1 + Pop $0 + Push "Y" + Return + +pushzero: + + ; Restore $0, $1 and return with negative result + + Pop $1 + Pop $0 + Push "N" + Return + +FunctionEnd +!macroend + + +!insertmacro IsWow64_Common "" +; !insertmacro IsWow64_Common "un." diff --git a/Sandboxie/install/Registry.nsh b/Sandboxie/install/Registry.nsh index ae501472..6093b8f4 100644 --- a/Sandboxie/install/Registry.nsh +++ b/Sandboxie/install/Registry.nsh @@ -1,736 +1,736 @@ -;---------------------------------------------------------------------------- -; Registry Access, 64-bit Enabled -;---------------------------------------------------------------------------- - -; !define REG_DEBUG - -!verbose push -!verbose 0 - -;---------------------------------------------------------------------------- -; Public Defines -;---------------------------------------------------------------------------- - -!define HKEY_CLASSES_ROOT 0x80000000 -!define HKEY_CURRENT_USER 0x80000001 -!define HKEY_LOCAL_MACHINE 0x80000002 -!define HKEY_USERS 0x80000003 -!define HKEY_PERFORMANCE_DATA 0x80000004 -!define HKEY_PERFORMANCE_TEXT 0x80000050 -!define HKEY_PERFORMANCE_NLSTEXT 0x80000060 -!define HKEY_CURRENT_CONFIG 0x80000005 -!define HKEY_DYN_DATA 0x80000006 - -!define KEY_QUERY_VALUE 0x0001 -!define KEY_SET_VALUE 0x0002 -!define KEY_CREATE_SUB_KEY 0x0004 -!define KEY_ENUMERATE_SUB_KEYS 0x0008 -!define DELETE 0x10000 - -!define REG_NONE 0 -!define REG_SZ 1 -!define REG_EXPAND_SZ 2 -!define REG_BINARY 3 -!define REG_DWORD 4 -!define REG_DWORD_LITTLE_ENDIAN 4 -!define REG_DWORD_BIG_ENDIAN 5 -!define REG_LINK 6 -!define REG_MULTI_SZ 7 - -;---------------------------------------------------------------------------- -; Macro Reg_ReadString -;---------------------------------------------------------------------------- - -!macro Reg_ReadString UN ROOT SUBKEY VALUE - - Push ${VALUE} - Push ${SUBKEY} - Push ${ROOT} - - Call ${UN}Func_ReadRegStr_64 - -!macroend - -;---------------------------------------------------------------------------- -; Macro Reg_WriteString -;---------------------------------------------------------------------------- - -!macro Reg_WriteString UN ROOT SUBKEY VALUE DATA - - Push ${DATA} - Push ${VALUE} - Push ${SUBKEY} - Push ${ROOT} - - Call ${UN}Func_WriteRegStr_64 - -!macroend - -;---------------------------------------------------------------------------- -; Macro Reg_TestKey -;---------------------------------------------------------------------------- - -!macro Reg_TestKey UN ROOT SUBKEY - - Push ${SUBKEY} - Push ${ROOT} - - Call ${UN}Func_TestRegKey_64 - -!macroend - -;---------------------------------------------------------------------------- -; Macro Reg_CreateKey -;---------------------------------------------------------------------------- - -!macro Reg_CreateKey UN ROOT SUBKEY NEWKEY - - Push ${NEWKEY} - Push ${SUBKEY} - Push ${ROOT} - - Call ${UN}Func_CreateRegKey_64 - -!macroend - -;---------------------------------------------------------------------------- -; Macro Reg_DeleteKey -;---------------------------------------------------------------------------- - -!macro Reg_DeleteKey UN ROOT SUBKEY DELKEY - - Push ${DELKEY} - Push ${SUBKEY} - Push ${ROOT} - - Call ${UN}Func_DeleteRegKey_64 - -!macroend - -;---------------------------------------------------------------------------- -; Macro Reg_DeleteValue -;---------------------------------------------------------------------------- - -!macro Reg_DeleteValue UN ROOT SUBKEY VALUE - - Push ${VALUE} - Push ${SUBKEY} - Push ${ROOT} - - Call ${UN}Func_DeleteRegValue_64 - -!macroend - -;---------------------------------------------------------------------------- -; Private Defines -;---------------------------------------------------------------------------- - -!define RegOpenKeyEx "Advapi32::RegOpenKeyExA(i, t, i, i, i) i" -!define RegCreateKeyEx "Advapi32::RegCreateKeyExA(i, t, i, i, i, i, i, i, i) i" -!define RegQueryValueEx "Advapi32::RegQueryValueExA(i, t, i, i, i, i) i" -!define RegSetValueEx "Advapi32::RegSetValueExA(i, t, i, i, t, i) i" -!define RegDeleteKey "Advapi32::RegDeleteKeyA(i, t) i" -!define RegDeleteKeyEx "Advapi32::RegDeleteKeyExA(i, t, i, i) i" -!define RegDeleteValue "Advapi32::RegDeleteValueA(i, t) i" -!define RegCloseKey "Advapi32::RegCloseKey(i) i" - -;---------------------------------------------------------------------------- -; Function Reg_Sam64Key -;---------------------------------------------------------------------------- - -!macro Reg_Sam64Key_Common UN -Function ${UN}Reg_Sam64Key - - Push $0 - - Call ${UN}IsWow64 - Pop $0 - StrCmp $0 'N' pushzero - - Pop $0 - Push 0x100 ; KEY_WOW64_64KEY - Return - -pushzero: - - Pop $0 - Push 0 - Return - -FunctionEnd -!macroend - - -!insertmacro Reg_Sam64Key_Common "" -; !insertmacro Reg_Sam64Key_Common "un." - -;---------------------------------------------------------------------------- -; Function Func_ReadRegStr_64 -;---------------------------------------------------------------------------- - -!macro Func_ReadRegStr_64_Common UN -Function ${UN}Func_ReadRegStr_64 - - ; Pop parameters pushed to the stack by the macro - - Pop $7 ; ROOT - Pop $8 ; SUBKEY - Pop $9 ; VALUE - - ; Push empty string as a default return value - - Push "" - - ; Initialize work registers: - ; Set $0 = 0 - ; Set $1 = 0 - ; Set $3 = "" - - StrCpy $0 "" - StrCpy $1 "" - StrCpy $3 "" - System::Call "*(i) i (0) .r0" - System::Call "*(i) i (0) .r1" - - ; Set $6 = KEY_WOW64_64KEY or zero - - Call ${UN}Reg_Sam64Key - Pop $6 - - ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) - - System::Call "${RegOpenKeyEx}( \ - $7, '$8', 0, ${KEY_QUERY_VALUE}|$6, r0) .r3" - - StrCmp $3 0 open_ok -!ifdef REG_DEBUG - MessageBox MB_OK|MB_ICONSTOP \ - "Can't open registry key for reading $7 $8 ($3)" -!endif - DetailPrint "Can't open registry key for reading $7 $8 ($3)" - SetErrors - Goto done1 - -open_ok: - - ; Set $4 = *(int *)$0 - - System::Call "*$0(&i4 .r4)" - - ; Set $2 = ${NSIS_MAX_STRLEN} - - StrCpy $2 "" - System::Call "*(i) i (${NSIS_MAX_STRLEN}) .r2" - - System::Call "*$2(&i4 .r6)" - - ; Set $6 --> buffer, size $2 bytes - - System::Alloc ${NSIS_MAX_STRLEN} - Pop $6 - - ; Call $3 = RegQueryValueEx($4, VALUE, 0, $1, $6, $2) .r3" - - System::Call "${RegQueryValueEx}(r4, '$9', 0, r1, r6, r2) .r3" - - StrCmp $3 0 read_ok -!ifdef REG_DEBUG - MessageBox MB_OK|MB_ICONSTOP \ - "Can't read registry value $9 in key $7 $8 ($3)" -!endif - DetailPrint "Can't read registry value $9 in key $7 $8 ($3)" - SetErrors - Goto done2 - -read_ok: - - ; Set $3 = *(int *)$1 - - System::Call "*$1(&i4 .r3)" - - StrCmp $3 ${REG_SZ} type_ok - StrCmp $3 ${REG_EXPAND_SZ} type_ok -!ifdef REG_DEBUG - MessageBox MB_OK|MB_ICONSTOP \ - "Registry value $9 in key $7 $8 is not a string" -!endif - DetailPrint "Registry value $9 in key $7 $8 is not a string" - SetErrors - Goto done2 - -type_ok: - - ; Pop the default return value and push the value queried - - Pop $3 - - System::Call "*$6(&t${NSIS_MAX_STRLEN} .r3)" - Push $3 - - ; Indicate Success - - ClearErrors - -done2: - - System::Free $6 - System::Free $2 - - ; call RegCloseKey($4) - - System::Call "${RegCloseKey}(r4)" - -done1: - - System::Free $1 - System::Free $0 - -FunctionEnd -!macroend - - -!insertmacro Func_ReadRegStr_64_Common "" -; !insertmacro Func_ReadRegStr_64_Common "un." - -;---------------------------------------------------------------------------- -; Function Func_WriteRegStr_64 -;---------------------------------------------------------------------------- - -!macro Func_WriteRegStr_64_Common UN -Function ${UN}Func_WriteRegStr_64 - - ; Pop parameters pushed to the stack by the macro - - Pop $7 ; ROOT - Pop $8 ; SUBKEY - Pop $9 ; VALUE - Pop $5 ; DATA - - ; Initialize work registers: - ; Set $0 = 0 - ; Set $1 = 0 - ; Set $3 = "" - - StrCpy $0 "" - StrCpy $1 "" - StrCpy $3 "" - System::Call "*(i) i (0) .r0" - System::Call "*(i) i (0) .r1" - - ; Set $6 = KEY_WOW64_64KEY or zero - - Call ${UN}Reg_Sam64Key - Pop $6 - - ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) - - System::Call "${RegOpenKeyEx}( \ - $7, '$8', 0, ${KEY_SET_VALUE}|$6, r0) .r3" - - StrCmp $3 0 open_ok - MessageBox MB_OK|MB_ICONSTOP \ - "Can't open registry key for writing $7 $8 ($3)" - DetailPrint "Can't open registry key for writing $7 $8 ($3)" - SetErrors - Goto done1 - -open_ok: - - ; Set $4 = *(int *)$0 - - System::Call "*$0(&i4 .r4)" - - ; Set $2 = StrLen(DATA) + 1 - - StrLen $2 '$5' - - IntOp $2 $2 + 1 - - ; Call $3 = RegSetValueEx($4, VALUE, 0, REG_SZ, DATA, $2) .r3" - - System::Call "${RegSetValueEx}( \ - r4, '$9', 0, ${REG_SZ}, '$5', $2) .r3" - - StrCmp $3 0 write_ok - MessageBox MB_OK|MB_ICONSTOP \ - "Can't write registry value $9 in key $7 $8 ($3)" - DetailPrint "Can't write registry value $9 in key $7 $8 ($3)" - SetErrors - Goto done2 - -write_ok: - - ; Indicate Success - - DetailPrint "Created registry value $9 in key $8" - - ClearErrors - -done2: - - ; call RegCloseKey($4) - - System::Call "${RegCloseKey}(r4)" - -done1: - - System::Free $1 - System::Free $0 - -FunctionEnd -!macroend - - -!insertmacro Func_WriteRegStr_64_Common "" -; !insertmacro Func_WriteRegStr_64_Common "un." - -;---------------------------------------------------------------------------- -; Function Func_TestRegKey_64 -;---------------------------------------------------------------------------- - -!macro Func_TestRegKey_64_Common UN -Function ${UN}Func_TestRegKey_64 - - ; Pop parameters pushed to the stack by the macro - - Pop $7 ; ROOT - Pop $8 ; SUBKEY - - ; Initialize work registers: - ; Set $0 = 0 - ; Set $3 = "" - - StrCpy $0 "" - StrCpy $3 "" - System::Call "*(i) i (0) .r0" - - ; Set $6 = KEY_WOW64_64KEY or zero - - Call ${UN}Reg_Sam64Key - Pop $6 - - ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) - - System::Call "${RegOpenKeyEx}( \ - $7, '$8', 0, ${KEY_CREATE_SUB_KEY}|$6, r0) .r3" - - StrCmp $3 0 open_ok - - ; Push error return value - - Push "0" - - Goto done - -open_ok: - - ; Set $4 = *(int *)$0 - - System::Call "*$0(&i4 .r4)" - - ; RegCloseKey($4) - - System::Call "${RegCloseKey}(r4)" - - ; Push success return value - - Push "1" - -done: - - System::Free $0 - -FunctionEnd -!macroend - - -!insertmacro Func_TestRegKey_64_Common "" -; !insertmacro Func_TestRegKey_64_Common "un." - -;---------------------------------------------------------------------------- -; Function Func_CreateRegKey_64 -;---------------------------------------------------------------------------- - -!macro Func_CreateRegKey_64_Common UN -Function ${UN}Func_CreateRegKey_64 - - ; Pop parameters pushed to the stack by the macro - - Pop $7 ; ROOT - Pop $8 ; SUBKEY - Pop $9 ; NEWKEY - - ; Initialize work registers: - ; Set $0 = 0 - ; Set $1 = 0 - ; Set $3 = "" - - StrCpy $0 "" - StrCpy $1 "" - StrCpy $3 "" - System::Call "*(i) i (0) .r0" - System::Call "*(i) i (0) .r1" - - ; Set $6 = KEY_WOW64_64KEY or zero - - Call ${UN}Reg_Sam64Key - Pop $6 - - ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) - - System::Call "${RegOpenKeyEx}( \ - $7, '$8', 0, ${KEY_CREATE_SUB_KEY}|$6, r0) .r3" - - StrCmp $3 0 open_ok - MessageBox MB_OK|MB_ICONSTOP \ - "Can't open registry key for create $7 $8 ($3)" - DetailPrint "Can't open registry key for create $7 $8 ($3)" - SetErrors - Goto done1 - -open_ok: - - ; Set $4 = *(int *)$0 - - System::Call "*$0(&i4 .r4)" - - ; Call $3 = RegCreateKeyEx($4, NEWKEY, 0, 0, 0, (sam | $6), 0, $1, 0) - - System::Call "${RegCreateKeyEx}( \ - $4, '$9', 0, 0, 0, \ - ${KEY_SET_VALUE}|${KEY_CREATE_SUB_KEY}|$6, \ - 0, r1, 0) .r3" - - StrCmp $3 0 create_ok - MessageBox MB_OK|MB_ICONSTOP \ - "Can't create registry key $7 $8 $9 ($3)" - DetailPrint "Can't create registry key $7 $8 $9 ($3)" - SetErrors - Goto done2 - -create_ok: - - ; Set $5 = *(int *)$1 - - System::Call "*$1(&i4 .r5)" - - ; RegCloseKey($5) - - System::Call "${RegCloseKey}(r5)" - - ; Indicate Success - - DetailPrint "Created registry key $8\$9" - - ClearErrors - -done2: - - ; RegCloseKey($4) - - System::Call "${RegCloseKey}(r4)" - -done1: - - System::Free $1 - System::Free $0 - -FunctionEnd -!macroend - - -!insertmacro Func_CreateRegKey_64_Common "" -; !insertmacro Func_CreateRegKey_64_Common "un." - -;---------------------------------------------------------------------------- -; Function Func_DeleteRegKey_64 -;---------------------------------------------------------------------------- - -!macro Func_DeleteRegKey_64_Common UN -Function ${UN}Func_DeleteRegKey_64 - - ; Pop parameters pushed to the stack by the macro - - Pop $7 ; ROOT - Pop $8 ; SUBKEY - Pop $9 ; DELKEY - - ; Initialize work registers: - ; Set $0 = 0 - ; Set $1 = 0 - ; Set $3 = "" - - StrCpy $0 "" - StrCpy $1 "" - StrCpy $3 "" - System::Call "*(i) i (0) .r0" - System::Call "*(i) i (0) .r1" - - ; Set $6 = KEY_WOW64_64KEY or zero - - Call ${UN}Reg_Sam64Key - Pop $6 - - ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) - - System::Call "${RegOpenKeyEx}( \ - $7, '$8', 0, ${DELETE}|$6, r0) .r3" - - StrCmp $3 0 open_ok -!ifdef REG_DEBUG - MessageBox MB_OK|MB_ICONSTOP \ - "Can't open registry key for delete $7 $8 ($3)" -!endif - DetailPrint "Can't open registry key for delete $7 $8 ($3)" - SetErrors - Goto done1 - -open_ok: - - ; Set $4 = *(int *)$0 - - System::Call "*$0(&i4 .r4)" - - ; Use RegDeleteKeyEx on amd64, RegDeleteKey on i386 - - StrCmp $6 "0" delete_i386 - - ; Call $3 = RegDeleteKeyEx($4, DELKEY, (sam | $6), 0) - - System::Call "${RegDeleteKeyEx}($4, '$9', $6, 0) .r3" - Goto delete_cont - -delete_i386: - - ; Call $3 = RegDeleteKey($4, DELKEY) - - System::Call "${RegDeleteKey}($4, '$9') .r3" - -delete_cont: - - StrCmp $3 0 delete_ok -!ifdef REG_DEBUG - MessageBox MB_OK|MB_ICONSTOP \ - "Can't delete registry key $7 $8 $9 ($3)" -!endif - DetailPrint "Can't delete registry key $7 $8 $9 ($3)" - SetErrors - Goto done2 - -delete_ok: - - ; Indicate Success - - DetailPrint "Deleted registry key $8\$9" - - ClearErrors - -done2: - - ; RegCloseKey($4) - - System::Call "${RegCloseKey}(r4)" - -done1: - - System::Free $1 - System::Free $0 - -FunctionEnd -!macroend - - -!insertmacro Func_DeleteRegKey_64_Common "" -; !insertmacro Func_DeleteRegKey_64_Common "un." - -;---------------------------------------------------------------------------- -; Function Func_DeleteRegValue_64 -;---------------------------------------------------------------------------- - -!macro Func_DeleteRegValue_64_Common UN -Function ${UN}Func_DeleteRegValue_64 - - ; Pop parameters pushed to the stack by the macro - - Pop $7 ; ROOT - Pop $8 ; SUBKEY - Pop $9 ; VALUE - - ; Initialize work registers: - ; Set $0 = 0 - ; Set $1 = 0 - ; Set $3 = "" - - StrCpy $0 "" - StrCpy $1 "" - StrCpy $3 "" - System::Call "*(i) i (0) .r0" - System::Call "*(i) i (0) .r1" - - ; Set $6 = KEY_WOW64_64KEY or zero - - Call ${UN}Reg_Sam64Key - Pop $6 - - ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) - - System::Call "${RegOpenKeyEx}( \ - $7, '$8', 0, ${KEY_SET_VALUE}|$6, r0) .r3" - - StrCmp $3 0 open_ok -!ifdef REG_DEBUG - MessageBox MB_OK|MB_ICONSTOP \ - "Can't open registry key for value delete $7 $8 ($3)" -!endif - DetailPrint "Can't open registry key for value delete $7 $8 ($3)" - SetErrors - Goto done1 - -open_ok: - - ; Set $4 = *(int *)$0 - - System::Call "*$0(&i4 .r4)" - - ; Call $3 = RegDeleteValue($4, VALUE) - - System::Call "${RegDeleteValue}($4, '$9') .r3" - - StrCmp $3 0 delete_ok -!ifdef REG_DEBUG - MessageBox MB_OK|MB_ICONSTOP \ - "Can't delete registry value $7 $8 $9 ($3)" -!endif - DetailPrint "Can't delete registry value $7 $8 $9 ($3)" - SetErrors - Goto done2 - -delete_ok: - - ; Indicate Success - - DetailPrint "Deleted registry value $9 in key $8" - - ClearErrors - -done2: - - ; RegCloseKey($4) - - System::Call "${RegCloseKey}(r4)" - -done1: - - System::Free $1 - System::Free $0 - -FunctionEnd -!macroend - - -!insertmacro Func_DeleteRegValue_64_Common "" -; !insertmacro Func_DeleteRegValue_64_Common "un." - -;---------------------------------------------------------------------------- - -!verbose pop +;---------------------------------------------------------------------------- +; Registry Access, 64-bit Enabled +;---------------------------------------------------------------------------- + +; !define REG_DEBUG + +!verbose push +!verbose 0 + +;---------------------------------------------------------------------------- +; Public Defines +;---------------------------------------------------------------------------- + +!define HKEY_CLASSES_ROOT 0x80000000 +!define HKEY_CURRENT_USER 0x80000001 +!define HKEY_LOCAL_MACHINE 0x80000002 +!define HKEY_USERS 0x80000003 +!define HKEY_PERFORMANCE_DATA 0x80000004 +!define HKEY_PERFORMANCE_TEXT 0x80000050 +!define HKEY_PERFORMANCE_NLSTEXT 0x80000060 +!define HKEY_CURRENT_CONFIG 0x80000005 +!define HKEY_DYN_DATA 0x80000006 + +!define KEY_QUERY_VALUE 0x0001 +!define KEY_SET_VALUE 0x0002 +!define KEY_CREATE_SUB_KEY 0x0004 +!define KEY_ENUMERATE_SUB_KEYS 0x0008 +!define DELETE 0x10000 + +!define REG_NONE 0 +!define REG_SZ 1 +!define REG_EXPAND_SZ 2 +!define REG_BINARY 3 +!define REG_DWORD 4 +!define REG_DWORD_LITTLE_ENDIAN 4 +!define REG_DWORD_BIG_ENDIAN 5 +!define REG_LINK 6 +!define REG_MULTI_SZ 7 + +;---------------------------------------------------------------------------- +; Macro Reg_ReadString +;---------------------------------------------------------------------------- + +!macro Reg_ReadString UN ROOT SUBKEY VALUE + + Push ${VALUE} + Push ${SUBKEY} + Push ${ROOT} + + Call ${UN}Func_ReadRegStr_64 + +!macroend + +;---------------------------------------------------------------------------- +; Macro Reg_WriteString +;---------------------------------------------------------------------------- + +!macro Reg_WriteString UN ROOT SUBKEY VALUE DATA + + Push ${DATA} + Push ${VALUE} + Push ${SUBKEY} + Push ${ROOT} + + Call ${UN}Func_WriteRegStr_64 + +!macroend + +;---------------------------------------------------------------------------- +; Macro Reg_TestKey +;---------------------------------------------------------------------------- + +!macro Reg_TestKey UN ROOT SUBKEY + + Push ${SUBKEY} + Push ${ROOT} + + Call ${UN}Func_TestRegKey_64 + +!macroend + +;---------------------------------------------------------------------------- +; Macro Reg_CreateKey +;---------------------------------------------------------------------------- + +!macro Reg_CreateKey UN ROOT SUBKEY NEWKEY + + Push ${NEWKEY} + Push ${SUBKEY} + Push ${ROOT} + + Call ${UN}Func_CreateRegKey_64 + +!macroend + +;---------------------------------------------------------------------------- +; Macro Reg_DeleteKey +;---------------------------------------------------------------------------- + +!macro Reg_DeleteKey UN ROOT SUBKEY DELKEY + + Push ${DELKEY} + Push ${SUBKEY} + Push ${ROOT} + + Call ${UN}Func_DeleteRegKey_64 + +!macroend + +;---------------------------------------------------------------------------- +; Macro Reg_DeleteValue +;---------------------------------------------------------------------------- + +!macro Reg_DeleteValue UN ROOT SUBKEY VALUE + + Push ${VALUE} + Push ${SUBKEY} + Push ${ROOT} + + Call ${UN}Func_DeleteRegValue_64 + +!macroend + +;---------------------------------------------------------------------------- +; Private Defines +;---------------------------------------------------------------------------- + +!define RegOpenKeyEx "Advapi32::RegOpenKeyExA(i, t, i, i, i) i" +!define RegCreateKeyEx "Advapi32::RegCreateKeyExA(i, t, i, i, i, i, i, i, i) i" +!define RegQueryValueEx "Advapi32::RegQueryValueExA(i, t, i, i, i, i) i" +!define RegSetValueEx "Advapi32::RegSetValueExA(i, t, i, i, t, i) i" +!define RegDeleteKey "Advapi32::RegDeleteKeyA(i, t) i" +!define RegDeleteKeyEx "Advapi32::RegDeleteKeyExA(i, t, i, i) i" +!define RegDeleteValue "Advapi32::RegDeleteValueA(i, t) i" +!define RegCloseKey "Advapi32::RegCloseKey(i) i" + +;---------------------------------------------------------------------------- +; Function Reg_Sam64Key +;---------------------------------------------------------------------------- + +!macro Reg_Sam64Key_Common UN +Function ${UN}Reg_Sam64Key + + Push $0 + + Call ${UN}IsWow64 + Pop $0 + StrCmp $0 'N' pushzero + + Pop $0 + Push 0x100 ; KEY_WOW64_64KEY + Return + +pushzero: + + Pop $0 + Push 0 + Return + +FunctionEnd +!macroend + + +!insertmacro Reg_Sam64Key_Common "" +; !insertmacro Reg_Sam64Key_Common "un." + +;---------------------------------------------------------------------------- +; Function Func_ReadRegStr_64 +;---------------------------------------------------------------------------- + +!macro Func_ReadRegStr_64_Common UN +Function ${UN}Func_ReadRegStr_64 + + ; Pop parameters pushed to the stack by the macro + + Pop $7 ; ROOT + Pop $8 ; SUBKEY + Pop $9 ; VALUE + + ; Push empty string as a default return value + + Push "" + + ; Initialize work registers: + ; Set $0 = 0 + ; Set $1 = 0 + ; Set $3 = "" + + StrCpy $0 "" + StrCpy $1 "" + StrCpy $3 "" + System::Call "*(i) i (0) .r0" + System::Call "*(i) i (0) .r1" + + ; Set $6 = KEY_WOW64_64KEY or zero + + Call ${UN}Reg_Sam64Key + Pop $6 + + ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) + + System::Call "${RegOpenKeyEx}( \ + $7, '$8', 0, ${KEY_QUERY_VALUE}|$6, r0) .r3" + + StrCmp $3 0 open_ok +!ifdef REG_DEBUG + MessageBox MB_OK|MB_ICONSTOP \ + "Can't open registry key for reading $7 $8 ($3)" +!endif + DetailPrint "Can't open registry key for reading $7 $8 ($3)" + SetErrors + Goto done1 + +open_ok: + + ; Set $4 = *(int *)$0 + + System::Call "*$0(&i4 .r4)" + + ; Set $2 = ${NSIS_MAX_STRLEN} + + StrCpy $2 "" + System::Call "*(i) i (${NSIS_MAX_STRLEN}) .r2" + + System::Call "*$2(&i4 .r6)" + + ; Set $6 --> buffer, size $2 bytes + + System::Alloc ${NSIS_MAX_STRLEN} + Pop $6 + + ; Call $3 = RegQueryValueEx($4, VALUE, 0, $1, $6, $2) .r3" + + System::Call "${RegQueryValueEx}(r4, '$9', 0, r1, r6, r2) .r3" + + StrCmp $3 0 read_ok +!ifdef REG_DEBUG + MessageBox MB_OK|MB_ICONSTOP \ + "Can't read registry value $9 in key $7 $8 ($3)" +!endif + DetailPrint "Can't read registry value $9 in key $7 $8 ($3)" + SetErrors + Goto done2 + +read_ok: + + ; Set $3 = *(int *)$1 + + System::Call "*$1(&i4 .r3)" + + StrCmp $3 ${REG_SZ} type_ok + StrCmp $3 ${REG_EXPAND_SZ} type_ok +!ifdef REG_DEBUG + MessageBox MB_OK|MB_ICONSTOP \ + "Registry value $9 in key $7 $8 is not a string" +!endif + DetailPrint "Registry value $9 in key $7 $8 is not a string" + SetErrors + Goto done2 + +type_ok: + + ; Pop the default return value and push the value queried + + Pop $3 + + System::Call "*$6(&t${NSIS_MAX_STRLEN} .r3)" + Push $3 + + ; Indicate Success + + ClearErrors + +done2: + + System::Free $6 + System::Free $2 + + ; call RegCloseKey($4) + + System::Call "${RegCloseKey}(r4)" + +done1: + + System::Free $1 + System::Free $0 + +FunctionEnd +!macroend + + +!insertmacro Func_ReadRegStr_64_Common "" +; !insertmacro Func_ReadRegStr_64_Common "un." + +;---------------------------------------------------------------------------- +; Function Func_WriteRegStr_64 +;---------------------------------------------------------------------------- + +!macro Func_WriteRegStr_64_Common UN +Function ${UN}Func_WriteRegStr_64 + + ; Pop parameters pushed to the stack by the macro + + Pop $7 ; ROOT + Pop $8 ; SUBKEY + Pop $9 ; VALUE + Pop $5 ; DATA + + ; Initialize work registers: + ; Set $0 = 0 + ; Set $1 = 0 + ; Set $3 = "" + + StrCpy $0 "" + StrCpy $1 "" + StrCpy $3 "" + System::Call "*(i) i (0) .r0" + System::Call "*(i) i (0) .r1" + + ; Set $6 = KEY_WOW64_64KEY or zero + + Call ${UN}Reg_Sam64Key + Pop $6 + + ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) + + System::Call "${RegOpenKeyEx}( \ + $7, '$8', 0, ${KEY_SET_VALUE}|$6, r0) .r3" + + StrCmp $3 0 open_ok + MessageBox MB_OK|MB_ICONSTOP \ + "Can't open registry key for writing $7 $8 ($3)" + DetailPrint "Can't open registry key for writing $7 $8 ($3)" + SetErrors + Goto done1 + +open_ok: + + ; Set $4 = *(int *)$0 + + System::Call "*$0(&i4 .r4)" + + ; Set $2 = StrLen(DATA) + 1 + + StrLen $2 '$5' + + IntOp $2 $2 + 1 + + ; Call $3 = RegSetValueEx($4, VALUE, 0, REG_SZ, DATA, $2) .r3" + + System::Call "${RegSetValueEx}( \ + r4, '$9', 0, ${REG_SZ}, '$5', $2) .r3" + + StrCmp $3 0 write_ok + MessageBox MB_OK|MB_ICONSTOP \ + "Can't write registry value $9 in key $7 $8 ($3)" + DetailPrint "Can't write registry value $9 in key $7 $8 ($3)" + SetErrors + Goto done2 + +write_ok: + + ; Indicate Success + + DetailPrint "Created registry value $9 in key $8" + + ClearErrors + +done2: + + ; call RegCloseKey($4) + + System::Call "${RegCloseKey}(r4)" + +done1: + + System::Free $1 + System::Free $0 + +FunctionEnd +!macroend + + +!insertmacro Func_WriteRegStr_64_Common "" +; !insertmacro Func_WriteRegStr_64_Common "un." + +;---------------------------------------------------------------------------- +; Function Func_TestRegKey_64 +;---------------------------------------------------------------------------- + +!macro Func_TestRegKey_64_Common UN +Function ${UN}Func_TestRegKey_64 + + ; Pop parameters pushed to the stack by the macro + + Pop $7 ; ROOT + Pop $8 ; SUBKEY + + ; Initialize work registers: + ; Set $0 = 0 + ; Set $3 = "" + + StrCpy $0 "" + StrCpy $3 "" + System::Call "*(i) i (0) .r0" + + ; Set $6 = KEY_WOW64_64KEY or zero + + Call ${UN}Reg_Sam64Key + Pop $6 + + ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) + + System::Call "${RegOpenKeyEx}( \ + $7, '$8', 0, ${KEY_CREATE_SUB_KEY}|$6, r0) .r3" + + StrCmp $3 0 open_ok + + ; Push error return value + + Push "0" + + Goto done + +open_ok: + + ; Set $4 = *(int *)$0 + + System::Call "*$0(&i4 .r4)" + + ; RegCloseKey($4) + + System::Call "${RegCloseKey}(r4)" + + ; Push success return value + + Push "1" + +done: + + System::Free $0 + +FunctionEnd +!macroend + + +!insertmacro Func_TestRegKey_64_Common "" +; !insertmacro Func_TestRegKey_64_Common "un." + +;---------------------------------------------------------------------------- +; Function Func_CreateRegKey_64 +;---------------------------------------------------------------------------- + +!macro Func_CreateRegKey_64_Common UN +Function ${UN}Func_CreateRegKey_64 + + ; Pop parameters pushed to the stack by the macro + + Pop $7 ; ROOT + Pop $8 ; SUBKEY + Pop $9 ; NEWKEY + + ; Initialize work registers: + ; Set $0 = 0 + ; Set $1 = 0 + ; Set $3 = "" + + StrCpy $0 "" + StrCpy $1 "" + StrCpy $3 "" + System::Call "*(i) i (0) .r0" + System::Call "*(i) i (0) .r1" + + ; Set $6 = KEY_WOW64_64KEY or zero + + Call ${UN}Reg_Sam64Key + Pop $6 + + ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) + + System::Call "${RegOpenKeyEx}( \ + $7, '$8', 0, ${KEY_CREATE_SUB_KEY}|$6, r0) .r3" + + StrCmp $3 0 open_ok + MessageBox MB_OK|MB_ICONSTOP \ + "Can't open registry key for create $7 $8 ($3)" + DetailPrint "Can't open registry key for create $7 $8 ($3)" + SetErrors + Goto done1 + +open_ok: + + ; Set $4 = *(int *)$0 + + System::Call "*$0(&i4 .r4)" + + ; Call $3 = RegCreateKeyEx($4, NEWKEY, 0, 0, 0, (sam | $6), 0, $1, 0) + + System::Call "${RegCreateKeyEx}( \ + $4, '$9', 0, 0, 0, \ + ${KEY_SET_VALUE}|${KEY_CREATE_SUB_KEY}|$6, \ + 0, r1, 0) .r3" + + StrCmp $3 0 create_ok + MessageBox MB_OK|MB_ICONSTOP \ + "Can't create registry key $7 $8 $9 ($3)" + DetailPrint "Can't create registry key $7 $8 $9 ($3)" + SetErrors + Goto done2 + +create_ok: + + ; Set $5 = *(int *)$1 + + System::Call "*$1(&i4 .r5)" + + ; RegCloseKey($5) + + System::Call "${RegCloseKey}(r5)" + + ; Indicate Success + + DetailPrint "Created registry key $8\$9" + + ClearErrors + +done2: + + ; RegCloseKey($4) + + System::Call "${RegCloseKey}(r4)" + +done1: + + System::Free $1 + System::Free $0 + +FunctionEnd +!macroend + + +!insertmacro Func_CreateRegKey_64_Common "" +; !insertmacro Func_CreateRegKey_64_Common "un." + +;---------------------------------------------------------------------------- +; Function Func_DeleteRegKey_64 +;---------------------------------------------------------------------------- + +!macro Func_DeleteRegKey_64_Common UN +Function ${UN}Func_DeleteRegKey_64 + + ; Pop parameters pushed to the stack by the macro + + Pop $7 ; ROOT + Pop $8 ; SUBKEY + Pop $9 ; DELKEY + + ; Initialize work registers: + ; Set $0 = 0 + ; Set $1 = 0 + ; Set $3 = "" + + StrCpy $0 "" + StrCpy $1 "" + StrCpy $3 "" + System::Call "*(i) i (0) .r0" + System::Call "*(i) i (0) .r1" + + ; Set $6 = KEY_WOW64_64KEY or zero + + Call ${UN}Reg_Sam64Key + Pop $6 + + ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) + + System::Call "${RegOpenKeyEx}( \ + $7, '$8', 0, ${DELETE}|$6, r0) .r3" + + StrCmp $3 0 open_ok +!ifdef REG_DEBUG + MessageBox MB_OK|MB_ICONSTOP \ + "Can't open registry key for delete $7 $8 ($3)" +!endif + DetailPrint "Can't open registry key for delete $7 $8 ($3)" + SetErrors + Goto done1 + +open_ok: + + ; Set $4 = *(int *)$0 + + System::Call "*$0(&i4 .r4)" + + ; Use RegDeleteKeyEx on amd64, RegDeleteKey on i386 + + StrCmp $6 "0" delete_i386 + + ; Call $3 = RegDeleteKeyEx($4, DELKEY, (sam | $6), 0) + + System::Call "${RegDeleteKeyEx}($4, '$9', $6, 0) .r3" + Goto delete_cont + +delete_i386: + + ; Call $3 = RegDeleteKey($4, DELKEY) + + System::Call "${RegDeleteKey}($4, '$9') .r3" + +delete_cont: + + StrCmp $3 0 delete_ok +!ifdef REG_DEBUG + MessageBox MB_OK|MB_ICONSTOP \ + "Can't delete registry key $7 $8 $9 ($3)" +!endif + DetailPrint "Can't delete registry key $7 $8 $9 ($3)" + SetErrors + Goto done2 + +delete_ok: + + ; Indicate Success + + DetailPrint "Deleted registry key $8\$9" + + ClearErrors + +done2: + + ; RegCloseKey($4) + + System::Call "${RegCloseKey}(r4)" + +done1: + + System::Free $1 + System::Free $0 + +FunctionEnd +!macroend + + +!insertmacro Func_DeleteRegKey_64_Common "" +; !insertmacro Func_DeleteRegKey_64_Common "un." + +;---------------------------------------------------------------------------- +; Function Func_DeleteRegValue_64 +;---------------------------------------------------------------------------- + +!macro Func_DeleteRegValue_64_Common UN +Function ${UN}Func_DeleteRegValue_64 + + ; Pop parameters pushed to the stack by the macro + + Pop $7 ; ROOT + Pop $8 ; SUBKEY + Pop $9 ; VALUE + + ; Initialize work registers: + ; Set $0 = 0 + ; Set $1 = 0 + ; Set $3 = "" + + StrCpy $0 "" + StrCpy $1 "" + StrCpy $3 "" + System::Call "*(i) i (0) .r0" + System::Call "*(i) i (0) .r1" + + ; Set $6 = KEY_WOW64_64KEY or zero + + Call ${UN}Reg_Sam64Key + Pop $6 + + ; Call $3 = RegOpenKeyEx(ROOT, SUBKEY, 0, (sam | $6), $0) + + System::Call "${RegOpenKeyEx}( \ + $7, '$8', 0, ${KEY_SET_VALUE}|$6, r0) .r3" + + StrCmp $3 0 open_ok +!ifdef REG_DEBUG + MessageBox MB_OK|MB_ICONSTOP \ + "Can't open registry key for value delete $7 $8 ($3)" +!endif + DetailPrint "Can't open registry key for value delete $7 $8 ($3)" + SetErrors + Goto done1 + +open_ok: + + ; Set $4 = *(int *)$0 + + System::Call "*$0(&i4 .r4)" + + ; Call $3 = RegDeleteValue($4, VALUE) + + System::Call "${RegDeleteValue}($4, '$9') .r3" + + StrCmp $3 0 delete_ok +!ifdef REG_DEBUG + MessageBox MB_OK|MB_ICONSTOP \ + "Can't delete registry value $7 $8 $9 ($3)" +!endif + DetailPrint "Can't delete registry value $7 $8 $9 ($3)" + SetErrors + Goto done2 + +delete_ok: + + ; Indicate Success + + DetailPrint "Deleted registry value $9 in key $8" + + ClearErrors + +done2: + + ; RegCloseKey($4) + + System::Call "${RegCloseKey}(r4)" + +done1: + + System::Free $1 + System::Free $0 + +FunctionEnd +!macroend + + +!insertmacro Func_DeleteRegValue_64_Common "" +; !insertmacro Func_DeleteRegValue_64_Common "un." + +;---------------------------------------------------------------------------- + +!verbose pop diff --git a/Sandboxie/install/SandboxieVS.nsi b/Sandboxie/install/SandboxieVS.nsi index 9d26b64b..e2a0eb1b 100644 --- a/Sandboxie/install/SandboxieVS.nsi +++ b/Sandboxie/install/SandboxieVS.nsi @@ -1,1629 +1,1629 @@ -;---------------------------------------------------------------------------- -; Sandboxie Installer -;---------------------------------------------------------------------------- - -SetCompressor /SOLID /FINAL lzma - -!include "MUI.nsh" -!include "IsWow64.nsh" -!include "Registry.nsh" -!include "Cmdline.nsh" -!include "IsAdmin.nsh" -!include "Library.nsh" -!include "WordFunc.nsh" - -;---------------------------------------------------------------------------- -; Extract Information from my_version.h -;---------------------------------------------------------------------------- - -!tempfile TMPVERFILE -!system 'ParseVersion.bat "..\common\my_version.h" "${TMPVERFILE}"' -!include "${TMPVERFILE}" -!delfile "${TMPVERFILE}" -!undef TMPVERFILE - -;---------------------------------------------------------------------------- -; Global Defines -;---------------------------------------------------------------------------- -; these are the build-time config settings. Need to be cmd line args or something better. -; pick either 32 or 64 bit -;!define _BUILDARCH Win32 -;!define _BUILDARCH x64 -!define _BUILDARCH "$%SBIE_BUILDARCH%" - - -; uncomment this line if you want to make the special versions that download VC Redist -;!define INCLUDE_VCREDIST_DNLD - -!define BIN_ROOT_BASE "${SBIE_INSTALLER_PATH}" - -;!if "${_BUILDARCH}" == "x64" -; !define _W7DRV_COMPAT "$%SbieVer%.x64" -;!else -; !define _W7DRV_COMPAT "$%SbieVer%.x86" -;!endif - -;!define SBIEDRV_SYS4 "${SBIEDRV_SYS}.rc4" -;!define SBIEDRV_SYSX "${SBIEDRV_SYS}.w10" - -!define OUTFILE_BOTH "${PRODUCT_NAME}Install.exe" -!define NAME_Win32 "${PRODUCT_FULL_NAME} ${VERSION} (32-bit)" -!ifdef INCLUDE_VCREDIST_DNLD -!define OUTFILE_Win32 "${PRODUCT_NAME}Install32_VCRedist.exe" -!else -!define OUTFILE_Win32 "${PRODUCT_NAME}Install32.exe" -!endif -!define ARCH_Win32 "Win32" -!define BIN_ROOT_Win32 "${BIN_ROOT_BASE}\Win32\SbieRelease" - -!define NAME_x64 "${PRODUCT_FULL_NAME} ${VERSION} (64-bit)" -!ifdef INCLUDE_VCREDIST_DNLD -!define OUTFILE_x64 "${PRODUCT_NAME}Install64_VCRedist.exe" -!else -!define OUTFILE_x64 "${PRODUCT_NAME}Install64.exe" -!endif -!define ARCH_x64 "x64" -!define BIN_ROOT_x64 "${BIN_ROOT_BASE}\x64\SbieRelease" - -!define ARCH ${ARCH_${_BUILDARCH}} -!define BIN_ROOT ${BIN_ROOT_${_BUILDARCH}} - -!define VCRedist64SrcLocation "..\Build\Support\x64\vcredist_x64.exe" -!define VCRedist32SrcLocation "..\Build\Support\vcredist_x86.exe" - -Section binroot -DetailPrint "binary root ${BIN_ROOT}" -SectionEnd - -Name "${NAME_${_BUILDARCH}}" - -OutFile "${BIN_ROOT}\..\${OUTFILE_${_BUILDARCH}}" - -InstallDir "(na)" - -SpaceTexts "none" - -ShowInstDetails nevershow - -RequestExecutionLevel admin - -;---------------------------------------------------------------------------- -; -;---------------------------------------------------------------------------- - -VIProductVersion "${VERSION}.0.0" - -VIAddVersionKey "ProductName" "${PRODUCT_FULL_NAME}" -VIAddVersionKey "CompanyName" "${COMPANY_NAME}" -VIAddVersionKey "LegalCopyright" "${COPYRIGHT_STRING}" -VIAddVersionKey "FileDescription" "${PRODUCT_NAME} Installer" -VIAddVersionKey "FileVersion" "${VERSION}" -VIAddVersionKey "ProductVersion" "${VERSION}" - -;---------------------------------------------------------------------------- -; Pages -;---------------------------------------------------------------------------- - -!define MUI_ICON "..\apps\res\sandbox-full.ico" - -!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipLicensePage" -!insertmacro MUI_PAGE_LICENSE "LICENSE.TXT" - -Page custom InstallTypePage -!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipDirectoryPage" -!insertmacro MUI_PAGE_DIRECTORY - -!define MUI_PAGE_CUSTOMFUNCTION_SHOW "SetHeaderForRemove" -!insertmacro MUI_PAGE_INSTFILES - -Page custom DriverPage - -!define MUI_FINISHPAGE_NOAUTOCLOSE -!define MUI_PAGE_CUSTOMFUNCTION_PRE "DisableBackButton" -!define MUI_FINISHPAGE_TITLE_3LINES -!insertmacro MUI_PAGE_FINISH - -;---------------------------------------------------------------------------- -; Languages -;---------------------------------------------------------------------------- - -!insertmacro MUI_LANGUAGE "English" -!insertmacro MUI_LANGUAGE "Albanian" -!insertmacro MUI_LANGUAGE "Arabic" -!insertmacro MUI_LANGUAGE "Bulgarian" -!insertmacro MUI_LANGUAGE "SimpChinese" -!insertmacro MUI_LANGUAGE "TradChinese" -!insertmacro MUI_LANGUAGE "Croatian" -!insertmacro MUI_LANGUAGE "Czech" -!insertmacro MUI_LANGUAGE "Danish" -!insertmacro MUI_LANGUAGE "Dutch" -!insertmacro MUI_LANGUAGE "Estonian" -!insertmacro MUI_LANGUAGE "Farsi" -!insertmacro MUI_LANGUAGE "Finnish" -!insertmacro MUI_LANGUAGE "French" -!insertmacro MUI_LANGUAGE "German" -!insertmacro MUI_LANGUAGE "Greek" -!insertmacro MUI_LANGUAGE "Hebrew" -!insertmacro MUI_LANGUAGE "Hungarian" -!insertmacro MUI_LANGUAGE "Italian" -!insertmacro MUI_LANGUAGE "Indonesian" -!insertmacro MUI_LANGUAGE "Japanese" -!insertmacro MUI_LANGUAGE "Korean" -!insertmacro MUI_LANGUAGE "Macedonian" -!insertmacro MUI_LANGUAGE "Polish" -!insertmacro MUI_LANGUAGE "PortugueseBr" -!insertmacro MUI_LANGUAGE "Portuguese" -!insertmacro MUI_LANGUAGE "Russian" -!insertmacro MUI_LANGUAGE "Slovak" -!insertmacro MUI_LANGUAGE "Spanish" -!insertmacro MUI_LANGUAGE "Swedish" -!insertmacro MUI_LANGUAGE "Turkish" -!insertmacro MUI_LANGUAGE "Ukrainian" - -;!insertmacro MUI_LANGUAGE "Norwegian" -;!include "MyItalian.nlf" - -!macro MyLanguage MYLANG MYCP - !system "..\tools\iconv\iconv -f UTF-16 -t ${MYCP} ..\msgs\SbieRelease\NsisText_${MYLANG}.txt > ansi-My${MYLANG}.nlf" - !include "ansi-My${MYLANG}.nlf" - !delfile "ansi-My${MYLANG}.nlf" - -!macroend - -!insertmacro MyLanguage "English" LATIN1 -!insertmacro MyLanguage "Albanian" LATIN1 -!insertmacro MyLanguage "Arabic" CP1256 -!insertmacro MyLanguage "Bulgarian" CP1251 -!insertmacro MyLanguage "SimpChinese" CP936 -!insertmacro MyLanguage "TradChinese" CP950 -!insertmacro MyLanguage "Croatian" CP1250 -!insertmacro MyLanguage "Czech" CP1250 -!insertmacro MyLanguage "Danish" CP865 -!insertmacro MyLanguage "Dutch" LATIN1 -!insertmacro MyLanguage "Estonian" LATIN1 -!insertmacro MyLanguage "Farsi" CP1256 -!insertmacro MyLanguage "Finnish" LATIN1 -!insertmacro MyLanguage "French" LATIN1 -!insertmacro MyLanguage "German" LATIN1 -!insertmacro MyLanguage "Greek" CP1253 -!insertmacro MyLanguage "Hebrew" CP1255 -!insertmacro MyLanguage "Hungarian" CP1250 -!insertmacro MyLanguage "Italian" LATIN1 -!insertmacro MyLanguage "Indonesian" LATIN1 -!insertmacro MyLanguage "Japanese" CP932 -!insertmacro MyLanguage "Korean" CP949 -!insertmacro MyLanguage "Macedonian" CP1251 -!insertmacro MyLanguage "Polish" CP1250 -!insertmacro MyLanguage "PortugueseBr" LATIN1 -!insertmacro MyLanguage "Portuguese" LATIN1 -!insertmacro MyLanguage "Russian" CP1251 -!insertmacro MyLanguage "Slovak" CP1250 -!insertmacro MyLanguage "Spanish" LATIN1 -!insertmacro MyLanguage "Swedish" LATIN1 -!insertmacro MyLanguage "Turkish" CP1254 -!insertmacro MyLanguage "Ukrainian" CP1251 - -;---------------------------------------------------------------------------- -; Reserve Files -;---------------------------------------------------------------------------- - -ReserveFile "InstallType.ini" - -!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS - -ReserveFile "Warning.ini" - -ReserveFile "${BIN_ROOT}\KmdUtil.Exe" - -;---------------------------------------------------------------------------- -; Global Variables -;---------------------------------------------------------------------------- - -Var InstallType -Var LaunchControl -Var MustReboot -Var BundledInstall -Var DeleteSandboxieIni -;Var Win7Driver - -;---------------------------------------------------------------------------- -; macro InstallSystemDll -;---------------------------------------------------------------------------- - -!macro InstallSystemDll DllName Is64Bit - -IfFileExists "$SYSDIR\${DllName}" 0 +2 - StrCpy $1 1 ; already installed - -!if "${_BUILDARCH}" == "x64" -${If} ${Is64Bit} == false -DetailPrint "InstallSystemDll 32 ${DllSrcLocation64}\${DllName} $SYSDIR\${DllName}" -!insertmacro InstallLib DLL $1 REBOOT_NOTPROTECTED ${DllSrcLocation32}\${DllName} "$SYSDIR\${DllName}" $SYSDIR -${Else} -!define LIBRARY_X64 -DetailPrint "InstallSystemDll 64 ${DllSrcLocation64}\${DllName} $SYSDIR\${DllName}" -!insertmacro InstallLib DLL $1 REBOOT_NOTPROTECTED ${DllSrcLocation64}\${DllName} "$SYSDIR\${DllName}" $SYSDIR -!insertmacro EnableX64FSRedirection -!undef LIBRARY_X64 -${EndIf} -!else -!insertmacro InstallLib DLL $1 REBOOT_NOTPROTECTED ${DllSrcLocation32}\${DllName} "$SYSDIR\${DllName}" $SYSDIR -!endif - -!macroend - -;---------------------------------------------------------------------------- -; macro CompareDllVersions -;---------------------------------------------------------------------------- - -!macro CompareDllVersions DllName Version - - GetDllVersion "${DllName}" $R0 $R1 - - IntOp $R2 $R0 / 0x00010000 - IntOp $R3 $R0 & 0x0000FFFF - IntOp $R0 $R1 >> 16 - IntOp $R4 $R0 & 0x0000FFFF - IntOp $R5 $R1 & 0x0000FFFF - StrCpy $0 "$R2.$R3.$R4.$R5" - ${VersionCompare} "$0" "${Version}" $R0 - ; result in $R0 - ; $R0=0 Versions are equal - ; $R0=1 DllName version is newer - ; $R0=2 DllName version is older -!macroend - -;---------------------------------------------------------------------------- -; macro InstallVCRedist -;---------------------------------------------------------------------------- - -; eventually, the 64 bit ver will need to include the 32 bit VC Redist. Not required right now. - -!macro InstallVCRedist - -!if "${_BUILDARCH}" == "x64" - File "${VCRedist64SrcLocation}" -!else - File "${VCRedist32SrcLocation}" -!endif - -!if "${_BUILDARCH}" == "x64" - ExecWait '"${VCRedist64SrcLocation}" /passive' $0 -!else - ExecWait '"${VCRedist32SrcLocation}" /passive' $0 -!endif - -StrCmp $0 "0" +3 - MessageBox MB_OK|MB_ICONSTOP "Installation of VCRedist failed: $0" - Quit - -!macroend - -;---------------------------------------------------------------------------- -; macro DownloadInstallVCRedist -;---------------------------------------------------------------------------- - -!macro DownloadInstallVCRedist - -${If} ${RunningX64} -!insertmacro DisableX64FSRedirection -${EndIf} - -!insertmacro CompareDllVersions "$SYSDIR\mfc100u.dll" "10.0.40219.325" -StrCmp $R0 "2" Update_Version -!insertmacro CompareDllVersions "$SYSDIR\msvcr100.dll" "10.0.40219.325" -StrCmp $R0 "2" Update_Version -Goto DownloadInstallVCRedist_Exit ; versions are all up to date - -Update_Version: - -StrCpy $1 "https://www.sandboxie.com/support" -!if "${_BUILDARCH}" == "x64" - StrCpy $1 "$1/X64" - StrCpy $2 "vcredist_x64.exe" -!else - StrCpy $2 "vcredist_x86.exe" -!endif - -NSISdl::download /TIMEOUT=30000 $1/$2 $TEMP\$2 -Pop $R0 ;Get the return value - StrCmp $R0 "success" +3 - MessageBox MB_RETRYCANCEL|MB_ICONSTOP "Download failed for: $1/$2.$\nError: $R0.$\nRerun the install when problem corrected." IDRETRY -3 - Quit - -ExecWait '"$TEMP\$2" /passive' $0 -StrCmp $0 "0" +3 - MessageBox MB_OK|MB_ICONSTOP "Installation of VCRedist failed: $0.$\nRerun the install when problem corrected." - Quit - -DownloadInstallVCRedist_Exit: - -${If} ${RunningX64} -!insertmacro EnableX64FSRedirection -${EndIf} - -!macroend - -;---------------------------------------------------------------------------- -; Function .onInit -;---------------------------------------------------------------------------- - -Function .onInit - -; -; Initialize variables -; - - StrCpy $InstallType "Unknown" - StrCpy $LaunchControl "N" - StrCpy $MustReboot "N" - StrCpy $BundledInstall "N" - StrCpy $DeleteSandboxieIni "Y" - StrCpy $Language "0" - -; -; Force InstallType if requested on command line -; - - Call GetParameters - Pop $0 - StrLen $1 $0 - -Force_Loop: - - IntCmp $1 4 Force_Done Force_Done - StrCpy $2 $0 $1 - IntOp $1 $1 - 1 - - StrCmp $2 "/lang=" Force_Language - StrCmp $2 "/install_bundled" Force_Bundled_Install - StrCmp $2 "/install" Force_Install - StrCmp $2 "/upgrade" Force_Upgrade - StrCmp $2 "/remove" Force_Remove - - Goto Force_Loop - -Force_Language: - - StrCpy $Language $0 $1 6 - StrLen $2 $Language - IntOp $2 $2 + 7 ; skip "/lang=NNNN " - StrLen $1 $0 - IntOp $1 $1 - $2 - StrCpy $0 $0 $1 $2 - StrLen $1 $0 - Goto Force_Loop - -Force_Bundled_Install: - - StrCpy $BundledInstall "Y" - StrCpy $LaunchControl "N" - Goto Force_Done - -Force_Install: - - StrCpy $InstallType "Install" - Goto Force_Done - -Force_Upgrade: - - StrCpy $InstallType "Upgrade" - Goto Force_Done - -Force_Remove: - - StrCpy $InstallType "Remove" - Goto Force_Done - -Force_Done: - -; -; Detect existing installation, unless given by /D parameter -; - - StrCmp $INSTDIR "(na)" 0 InstDir_Done - - !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "SYSTEM\CurrentControlSet\Services\${SBIEDRV}" "ImagePath" - Pop $0 - StrCmp $0 "" 0 InstDir_CheckPath - - Goto InstDir_ProgramFiles - -InstDir_CheckPath: - - StrCpy $1 $0 4 0 - StrCmp $1 "\??\" 0 InstDir_Check_Suffix - StrCpy $0 $0 "" 4 - -InstDir_Check_Suffix: - - Push -12 - Pop $2 - StrCpy $1 $0 "" $2 - StrCmp $1 "\${SBIEDRV_SYS}" InstDir_Suffix_Good - - Goto InstDir_ProgramFiles - -InstDir_Suffix_Good: - - StrCpy $0 $0 $2 - Goto InstDir_Found - -InstDir_ProgramFiles: - - !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion" "ProgramFilesDir" - Pop $0 - StrCmp $0 "" InstDir_Done - StrCpy $0 "$0\${PRODUCT_FULL_NAME}" - -InstDir_Found: - - StrCpy $INSTDIR $0 - -InstDir_Done: - -; -; Detect InstallType if not yet known -; - - StrCmp $InstallType "Unknown" 0 InstType_Done - - StrCmp "$EXEDIR" "$INSTDIR" InstType_Remove - StrCmp "$EXEDIR" "$INSTDIR\" InstType_Remove - StrCmp "$EXEDIR\" "$INSTDIR" InstType_Remove - StrCmp "$EXEDIR" "$WINDIR\Installer" InstType_Remove - StrCmp "$EXEDIR" "$WINDIR\Installer\" InstType_Remove - StrCmp "$EXEDIR\" "$WINDIR\Installer" InstType_Remove - - IfFileExists $INSTDIR\${SBIEDRV_SYS} InstType_Upgrade - IfFileExists $INSTDIR\${SBIESVC_EXE} InstType_Upgrade - IfFileExists $INSTDIR\${SBIEDLL_DLL} InstType_Upgrade - - ; default InstallType for a new install, unless we detected an installation - - StrCpy $InstallType "Install" - Goto InstType_Done - -InstType_Upgrade: - - StrCpy $InstallType "Upgrade" - Goto InstType_Done - -InstType_Remove: - - StrCpy $InstallType "Remove" - -InstType_Done: - -; -; Language -; - - StrCmp $Language "0" 0 Lang_Done - - ReadRegDWORD $0 HKLM "SYSTEM\CurrentControlSet\Services\${SBIESVC}" "Language" - IntCmp $0 1033 Lang_AutoSelect ; English - IntCmp $0 1052 Lang_AutoSelect ; Albanian - IntCmp $0 1025 Lang_AutoSelect ; Arabic - IntCmp $0 1026 Lang_AutoSelect ; Bulgarian - IntCmp $0 1050 Lang_AutoSelect ; Croatian - IntCmp $0 1029 Lang_AutoSelect ; Czech - IntCmp $0 1030 Lang_AutoSelect ; Danish - IntCmp $0 1043 Lang_AutoSelect ; Dutch - IntCmp $0 1061 Lang_AutoSelect ; Estonian - IntCmp $0 1065 Lang_AutoSelect ; Farsi - IntCmp $0 1035 Lang_AutoSelect ; Finnish - IntCmp $0 1036 Lang_AutoSelect ; French - IntCmp $0 1031 Lang_AutoSelect ; German - IntCmp $0 1032 Lang_AutoSelect ; Greek - IntCmp $0 1037 Lang_AutoSelect ; Hebrew - IntCmp $0 1038 Lang_AutoSelect ; Hungarian - IntCmp $0 1040 Lang_AutoSelect ; Italian - IntCmp $0 1057 Lang_AutoSelect ; Indonesian - IntCmp $0 1041 Lang_AutoSelect ; Japanese - IntCmp $0 1042 Lang_AutoSelect ; Korean - IntCmp $0 1071 Lang_AutoSelect ; Macedonian - IntCmp $0 1045 Lang_AutoSelect ; Polish - IntCmp $0 1046 Lang_AutoSelect ; Portuguese (Brasil) - IntCmp $0 2070 Lang_AutoSelect ; Portuguese (Portugal) - IntCmp $0 1049 Lang_AutoSelect ; Russian - IntCmp $0 1051 Lang_AutoSelect ; Slovak - IntCmp $0 1034 Lang_AutoSelect ; Spanish - IntCmp $0 1053 Lang_AutoSelect ; Swedish - IntCmp $0 1055 Lang_AutoSelect ; Turkish - IntCmp $0 1058 Lang_AutoSelect ; Ukrainian - IntCmp $0 1028 Lang_AutoSelect ; Chinese (Traditional) - IntCmp $0 2052 Lang_AutoSelect ; Chinese (Simplified) - StrCpy $0 1033 ; English - default - -Lang_AutoSelect: - - StrCpy $Language $0 - StrCmp $InstallType "Remove" Lang_Done - - !define MUI_LANGDLL_WINDOWTITLE "${NAME_${_BUILDARCH}}" - !insertmacro MUI_LANGDLL_DISPLAY - -Lang_Done: - -; -; Extract InstallOptions scripts -; - - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "InstallType.ini" - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "Warning.ini" - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function ConfirmRequirements -;---------------------------------------------------------------------------- - -Function ConfirmRequirements - -; -; Confirm we are on Windows XP or later -; - - !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "'Software\Microsoft\Windows NT\CurrentVersion'" "CurrentVersion" - Pop $0 - StrCmp $0 "" SystemCheck_Fail - ;StrCmp $0 "5.1" SystemCheck_Done_XP_2003 - ;StrCmp $0 "5.2" SystemCheck_Done_XP_2003 - StrCmp $0 "6.0" SystemCheck_Done - StrCmp $0 "6.1" SystemCheck_Done - StrCmp $0 "6.2" SystemCheck_Done - StrCmp $0 "6.3" SystemCheck_Done - StrCmp $0 "6.4" SystemCheck_Done - Goto SystemCheck_Fail - -SystemCheck_Fail: - - StrCmp $InstallType "Remove" SystemCheck_Force_Remove - - MessageBox MB_OK|MB_ICONSTOP "$(MSG_8041)$\n\ - Windows Vista, Windows 7, Windows 8, Windows 10." - StrCmp $InstallType "Upgrade" SystemCheck_Force_Remove - Quit - -;SystemCheck_Done_XP_2003: - -!if "${_BUILDARCH}" == "x64" - - MessageBox MB_OK|MB_ICONSTOP "$(MSG_8041)$\n\ - (64-bit) Windows Vista (Service Pack 1), Windows 7, Windows 8, Windows 10." - StrCmp $InstallType "Upgrade" SystemCheck_Force_Remove - Quit - -!endif - - Goto SystemCheck_Done - -SystemCheck_Force_Remove: - - StrCpy $InstallType "ForceRemove" - Goto SystemCheck_Done - -SystemCheck_Done: - - !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "'Software\Microsoft\Windows\CurrentVersion\Uninstall\Sandboxie-Plus_is1'" "UninstallString" - Pop $0 - StrCmp $0 "" PlusCheck_Done - - MessageBox MB_OK|MB_ICONSTOP "Sandboxie Plus installation detected, you must uninstall it first before you can downgrade to Sandboxie Classic!" - Quit - -PlusCheck_Done: - -; -; Confirm we are running as Administrator -; - - Call IsUserAdmin - Pop $0 - StrCmp $0 1 AdminCheck_Done - - MessageBox MB_OK|MB_ICONSTOP $(MSG_8042) - Quit - -AdminCheck_Done: - -; -; Confirm that Installer bitness is same as that of the operating system -; Our installer is a 32-bit program, so if WOW-64 mode is enabled in the -; process, it means we are in 64-bit Windows -; - - Call IsWow64 - Pop $0 - -!if "${_BUILDARCH}" == "x64" - - StrCmp $0 "Y" InitCheck_Done - MessageBox MB_OK|MB_ICONSTOP $(MSG_8044) - Quit - -!else - - StrCmp $0 "N" InitCheck_Done - MessageBox MB_OK|MB_ICONSTOP $(MSG_8043) - Quit - -!endif - -InitCheck_Done: - - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function SkipLicensePage -;---------------------------------------------------------------------------- - -Function SkipLicensePage - -; -; Confirm minimum Windows version and use of Administrator account -; - - Call ConfirmRequirements - -; -; Skip license page if not Install mode -; - -; StrCmp $InstallType "Install" SkipLicensePage_Done - StrCmp $InstallType "Remove" 0 SkipLicensePage_Done - - Abort - -SkipLicensePage_Done: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function InstallTypePage -;---------------------------------------------------------------------------- - -Function InstallTypePage - -; -; Provisional windows 7 support -; -; !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "'Software\Microsoft\Windows NT\CurrentVersion'" "CurrentVersion" -; Pop $0 -; StrCmp $0 "6.0" w7_Drv_ask -; StrCmp $0 "6.1" w7_Drv_ask -; Goto w7_Skip -; -;w7_Drv_ask: -; -; MessageBox MB_YESNO|MB_ICONQUESTION "Windows 7 requires a provisional driver package. You will have to download it from the GitHub release page https://github.com/sandboxie-plus/Sandboxie/releases/$\r$\nDo you have it downloaded?" IDYES w7_Drv_ok -; -; MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to open the download page in your default web browser?" IDNO w7_Drv_cancel -; ExecShell "open" "https://github.com/sandboxie-plus/Sandboxie/releases/" -; Goto w7_Drv_ok -; -;w7_Drv_cancel: -; MessageBox MB_OK|MB_ICONSTOP "On windows 7 the install can not continue without the provisional driver package" -; -; Quit -; -;w7_Drv_ok: -; -; nsDialogs::SelectFileDialog open "" "Driver binary (*.${_W7DRV_COMPAT}.rc4)|*.${_W7DRV_COMPAT}.rc4|All Files|*.*" -; -; Pop $0 -; StrCmp $0 "" w7_Drv_cancel -; StrCpy $Win7Driver $0 -; -;; MessageBox MB_OK $Win7Driver -; -;w7_Skip: - - StrCmp $InstallType "Install" InstallType_Done - - StrCmp $InstallType "Upgrade" InstallType_SetFolder - - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 4" "State" "0" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 5" "State" "1" - - StrCmp $InstallType "ForceRemove" 0 InstallType_SetFolder - StrCpy $InstallType "Remove" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 4" "Flags" "DISABLED" - -InstallType_SetFolder: - - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 2" "State" "$INSTDIR" - - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Settings" "RTL" "$(^RTL)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Settings" "NextButtonText" "$(MSG_8003)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 1" "Text" "$(MSG_8004)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 3" "Text" "$(MSG_8005)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 4" "Text" "$(MSG_8006)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 5" "Text" "$(MSG_8007)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 6" "Text" "$(MSG_8008)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 7" "Text" "$(MSG_8009)" - - !insertmacro MUI_HEADER_TEXT "$(MSG_8001)" "$(MSG_8002)" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY "InstallType.ini" - -InstallType_Done: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function SkipDirectoryPage -;---------------------------------------------------------------------------- - -Function SkipDirectoryPage - - StrCmp $InstallType "Install" SkipDirectoryPage_Done - -; -; Set InstallType according to selected radio button -; - - !insertmacro MUI_INSTALLOPTIONS_READ $4 "InstallType.ini" "Field 4" "State" - !insertmacro MUI_INSTALLOPTIONS_READ $5 "InstallType.ini" "Field 5" "State" - - StrCmp $4 "1" SetType_Upgrade - StrCmp $5 "1" SetType_Remove - Goto SetType_Done - -SetType_Upgrade: - - StrCpy $InstallType "Upgrade" - Goto SetType_Done - -SetType_Remove: - - StrCpy $InstallType "Remove" - Goto SetType_Done - -SetType_Done: - - Abort - -SkipDirectoryPage_Done: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function SetHeaderForRemove -;---------------------------------------------------------------------------- - -Function SetHeaderForRemove - - StrCmp $InstallType "Remove" 0 SetHeaderForRemove_Done - - !insertmacro MUI_HEADER_TEXT "Uninstalling" "$(MSG_8016)" - -; -; Ask about removing settings -; - - IfSilent SetHeaderForRemove_Done - - MessageBox MB_YESNO|MB_ICONQUESTION "$(MSG_8054)" IDNO SetHeaderForRemove_Done - - StrCpy $DeleteSandboxieIni "N" - -SetHeaderForRemove_Done: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Install Section -;---------------------------------------------------------------------------- - -; We download various files during install just to keep stats on activity - -Function DownloadStatPng -; -; Pop $0 ; Get the parameter (file name to download) -; ${If} ${RunningX64} -; SetRegView 64 -; ${EndIf} -; ReadRegStr $1 HKLM "SOFTWARE\Microsoft\Cryptography" "MachineGuid" -; StrCpy $2 "https://www.sandboxie.com/img/$0?SessionId=$1" -; -; ;NSISdl::download_quiet /TIMEOUT=3000 $2 $TEMP\$0 -; inetc::get /SILENT /CONNECTTIMEOUT=5000 /RECEIVETIMEOUT=5000 $2 $TEMP\$0 /END -; Pop $0 ;Get the return value -; ;MessageBox MB_OK|MB_ICONSTOP "DownloadStatPng: $2$\n$0" -; ${If} ${RunningX64} -; SetRegView 32 -; ${EndIf} -FunctionEnd - - -Section "" - -;LogSet on -; -; Prepare KmdUtil and then use it to warn about running programs -; - - File "/oname=$PLUGINSDIR\KmdUtil.exe" "${BIN_ROOT}\KmdUtil.Exe" - File "/oname=$PLUGINSDIR\${SBIEMSG_DLL}" "${BIN_ROOT}\SbieMsg.dll" - File "/oname=$PLUGINSDIR\${SBIEDLL_DLL}" "${BIN_ROOT}\${SBIEDLL_DLL}" - - StrCpy $0 "" - IfSilent 0 +2 - StrCpy $0 "_silent" - StrCpy $0 "scandll$0" - Push $0 - Call KmdUtilX - IfErrors FindWindow_Abort - -; -; Close Sandboxie Control if it is running -; - -FindWindow_Check: - - FindWindow $0 "${SANDBOXIE_CONTROL}WndClass" "" - StrCmp $0 0 FindWindow_Done - - SendMessage $0 ${WM_DESTROY} 0 0 /TIMEOUT=2000 - Sleep 1000 - - FindWindow $0 "${SANDBOXIE_CONTROL}WndClass" "" - StrCmp $0 0 FindWindow_Done - - MessageBox MB_OKCANCEL|MB_ICONQUESTION "$(MSG_8051)" IDCANCEL FindWindow_Abort - - Goto FindWindow_Check - -FindWindow_Abort: - - Abort - -FindWindow_Done: - -; -; Stop Sandboxie Service -; - - Push "stop ${SBIESVC}" - Call KmdUtil - - ; Windows 10 doesn't allow copying a .sys on top of a running driver. So we have to stop it here. - Push "stop ${SBIEDRV}" - Call KmdUtil -; -; Branch to Install, Upgrade or Remove according to install mode -; - - StrCmp $InstallType "Install" Install - - ReadRegStr $0 HKLM "SOFTWARE\System Safety\System Safety Monitor\2" "Version" - StrCmp $0 "" NoSystemSafetyMonitor - StrCpy $MustReboot "Y" -NoSystemSafetyMonitor: - - ReadRegStr $0 HKLM "SOFTWARE\TrendMicro\PC-cillin" "version" - StrCmp $0 "" NoTrendMicro - StrCpy $MustReboot "Y" -NoTrendMicro: - - StrCmp $InstallType "Upgrade" Upgrade - StrCmp $InstallType "Remove" Remove - - Abort - -; -; Install and Upgrade -; - -Upgrade: - - Call DeleteProductKey - Call DeleteSystemKeys - Call DeleteShortCuts - ; we use this file download as a total # of upgrades counter - Push "sbietrayfullup.png" - Call DownloadStatPng - Goto Install2 - -Install: - - ; we use this file download as a total # of installs counter - Push "sbietrayfull.png" - Call DownloadStatPng - -Install2: - Call WriteProgramFiles - - !define DllSrcLocation32 "..\Build\Support" - -; MS libraries are all static with Visual Studio 2015 -;!if "${_BUILDARCH}" == "x64" -; !define DllSrcLocation64 "..\Build\Support\x64" -; !insertmacro InstallSystemDll "msvcr100.dll" false -; !insertmacro InstallSystemDll "mfc100u.dll" true -; !insertmacro InstallSystemDll "msvcr100.dll" true -; !insertmacro InstallSystemDll "msvcp100.dll" true -;!endif - -;!ifdef INCLUDE_VCREDIST_DNLD -; !insertmacro DownloadInstallVCRedist -;!else -; !insertmacro InstallSystemDll "msvcr100.dll" false -; !insertmacro InstallSystemDll "mfc100u.dll" false -; !insertmacro InstallSystemDll "msvcp100.dll" false -;!endif - - Call WriteProductKey - Call WriteShortCuts - - Goto Section_Done - -; -; Remove -; - -Remove: - - ; we use this file download as a total # of uninstalls counter - Push "sbietrayempty.png" - Call DownloadStatPng - Call DeleteProductKey - Call DeleteProgramFiles - Call DeleteSystemKeys - Call DeleteShortCuts - - Goto Section_Done - -; -; Done -; - -Section_Done: - - IfSilent 0 Section_Done2 - Call DriverPage - -Section_Done2: - -SectionEnd - -;---------------------------------------------------------------------------- -; Function WriteProgramFiles -;---------------------------------------------------------------------------- - -Function WriteProgramFiles - - SetOverwrite try - - SetOutPath "$INSTDIR" - - StrCpy $2 0 - -WriteLoop: - - ; - ; Write files - ; - - File /oname=${SBIEDLL_DLL} "${BIN_ROOT}\${SBIEDLL_DLL}" - - File /oname=${SBIESVC_EXE} "${BIN_ROOT}\SbieSvc.exe" - File /oname=${SBIESVC_EXE}.sig "${BIN_ROOT}\SbieSvc.exe.sig" - -!if "${_BUILDARCH}" == "x64" - - CreateDirectory $INSTDIR\32 - - File /oname=32\${SBIEDLL_DLL} "${BIN_ROOT_Win32}\${SBIEDLL_DLL}" - - File /oname=32\${SBIESVC_EXE} "${BIN_ROOT_Win32}\SbieSvc.exe" - -!endif - - File /oname=${SBIEMSG_DLL} "${BIN_ROOT}\SbieMsg.dll" - - File /oname=${SBIEDRV_SYS} "${BIN_ROOT}\SbieDrv.sys" -; File /oname=${SBIEDRV_SYS4} "${BIN_ROOT}\SbieDrv.sys.rc4" -; File /oname=${SBIEDRV_SYSX} "${BIN_ROOT}\SbieDrv.sys.w10" - - File /oname=KmdUtil.exe "${BIN_ROOT}\KmdUtil.Exe" - - File /oname=SboxHostDll.dll "${BIN_ROOT}\SboxHostDll.dll" - - File /oname=${SANDBOXIE}RpcSs.exe "${BIN_ROOT}\SandboxieRpcSs.exe" - File /oname=${SANDBOXIE}DcomLaunch.exe "${BIN_ROOT}\SandboxieDcomLaunch.exe" - File /oname=${SANDBOXIE}BITS.exe "${BIN_ROOT}\SandboxieBITS.exe" - File /oname=${SANDBOXIE}Crypto.exe "${BIN_ROOT}\SandboxieCrypto.exe" - File /oname=${SANDBOXIE}WUAU.exe "${BIN_ROOT}\SandboxieWUAU.exe" - - File /oname=${START_EXE} "${BIN_ROOT}\Start.exe" - - File /oname=${SBIECTRL_EXE} "${BIN_ROOT}\SbieCtrl.exe" - File /oname=${SBIECTRL_EXE}.sig "${BIN_ROOT}\SbieCtrl.exe.sig" - - File "..\install\Templates.ini" - - File "Manifest0.txt" - File "Manifest1.txt" - File "Manifest2.txt" - - File /oname=${SBIEINI_EXE} "${BIN_ROOT}\SbieIni.exe" - - ;File "${BIN_ROOT}\License.exe" - - File "LICENSE.TXT" - - ; - ; Check for files being held - ; - - IfErrors 0 WriteOk - - IntCmp $2 5 WriteError - IntOp $2 $2 + 1 - Sleep 1000 - Goto WriteLoop - -WriteError: - - IfSilent WriteAbort - StrCpy $2 0 - MessageBox MB_OKCANCEL|MB_ICONSTOP $(MSG_8052) IDOK WriteLoop - -WriteAbort: - - Abort - -WriteOk: - - SetOverwrite on - - ; - ; Create shortcut - ; - - CreateShortCut "$INSTDIR\QuickLaunch.lnk" "$INSTDIR\${START_EXE}" default_browser "" "" SW_SHOWNORMAL "" "$(MSG_8026)" - - ; - ; Copy this Installer program to the Windows\Installer directory - ; - - StrCmp $BundledInstall "Y" SkipCopyInstaller - - System::Call 'Kernel32::GetModuleFileNameA(i 0, t .r0, i 1024) i r1' - ; $0 --> Installer Filename - - CopyFiles "$0" "$WINDIR\Installer\${OUTFILE_${_BUILDARCH}}" - -SkipCopyInstaller: - - ; - ; Delete old files - ; - - Delete "$DESKTOP\${PRODUCT_NAME} Quick Launch.lnk" - Delete "$QUICKLAUNCH\${PRODUCT_NAME} Quick Launch.lnk" - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function DeleteProgramFiles -;---------------------------------------------------------------------------- - -Function DeleteProgramFiles - -; -; Delete program files -; - - Delete "$INSTDIR\${SBIEDLL_DLL}" - - Delete "$INSTDIR\${SBIESVC_EXE}" - Delete "$INSTDIR\${SBIESVC_EXE}.sig" - -!if "${_BUILDARCH}" == "x64" - - Delete "$INSTDIR\32\${SBIEDLL_DLL}" - - Delete "$INSTDIR\32\${SBIESVC_EXE}" - - RMDir "$INSTDIR\32" - -!endif - - Delete "$INSTDIR\${SBIEMSG_DLL}" - - Delete "$INSTDIR\${SBIEDRV_SYS}" -; Delete "$INSTDIR\${SBIEDRV_SYS4}" -; Delete "$INSTDIR\${SBIEDRV_SYSX}" - - Delete "$INSTDIR\KmdUtil.exe" - - Delete "$INSTDIR\SboxHostDll.dll" - - Delete "$INSTDIR\boxHostDll.dll" - - Delete "$INSTDIR\${SANDBOXIE}WUAU.exe" - Delete "$INSTDIR\${SANDBOXIE}EventSys.exe" - Delete "$INSTDIR\${SANDBOXIE}Crypto.exe" - Delete "$INSTDIR\${SANDBOXIE}BITS.exe" - Delete "$INSTDIR\${SANDBOXIE}DcomLaunch.exe" - Delete "$INSTDIR\${SANDBOXIE}RpcSs.exe" - - Delete "$INSTDIR\${START_EXE}" - - Delete "$INSTDIR\${SBIECTRL_EXE}" - Delete "$INSTDIR\${SBIECTRL_EXE}.sig" - - Delete "$INSTDIR\Templates.ini" - - Delete "$INSTDIR\Manifest0.txt" - Delete "$INSTDIR\Manifest1.txt" - Delete "$INSTDIR\Manifest2.txt" - - Delete "$INSTDIR\${SBIEINI_EXE}" - - Delete "$INSTDIR\LICENSE.EXE" - - Delete "$INSTDIR\LICENSE.TXT" - -; -; Delete installer -; - - Delete /REBOOTOK "$INSTDIR\${OUTFILE_Win32}" - Delete /REBOOTOK "$INSTDIR\${OUTFILE_x64}" - Delete /REBOOTOK "$INSTDIR\${OUTFILE_BOTH}" - Delete /REBOOTOK "$WINDIR\Installer\${OUTFILE_Win32}" - Delete /REBOOTOK "$WINDIR\Installer\${OUTFILE_x64}" - Delete /REBOOTOK "$WINDIR\Installer\${OUTFILE_BOTH}" - -; -; Delete shortcuts -; - - Delete "$INSTDIR\QuickLaunch.lnk" - - Push "$DESKTOP" - Call DeleteDesktopShortCuts - - Push "$QUICKLAUNCH" - Call DeleteDesktopShortCuts - - RMDir /r "$SENDTO\${PRODUCT_NAME}" - Delete "$SENDTO\${PRODUCT_NAME} - *.lnk" - -; -; Delete configuration files -; - - StrCmp $DeleteSandboxieIni "N" SkipDeleteSandboxieIni - Delete "$INSTDIR\${SANDBOXIE_INI}" - Delete "$WINDIR\${SANDBOXIE_INI}" -SkipDeleteSandboxieIni: - -; -; Delete installation folder -; - - RMDir "$INSTDIR" - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function WriteProductKey -;---------------------------------------------------------------------------- - -Function WriteProductKey - -; -; Create key for Add/Remove Programs -; - - StrCmp $BundledInstall "Y" SkipAddRemovePrograms - - !insertmacro Reg_CreateKey "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall" "${PRODUCT_NAME}" - !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" '"${NAME_${_BUILDARCH}}"' - !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" '$INSTDIR\Start.exe' - !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" '"${VERSION}"' - !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "Publisher" '"${COMPANY_NAME}"' - !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" `'"$WINDIR\Installer\${OUTFILE_${_BUILDARCH}}" /remove'` - -; -; Create GUID value for CancelAutoplay functionality in Sandboxie Control -; - - !insertmacro Reg_TestKey "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID" - Pop $0 - StrCmp $0 "0" CancelAutoplay_Done - !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID" "${MY_AUTOPLAY_CLSID}" '""' -CancelAutoplay_Done: - -SkipAddRemovePrograms: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function DeleteProductKey -;---------------------------------------------------------------------------- - -Function DeleteProductKey - -; -; Delete key for Add/Remove Programs -; - - !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall" "${PRODUCT_NAME}" - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function WriteShortCuts -;---------------------------------------------------------------------------- - -Function WriteShortCuts - - StrCmp $BundledInstall "Y" SkipWriteShortCuts - - SetShellVarContext all - - CreateDirectory "$SMPROGRAMS\${PRODUCT_FULL_NAME}" - CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8021)" "$INSTDIR\${START_EXE}" "/box:__ask__ run_dialog" "" "" SW_SHOWNORMAL "" "$(MSG_8022)" - CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8023)" "$INSTDIR\${START_EXE}" "/box:__ask__ start_menu" "" "" SW_SHOWNORMAL "" "$(MSG_8024)" - CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8025)" "$INSTDIR\${START_EXE}" "default_browser" "" "" SW_SHOWNORMAL "" "$(MSG_8026)" - CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8027)" "$INSTDIR\${START_EXE}" "." "" "" SW_SHOWNORMAL "" "$(MSG_8028)" - CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8029)" "$INSTDIR\${SBIECTRL_EXE}" "/open" "" "" SW_SHOWNORMAL "" "$(MSG_8030)" - CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8031)" "$WINDIR\Installer\${OUTFILE_${_BUILDARCH}}" "/remove" "" "" SW_SHOWNORMAL "" "$(MSG_8032)" - -SkipWriteShortCuts: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function DeleteShortCuts -;---------------------------------------------------------------------------- - -Function DeleteShortCuts - - SetShellVarContext all - Call DeleteShortCuts_2 - - SetShellVarContext current - Call DeleteShortCuts_2 - -FunctionEnd - -Function DeleteShortCuts_2 - - RMDir /r "$SMPROGRAMS\${PRODUCT_FULL_NAME}" - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function DeleteDesktopShortCuts -;---------------------------------------------------------------------------- - -Function DeleteDesktopShortCuts - - Pop $1 - Delete "$1\${PRODUCT_NAME} Quick Launch.lnk" - - ; delete #8025.lnk in selected language and in English - Delete "$1\$(MSG_8025)" - Delete "$1\Run Web browser sandboxed.lnk" - - ; delete #8033.lnk in selected language and in English - Delete "$1\$(MSG_8033)" - Delete "$1\Sandboxed Web Browser.lnk" - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function DeleteSystemKeys -;---------------------------------------------------------------------------- - -Function DeleteSystemKeys - - StrCmp $InstallType "Remove" 0 ShellKey_Folder_Done - -; -; Delete SandboxieControl value from Windows\Run key -; - - !insertmacro Reg_ReadString "" ${HKEY_CURRENT_USER} "Software\Microsoft\Windows\CurrentVersion\Run" "${SANDBOXIE_CONTROL}" - Pop $0 - StrCmp $0 "" RunKey_Done - - !insertmacro Reg_DeleteValue "" ${HKEY_CURRENT_USER} "Software\Microsoft\Windows\CurrentVersion\Run" "${SANDBOXIE_CONTROL}" - -RunKey_Done: - -; -; Delete GUID value for CancelAutoplay functionality in Sandboxie Control -; - - !insertmacro Reg_DeleteValue "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID" "${MY_AUTOPLAY_CLSID}" - -; -; Delete sandbox key from HKCR\*\shell key -; - - !insertmacro Reg_TestKey "" ${HKEY_CLASSES_ROOT} "*\shell\${SANDBOX_VERB}" - Pop $0 - StrCmp $0 "0" ShellKey_Star_Done - - !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "*\shell\${SANDBOX_VERB}" "command" - !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "*\shell" "${SANDBOX_VERB}" - -ShellKey_Star_Done: - -; -; Delete sandbox key from HKCR\Folder\shell key -; - - !insertmacro Reg_TestKey "" ${HKEY_CLASSES_ROOT} "Folder\shell\${SANDBOX_VERB}" - Pop $0 - StrCmp $0 "0" ShellKey_Folder_Done - - !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "Folder\shell\${SANDBOX_VERB}" "command" - !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "Folder\shell" "${SANDBOX_VERB}" - -ShellKey_Folder_Done: - -; -; Delete keys which may have been left by old versions of Sandboxie -; -; HKLM\Software\Classes\*\shell\sandbox -; HKLM\Software\Classes\Folder\shell\sandbox -; HKCR\exefile\shell -; - -; -; Delete sandbox key from HKLM\Software\Classes\*\shell\sandbox -; - - !insertmacro Reg_TestKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\*\shell\${SANDBOX_VERB}" - Pop $0 - StrCmp $0 "0" HKLM_ShellKey_Star_Done - - !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\*\shell\${SANDBOX_VERB}" "command" - !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\*\shell" "${SANDBOX_VERB}" - -HKLM_ShellKey_Star_Done: - -; -; Delete sandbox key from HKLM\Software\Classes\Folder\shell key -; - - !insertmacro Reg_TestKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\Folder\shell\${SANDBOX_VERB}" - Pop $0 - StrCmp $0 "0" HKLM_ShellKey_Folder_Done - - !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\Folder\shell\${SANDBOX_VERB}" "command" - !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\Folder\shell" "${SANDBOX_VERB}" - -HKLM_ShellKey_Folder_Done: - -; -; Delete sandbox key from HKCR\exefile\shell key -; - - !insertmacro Reg_TestKey "" ${HKEY_CLASSES_ROOT} "exefile\shell\${SANDBOX_VERB}" - Pop $0 - StrCmp $0 "0" ShellKey_Exe_Done - - !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "exefile\shell\${SANDBOX_VERB}" "command" - !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "exefile\shell" "${SANDBOX_VERB}" - -ShellKey_Exe_Done: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function KmdUtilX -;---------------------------------------------------------------------------- - -Function KmdUtilX - - Pop $1 - DetailPrint "Running KmdUtil command: $1" - ;MessageBox MB_OK|MB_ICONEXCLAMATION "Running KmdUtil command: $1" - ClearErrors - SetDetailsPrint listonly - ExecWait '"$PLUGINSDIR\KmdUtil.exe" /lang=$Language $1' - SetDetailsPrint both - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function KmdUtil -;---------------------------------------------------------------------------- - -Function KmdUtil - - Call KmdUtilX - IfErrors KmdUtil_Errors - Goto KmdUtil_Done - -KmdUtil_Errors: - StrCmp $1 "stop ${SBIEDRV}" KmdUtil_SetReboot - DetailPrint "Could not process KmdUtil command: $1" - MessageBox MB_OK|MB_ICONEXCLAMATION "$(MSG_8053)$\n$\n$PLUGINSDIR\KmdUtil.exe $1" - StrCmp $1 "stop ${SBIESVC}" KmdUtil_SetReboot - Goto KmdUtil_Done - -KmdUtil_SetReboot: - SetRebootFlag true - -KmdUtil_Done: - ClearErrors - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function DriverPage -;---------------------------------------------------------------------------- - -Function DriverPage - -; -; Show the warning page, unless we're doing a Remove -; - - StrCmp $InstallType "Remove" Driver_Remove - - IfSilent Driver_Silent - - !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Settings" "RTL" "$(^RTL)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 1" "Text" "$(MSG_8012)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 2" "Text" "$(MSG_8013)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 4" "Text" "$(MSG_8014)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 5" "Text" "$(MSG_8015)" - - !insertmacro MUI_HEADER_TEXT "$(MSG_8010)" "$(MSG_8011)" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY_RETURN "Warning.ini" - - Pop $0 - StrCmp $0 "cancel" Driver_Done - -Driver_Silent: - -; -; For Install and Upgrade, install the driver -; - - StrCpy $0 'install ${SBIEDRV} "$INSTDIR\${SBIEDRV_SYS}" type=kernel start=demand "msgfile=$INSTDIR\${SBIEMSG_DLL}" altitude=${FILTER_ALTITUDE}' - Push $0 - Call KmdUtil - - Push 'install ${SBIESVC} "\"$INSTDIR\${SBIESVC_EXE}"\" type=own start=auto "display=${PRODUCT_FULL_NAME} Service" group=UIGroup "msgfile=$INSTDIR\${SBIEMSG_DLL}"' - Call KmdUtil - - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\${SBIESVC}" "Language" $Language - - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\${SBIESVC}" "PreferExternalManifest" 1 - - StrCmp $InstallType "Install" Driver_Install - StrCmp $InstallType "Upgrade" Driver_Upgrade - - Abort - -; -; For Upgrade, we make sure the driver is set to start manually, -; then stop driver (service was already stopped), and fallthrough -; to install processing to re-start the service (and driver). -; -; Note that KmdUtil "stop SbieDrv" will set the reboot flag, -; in case the driver cannot be unloaded. -; - -Driver_Upgrade: - - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\${SBIEDRV}" "Start" 3 - - Push "stop ${SBIEDRV}" - Call KmdUtil - - IfRebootFlag Driver_Done - StrCmp $MustReboot "N" Driver_Install - SetRebootFlag true - Goto Driver_Done - -; -; For Install, we start the driver and finish -; - -Driver_Install: - -; StrCmp $Win7Driver "" now_w7_Drv -; -;; MessageBox MB_OK $Win7Driver -; Delete "$INSTDIR\SbieDrv.sys.w10" -; Rename "$INSTDIR\SbieDrv.sys" "$INSTDIR\SbieDrv.sys.w10" -; CopyFiles $Win7Driver "$INSTDIR\SbieDrv.sys.rc4" -; -;now_w7_Drv: - - Push "start ${SBIESVC}" - Call KmdUtil - - StrCpy $LaunchControl "Y" - - Goto Driver_Done - -; -; For Remove, delete the driver and set the reboot flag -; - -Driver_Remove: - - Push "stop ${SBIESVC}" - Call KmdUtil - - Push "stop ${SBIEDRV}" - Call KmdUtil - - Push "delete ${SBIESVC}" - Call KmdUtil - - Push "delete ${SBIEDRV}" - Call KmdUtil - - StrCmp $MustReboot "N" Driver_Done - SetRebootFlag true - -Driver_Done: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function DisableBackButton -;---------------------------------------------------------------------------- - -Function DisableBackButton - - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "BackEnabled" "0" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnabled" "0" - - StrCmp $InstallType "Remove" 0 DisableBackButton_Done - -; -; Replace "MUI_TEXT_FINISH_INFO_TEXT" with "MUI_UNTEXT_FINISH_INFO_TEXT". -; -; Note, for this to work, "Modern UI\System.nsh" must contain the following macro: -; -; !macro MUI_LANGUAGEFILE_UNLANGSTRING_PAGE_1 PAGE NAME -; LangString "${NAME}" 0 "${${NAME}}" -; !undef "${NAME}" -; !macroend -; -; and a line in System.nsh, in the macro "MUI_LANGUAGEFILE_END", must be changed from: -; -; !insertmacro MUI_LANGUAGEFILE_UNLANGSTRING_PAGE FINISH "MUI_UNTEXT_FINISH_INFO_TEXT" -; -; so that it invokes the special new _1 macro: -; -; !insertmacro MUI_LANGUAGEFILE_UNLANGSTRING_PAGE_1 FINISH "MUI_UNTEXT_FINISH_INFO_TEXT" -; - - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "$(MUI_UNTEXT_FINISH_INFO_TEXT)" - -DisableBackButton_Done: - -FunctionEnd - -;---------------------------------------------------------------------------- -; Function .onGUIEnd -;---------------------------------------------------------------------------- - -Function .onGUIEnd - - StrCmp $LaunchControl "Y" 0 Done - - ExecWait '"$INSTDIR\${START_EXE}" run_sbie_ctrl' $0 - -Done: - -FunctionEnd +;---------------------------------------------------------------------------- +; Sandboxie Installer +;---------------------------------------------------------------------------- + +SetCompressor /SOLID /FINAL lzma + +!include "MUI.nsh" +!include "IsWow64.nsh" +!include "Registry.nsh" +!include "Cmdline.nsh" +!include "IsAdmin.nsh" +!include "Library.nsh" +!include "WordFunc.nsh" + +;---------------------------------------------------------------------------- +; Extract Information from my_version.h +;---------------------------------------------------------------------------- + +!tempfile TMPVERFILE +!system 'ParseVersion.bat "..\common\my_version.h" "${TMPVERFILE}"' +!include "${TMPVERFILE}" +!delfile "${TMPVERFILE}" +!undef TMPVERFILE + +;---------------------------------------------------------------------------- +; Global Defines +;---------------------------------------------------------------------------- +; these are the build-time config settings. Need to be cmd line args or something better. +; pick either 32 or 64 bit +;!define _BUILDARCH Win32 +;!define _BUILDARCH x64 +!define _BUILDARCH "$%SBIE_BUILDARCH%" + + +; uncomment this line if you want to make the special versions that download VC Redist +;!define INCLUDE_VCREDIST_DNLD + +!define BIN_ROOT_BASE "${SBIE_INSTALLER_PATH}" + +;!if "${_BUILDARCH}" == "x64" +; !define _W7DRV_COMPAT "$%SbieVer%.x64" +;!else +; !define _W7DRV_COMPAT "$%SbieVer%.x86" +;!endif + +;!define SBIEDRV_SYS4 "${SBIEDRV_SYS}.rc4" +;!define SBIEDRV_SYSX "${SBIEDRV_SYS}.w10" + +!define OUTFILE_BOTH "${PRODUCT_NAME}Install.exe" +!define NAME_Win32 "${PRODUCT_FULL_NAME} ${VERSION} (32-bit)" +!ifdef INCLUDE_VCREDIST_DNLD +!define OUTFILE_Win32 "${PRODUCT_NAME}Install32_VCRedist.exe" +!else +!define OUTFILE_Win32 "${PRODUCT_NAME}Install32.exe" +!endif +!define ARCH_Win32 "Win32" +!define BIN_ROOT_Win32 "${BIN_ROOT_BASE}\Win32\SbieRelease" + +!define NAME_x64 "${PRODUCT_FULL_NAME} ${VERSION} (64-bit)" +!ifdef INCLUDE_VCREDIST_DNLD +!define OUTFILE_x64 "${PRODUCT_NAME}Install64_VCRedist.exe" +!else +!define OUTFILE_x64 "${PRODUCT_NAME}Install64.exe" +!endif +!define ARCH_x64 "x64" +!define BIN_ROOT_x64 "${BIN_ROOT_BASE}\x64\SbieRelease" + +!define ARCH ${ARCH_${_BUILDARCH}} +!define BIN_ROOT ${BIN_ROOT_${_BUILDARCH}} + +!define VCRedist64SrcLocation "..\Build\Support\x64\vcredist_x64.exe" +!define VCRedist32SrcLocation "..\Build\Support\vcredist_x86.exe" + +Section binroot +DetailPrint "binary root ${BIN_ROOT}" +SectionEnd + +Name "${NAME_${_BUILDARCH}}" + +OutFile "${BIN_ROOT}\..\${OUTFILE_${_BUILDARCH}}" + +InstallDir "(na)" + +SpaceTexts "none" + +ShowInstDetails nevershow + +RequestExecutionLevel admin + +;---------------------------------------------------------------------------- +; +;---------------------------------------------------------------------------- + +VIProductVersion "${VERSION}.0.0" + +VIAddVersionKey "ProductName" "${PRODUCT_FULL_NAME}" +VIAddVersionKey "CompanyName" "${COMPANY_NAME}" +VIAddVersionKey "LegalCopyright" "${COPYRIGHT_STRING}" +VIAddVersionKey "FileDescription" "${PRODUCT_NAME} Installer" +VIAddVersionKey "FileVersion" "${VERSION}" +VIAddVersionKey "ProductVersion" "${VERSION}" + +;---------------------------------------------------------------------------- +; Pages +;---------------------------------------------------------------------------- + +!define MUI_ICON "..\apps\res\sandbox-full.ico" + +!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipLicensePage" +!insertmacro MUI_PAGE_LICENSE "LICENSE.TXT" + +Page custom InstallTypePage +!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipDirectoryPage" +!insertmacro MUI_PAGE_DIRECTORY + +!define MUI_PAGE_CUSTOMFUNCTION_SHOW "SetHeaderForRemove" +!insertmacro MUI_PAGE_INSTFILES + +Page custom DriverPage + +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_PAGE_CUSTOMFUNCTION_PRE "DisableBackButton" +!define MUI_FINISHPAGE_TITLE_3LINES +!insertmacro MUI_PAGE_FINISH + +;---------------------------------------------------------------------------- +; Languages +;---------------------------------------------------------------------------- + +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "Albanian" +!insertmacro MUI_LANGUAGE "Arabic" +!insertmacro MUI_LANGUAGE "Bulgarian" +!insertmacro MUI_LANGUAGE "SimpChinese" +!insertmacro MUI_LANGUAGE "TradChinese" +!insertmacro MUI_LANGUAGE "Croatian" +!insertmacro MUI_LANGUAGE "Czech" +!insertmacro MUI_LANGUAGE "Danish" +!insertmacro MUI_LANGUAGE "Dutch" +!insertmacro MUI_LANGUAGE "Estonian" +!insertmacro MUI_LANGUAGE "Farsi" +!insertmacro MUI_LANGUAGE "Finnish" +!insertmacro MUI_LANGUAGE "French" +!insertmacro MUI_LANGUAGE "German" +!insertmacro MUI_LANGUAGE "Greek" +!insertmacro MUI_LANGUAGE "Hebrew" +!insertmacro MUI_LANGUAGE "Hungarian" +!insertmacro MUI_LANGUAGE "Italian" +!insertmacro MUI_LANGUAGE "Indonesian" +!insertmacro MUI_LANGUAGE "Japanese" +!insertmacro MUI_LANGUAGE "Korean" +!insertmacro MUI_LANGUAGE "Macedonian" +!insertmacro MUI_LANGUAGE "Polish" +!insertmacro MUI_LANGUAGE "PortugueseBr" +!insertmacro MUI_LANGUAGE "Portuguese" +!insertmacro MUI_LANGUAGE "Russian" +!insertmacro MUI_LANGUAGE "Slovak" +!insertmacro MUI_LANGUAGE "Spanish" +!insertmacro MUI_LANGUAGE "Swedish" +!insertmacro MUI_LANGUAGE "Turkish" +!insertmacro MUI_LANGUAGE "Ukrainian" + +;!insertmacro MUI_LANGUAGE "Norwegian" +;!include "MyItalian.nlf" + +!macro MyLanguage MYLANG MYCP + !system "..\tools\iconv\iconv -f UTF-16 -t ${MYCP} ..\msgs\SbieRelease\NsisText_${MYLANG}.txt > ansi-My${MYLANG}.nlf" + !include "ansi-My${MYLANG}.nlf" + !delfile "ansi-My${MYLANG}.nlf" + +!macroend + +!insertmacro MyLanguage "English" LATIN1 +!insertmacro MyLanguage "Albanian" LATIN1 +!insertmacro MyLanguage "Arabic" CP1256 +!insertmacro MyLanguage "Bulgarian" CP1251 +!insertmacro MyLanguage "SimpChinese" CP936 +!insertmacro MyLanguage "TradChinese" CP950 +!insertmacro MyLanguage "Croatian" CP1250 +!insertmacro MyLanguage "Czech" CP1250 +!insertmacro MyLanguage "Danish" CP865 +!insertmacro MyLanguage "Dutch" LATIN1 +!insertmacro MyLanguage "Estonian" LATIN1 +!insertmacro MyLanguage "Farsi" CP1256 +!insertmacro MyLanguage "Finnish" LATIN1 +!insertmacro MyLanguage "French" LATIN1 +!insertmacro MyLanguage "German" LATIN1 +!insertmacro MyLanguage "Greek" CP1253 +!insertmacro MyLanguage "Hebrew" CP1255 +!insertmacro MyLanguage "Hungarian" CP1250 +!insertmacro MyLanguage "Italian" LATIN1 +!insertmacro MyLanguage "Indonesian" LATIN1 +!insertmacro MyLanguage "Japanese" CP932 +!insertmacro MyLanguage "Korean" CP949 +!insertmacro MyLanguage "Macedonian" CP1251 +!insertmacro MyLanguage "Polish" CP1250 +!insertmacro MyLanguage "PortugueseBr" LATIN1 +!insertmacro MyLanguage "Portuguese" LATIN1 +!insertmacro MyLanguage "Russian" CP1251 +!insertmacro MyLanguage "Slovak" CP1250 +!insertmacro MyLanguage "Spanish" LATIN1 +!insertmacro MyLanguage "Swedish" LATIN1 +!insertmacro MyLanguage "Turkish" CP1254 +!insertmacro MyLanguage "Ukrainian" CP1251 + +;---------------------------------------------------------------------------- +; Reserve Files +;---------------------------------------------------------------------------- + +ReserveFile "InstallType.ini" + +!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS + +ReserveFile "Warning.ini" + +ReserveFile "${BIN_ROOT}\KmdUtil.Exe" + +;---------------------------------------------------------------------------- +; Global Variables +;---------------------------------------------------------------------------- + +Var InstallType +Var LaunchControl +Var MustReboot +Var BundledInstall +Var DeleteSandboxieIni +;Var Win7Driver + +;---------------------------------------------------------------------------- +; macro InstallSystemDll +;---------------------------------------------------------------------------- + +!macro InstallSystemDll DllName Is64Bit + +IfFileExists "$SYSDIR\${DllName}" 0 +2 + StrCpy $1 1 ; already installed + +!if "${_BUILDARCH}" == "x64" +${If} ${Is64Bit} == false +DetailPrint "InstallSystemDll 32 ${DllSrcLocation64}\${DllName} $SYSDIR\${DllName}" +!insertmacro InstallLib DLL $1 REBOOT_NOTPROTECTED ${DllSrcLocation32}\${DllName} "$SYSDIR\${DllName}" $SYSDIR +${Else} +!define LIBRARY_X64 +DetailPrint "InstallSystemDll 64 ${DllSrcLocation64}\${DllName} $SYSDIR\${DllName}" +!insertmacro InstallLib DLL $1 REBOOT_NOTPROTECTED ${DllSrcLocation64}\${DllName} "$SYSDIR\${DllName}" $SYSDIR +!insertmacro EnableX64FSRedirection +!undef LIBRARY_X64 +${EndIf} +!else +!insertmacro InstallLib DLL $1 REBOOT_NOTPROTECTED ${DllSrcLocation32}\${DllName} "$SYSDIR\${DllName}" $SYSDIR +!endif + +!macroend + +;---------------------------------------------------------------------------- +; macro CompareDllVersions +;---------------------------------------------------------------------------- + +!macro CompareDllVersions DllName Version + + GetDllVersion "${DllName}" $R0 $R1 + + IntOp $R2 $R0 / 0x00010000 + IntOp $R3 $R0 & 0x0000FFFF + IntOp $R0 $R1 >> 16 + IntOp $R4 $R0 & 0x0000FFFF + IntOp $R5 $R1 & 0x0000FFFF + StrCpy $0 "$R2.$R3.$R4.$R5" + ${VersionCompare} "$0" "${Version}" $R0 + ; result in $R0 + ; $R0=0 Versions are equal + ; $R0=1 DllName version is newer + ; $R0=2 DllName version is older +!macroend + +;---------------------------------------------------------------------------- +; macro InstallVCRedist +;---------------------------------------------------------------------------- + +; eventually, the 64 bit ver will need to include the 32 bit VC Redist. Not required right now. + +!macro InstallVCRedist + +!if "${_BUILDARCH}" == "x64" + File "${VCRedist64SrcLocation}" +!else + File "${VCRedist32SrcLocation}" +!endif + +!if "${_BUILDARCH}" == "x64" + ExecWait '"${VCRedist64SrcLocation}" /passive' $0 +!else + ExecWait '"${VCRedist32SrcLocation}" /passive' $0 +!endif + +StrCmp $0 "0" +3 + MessageBox MB_OK|MB_ICONSTOP "Installation of VCRedist failed: $0" + Quit + +!macroend + +;---------------------------------------------------------------------------- +; macro DownloadInstallVCRedist +;---------------------------------------------------------------------------- + +!macro DownloadInstallVCRedist + +${If} ${RunningX64} +!insertmacro DisableX64FSRedirection +${EndIf} + +!insertmacro CompareDllVersions "$SYSDIR\mfc100u.dll" "10.0.40219.325" +StrCmp $R0 "2" Update_Version +!insertmacro CompareDllVersions "$SYSDIR\msvcr100.dll" "10.0.40219.325" +StrCmp $R0 "2" Update_Version +Goto DownloadInstallVCRedist_Exit ; versions are all up to date + +Update_Version: + +StrCpy $1 "https://www.sandboxie.com/support" +!if "${_BUILDARCH}" == "x64" + StrCpy $1 "$1/X64" + StrCpy $2 "vcredist_x64.exe" +!else + StrCpy $2 "vcredist_x86.exe" +!endif + +NSISdl::download /TIMEOUT=30000 $1/$2 $TEMP\$2 +Pop $R0 ;Get the return value + StrCmp $R0 "success" +3 + MessageBox MB_RETRYCANCEL|MB_ICONSTOP "Download failed for: $1/$2.$\nError: $R0.$\nRerun the install when problem corrected." IDRETRY -3 + Quit + +ExecWait '"$TEMP\$2" /passive' $0 +StrCmp $0 "0" +3 + MessageBox MB_OK|MB_ICONSTOP "Installation of VCRedist failed: $0.$\nRerun the install when problem corrected." + Quit + +DownloadInstallVCRedist_Exit: + +${If} ${RunningX64} +!insertmacro EnableX64FSRedirection +${EndIf} + +!macroend + +;---------------------------------------------------------------------------- +; Function .onInit +;---------------------------------------------------------------------------- + +Function .onInit + +; +; Initialize variables +; + + StrCpy $InstallType "Unknown" + StrCpy $LaunchControl "N" + StrCpy $MustReboot "N" + StrCpy $BundledInstall "N" + StrCpy $DeleteSandboxieIni "Y" + StrCpy $Language "0" + +; +; Force InstallType if requested on command line +; + + Call GetParameters + Pop $0 + StrLen $1 $0 + +Force_Loop: + + IntCmp $1 4 Force_Done Force_Done + StrCpy $2 $0 $1 + IntOp $1 $1 - 1 + + StrCmp $2 "/lang=" Force_Language + StrCmp $2 "/install_bundled" Force_Bundled_Install + StrCmp $2 "/install" Force_Install + StrCmp $2 "/upgrade" Force_Upgrade + StrCmp $2 "/remove" Force_Remove + + Goto Force_Loop + +Force_Language: + + StrCpy $Language $0 $1 6 + StrLen $2 $Language + IntOp $2 $2 + 7 ; skip "/lang=NNNN " + StrLen $1 $0 + IntOp $1 $1 - $2 + StrCpy $0 $0 $1 $2 + StrLen $1 $0 + Goto Force_Loop + +Force_Bundled_Install: + + StrCpy $BundledInstall "Y" + StrCpy $LaunchControl "N" + Goto Force_Done + +Force_Install: + + StrCpy $InstallType "Install" + Goto Force_Done + +Force_Upgrade: + + StrCpy $InstallType "Upgrade" + Goto Force_Done + +Force_Remove: + + StrCpy $InstallType "Remove" + Goto Force_Done + +Force_Done: + +; +; Detect existing installation, unless given by /D parameter +; + + StrCmp $INSTDIR "(na)" 0 InstDir_Done + + !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "SYSTEM\CurrentControlSet\Services\${SBIEDRV}" "ImagePath" + Pop $0 + StrCmp $0 "" 0 InstDir_CheckPath + + Goto InstDir_ProgramFiles + +InstDir_CheckPath: + + StrCpy $1 $0 4 0 + StrCmp $1 "\??\" 0 InstDir_Check_Suffix + StrCpy $0 $0 "" 4 + +InstDir_Check_Suffix: + + Push -12 + Pop $2 + StrCpy $1 $0 "" $2 + StrCmp $1 "\${SBIEDRV_SYS}" InstDir_Suffix_Good + + Goto InstDir_ProgramFiles + +InstDir_Suffix_Good: + + StrCpy $0 $0 $2 + Goto InstDir_Found + +InstDir_ProgramFiles: + + !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion" "ProgramFilesDir" + Pop $0 + StrCmp $0 "" InstDir_Done + StrCpy $0 "$0\${PRODUCT_FULL_NAME}" + +InstDir_Found: + + StrCpy $INSTDIR $0 + +InstDir_Done: + +; +; Detect InstallType if not yet known +; + + StrCmp $InstallType "Unknown" 0 InstType_Done + + StrCmp "$EXEDIR" "$INSTDIR" InstType_Remove + StrCmp "$EXEDIR" "$INSTDIR\" InstType_Remove + StrCmp "$EXEDIR\" "$INSTDIR" InstType_Remove + StrCmp "$EXEDIR" "$WINDIR\Installer" InstType_Remove + StrCmp "$EXEDIR" "$WINDIR\Installer\" InstType_Remove + StrCmp "$EXEDIR\" "$WINDIR\Installer" InstType_Remove + + IfFileExists $INSTDIR\${SBIEDRV_SYS} InstType_Upgrade + IfFileExists $INSTDIR\${SBIESVC_EXE} InstType_Upgrade + IfFileExists $INSTDIR\${SBIEDLL_DLL} InstType_Upgrade + + ; default InstallType for a new install, unless we detected an installation + + StrCpy $InstallType "Install" + Goto InstType_Done + +InstType_Upgrade: + + StrCpy $InstallType "Upgrade" + Goto InstType_Done + +InstType_Remove: + + StrCpy $InstallType "Remove" + +InstType_Done: + +; +; Language +; + + StrCmp $Language "0" 0 Lang_Done + + ReadRegDWORD $0 HKLM "SYSTEM\CurrentControlSet\Services\${SBIESVC}" "Language" + IntCmp $0 1033 Lang_AutoSelect ; English + IntCmp $0 1052 Lang_AutoSelect ; Albanian + IntCmp $0 1025 Lang_AutoSelect ; Arabic + IntCmp $0 1026 Lang_AutoSelect ; Bulgarian + IntCmp $0 1050 Lang_AutoSelect ; Croatian + IntCmp $0 1029 Lang_AutoSelect ; Czech + IntCmp $0 1030 Lang_AutoSelect ; Danish + IntCmp $0 1043 Lang_AutoSelect ; Dutch + IntCmp $0 1061 Lang_AutoSelect ; Estonian + IntCmp $0 1065 Lang_AutoSelect ; Farsi + IntCmp $0 1035 Lang_AutoSelect ; Finnish + IntCmp $0 1036 Lang_AutoSelect ; French + IntCmp $0 1031 Lang_AutoSelect ; German + IntCmp $0 1032 Lang_AutoSelect ; Greek + IntCmp $0 1037 Lang_AutoSelect ; Hebrew + IntCmp $0 1038 Lang_AutoSelect ; Hungarian + IntCmp $0 1040 Lang_AutoSelect ; Italian + IntCmp $0 1057 Lang_AutoSelect ; Indonesian + IntCmp $0 1041 Lang_AutoSelect ; Japanese + IntCmp $0 1042 Lang_AutoSelect ; Korean + IntCmp $0 1071 Lang_AutoSelect ; Macedonian + IntCmp $0 1045 Lang_AutoSelect ; Polish + IntCmp $0 1046 Lang_AutoSelect ; Portuguese (Brasil) + IntCmp $0 2070 Lang_AutoSelect ; Portuguese (Portugal) + IntCmp $0 1049 Lang_AutoSelect ; Russian + IntCmp $0 1051 Lang_AutoSelect ; Slovak + IntCmp $0 1034 Lang_AutoSelect ; Spanish + IntCmp $0 1053 Lang_AutoSelect ; Swedish + IntCmp $0 1055 Lang_AutoSelect ; Turkish + IntCmp $0 1058 Lang_AutoSelect ; Ukrainian + IntCmp $0 1028 Lang_AutoSelect ; Chinese (Traditional) + IntCmp $0 2052 Lang_AutoSelect ; Chinese (Simplified) + StrCpy $0 1033 ; English - default + +Lang_AutoSelect: + + StrCpy $Language $0 + StrCmp $InstallType "Remove" Lang_Done + + !define MUI_LANGDLL_WINDOWTITLE "${NAME_${_BUILDARCH}}" + !insertmacro MUI_LANGDLL_DISPLAY + +Lang_Done: + +; +; Extract InstallOptions scripts +; + + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "InstallType.ini" + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "Warning.ini" + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function ConfirmRequirements +;---------------------------------------------------------------------------- + +Function ConfirmRequirements + +; +; Confirm we are on Windows XP or later +; + + !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "'Software\Microsoft\Windows NT\CurrentVersion'" "CurrentVersion" + Pop $0 + StrCmp $0 "" SystemCheck_Fail + ;StrCmp $0 "5.1" SystemCheck_Done_XP_2003 + ;StrCmp $0 "5.2" SystemCheck_Done_XP_2003 + StrCmp $0 "6.0" SystemCheck_Done + StrCmp $0 "6.1" SystemCheck_Done + StrCmp $0 "6.2" SystemCheck_Done + StrCmp $0 "6.3" SystemCheck_Done + StrCmp $0 "6.4" SystemCheck_Done + Goto SystemCheck_Fail + +SystemCheck_Fail: + + StrCmp $InstallType "Remove" SystemCheck_Force_Remove + + MessageBox MB_OK|MB_ICONSTOP "$(MSG_8041)$\n\ + Windows Vista, Windows 7, Windows 8, Windows 10." + StrCmp $InstallType "Upgrade" SystemCheck_Force_Remove + Quit + +;SystemCheck_Done_XP_2003: + +!if "${_BUILDARCH}" == "x64" + + MessageBox MB_OK|MB_ICONSTOP "$(MSG_8041)$\n\ + (64-bit) Windows Vista (Service Pack 1), Windows 7, Windows 8, Windows 10." + StrCmp $InstallType "Upgrade" SystemCheck_Force_Remove + Quit + +!endif + + Goto SystemCheck_Done + +SystemCheck_Force_Remove: + + StrCpy $InstallType "ForceRemove" + Goto SystemCheck_Done + +SystemCheck_Done: + + !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "'Software\Microsoft\Windows\CurrentVersion\Uninstall\Sandboxie-Plus_is1'" "UninstallString" + Pop $0 + StrCmp $0 "" PlusCheck_Done + + MessageBox MB_OK|MB_ICONSTOP "Sandboxie Plus installation detected, you must uninstall it first before you can downgrade to Sandboxie Classic!" + Quit + +PlusCheck_Done: + +; +; Confirm we are running as Administrator +; + + Call IsUserAdmin + Pop $0 + StrCmp $0 1 AdminCheck_Done + + MessageBox MB_OK|MB_ICONSTOP $(MSG_8042) + Quit + +AdminCheck_Done: + +; +; Confirm that Installer bitness is same as that of the operating system +; Our installer is a 32-bit program, so if WOW-64 mode is enabled in the +; process, it means we are in 64-bit Windows +; + + Call IsWow64 + Pop $0 + +!if "${_BUILDARCH}" == "x64" + + StrCmp $0 "Y" InitCheck_Done + MessageBox MB_OK|MB_ICONSTOP $(MSG_8044) + Quit + +!else + + StrCmp $0 "N" InitCheck_Done + MessageBox MB_OK|MB_ICONSTOP $(MSG_8043) + Quit + +!endif + +InitCheck_Done: + + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function SkipLicensePage +;---------------------------------------------------------------------------- + +Function SkipLicensePage + +; +; Confirm minimum Windows version and use of Administrator account +; + + Call ConfirmRequirements + +; +; Skip license page if not Install mode +; + +; StrCmp $InstallType "Install" SkipLicensePage_Done + StrCmp $InstallType "Remove" 0 SkipLicensePage_Done + + Abort + +SkipLicensePage_Done: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function InstallTypePage +;---------------------------------------------------------------------------- + +Function InstallTypePage + +; +; Provisional windows 7 support +; +; !insertmacro Reg_ReadString "" ${HKEY_LOCAL_MACHINE} "'Software\Microsoft\Windows NT\CurrentVersion'" "CurrentVersion" +; Pop $0 +; StrCmp $0 "6.0" w7_Drv_ask +; StrCmp $0 "6.1" w7_Drv_ask +; Goto w7_Skip +; +;w7_Drv_ask: +; +; MessageBox MB_YESNO|MB_ICONQUESTION "Windows 7 requires a provisional driver package. You will have to download it from the GitHub release page https://github.com/sandboxie-plus/Sandboxie/releases/$\r$\nDo you have it downloaded?" IDYES w7_Drv_ok +; +; MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to open the download page in your default web browser?" IDNO w7_Drv_cancel +; ExecShell "open" "https://github.com/sandboxie-plus/Sandboxie/releases/" +; Goto w7_Drv_ok +; +;w7_Drv_cancel: +; MessageBox MB_OK|MB_ICONSTOP "On windows 7 the install can not continue without the provisional driver package" +; +; Quit +; +;w7_Drv_ok: +; +; nsDialogs::SelectFileDialog open "" "Driver binary (*.${_W7DRV_COMPAT}.rc4)|*.${_W7DRV_COMPAT}.rc4|All Files|*.*" +; +; Pop $0 +; StrCmp $0 "" w7_Drv_cancel +; StrCpy $Win7Driver $0 +; +;; MessageBox MB_OK $Win7Driver +; +;w7_Skip: + + StrCmp $InstallType "Install" InstallType_Done + + StrCmp $InstallType "Upgrade" InstallType_SetFolder + + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 4" "State" "0" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 5" "State" "1" + + StrCmp $InstallType "ForceRemove" 0 InstallType_SetFolder + StrCpy $InstallType "Remove" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 4" "Flags" "DISABLED" + +InstallType_SetFolder: + + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 2" "State" "$INSTDIR" + + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Settings" "RTL" "$(^RTL)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Settings" "NextButtonText" "$(MSG_8003)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 1" "Text" "$(MSG_8004)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 3" "Text" "$(MSG_8005)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 4" "Text" "$(MSG_8006)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 5" "Text" "$(MSG_8007)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 6" "Text" "$(MSG_8008)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallType.ini" "Field 7" "Text" "$(MSG_8009)" + + !insertmacro MUI_HEADER_TEXT "$(MSG_8001)" "$(MSG_8002)" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY "InstallType.ini" + +InstallType_Done: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function SkipDirectoryPage +;---------------------------------------------------------------------------- + +Function SkipDirectoryPage + + StrCmp $InstallType "Install" SkipDirectoryPage_Done + +; +; Set InstallType according to selected radio button +; + + !insertmacro MUI_INSTALLOPTIONS_READ $4 "InstallType.ini" "Field 4" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $5 "InstallType.ini" "Field 5" "State" + + StrCmp $4 "1" SetType_Upgrade + StrCmp $5 "1" SetType_Remove + Goto SetType_Done + +SetType_Upgrade: + + StrCpy $InstallType "Upgrade" + Goto SetType_Done + +SetType_Remove: + + StrCpy $InstallType "Remove" + Goto SetType_Done + +SetType_Done: + + Abort + +SkipDirectoryPage_Done: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function SetHeaderForRemove +;---------------------------------------------------------------------------- + +Function SetHeaderForRemove + + StrCmp $InstallType "Remove" 0 SetHeaderForRemove_Done + + !insertmacro MUI_HEADER_TEXT "Uninstalling" "$(MSG_8016)" + +; +; Ask about removing settings +; + + IfSilent SetHeaderForRemove_Done + + MessageBox MB_YESNO|MB_ICONQUESTION "$(MSG_8054)" IDNO SetHeaderForRemove_Done + + StrCpy $DeleteSandboxieIni "N" + +SetHeaderForRemove_Done: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Install Section +;---------------------------------------------------------------------------- + +; We download various files during install just to keep stats on activity + +Function DownloadStatPng +; +; Pop $0 ; Get the parameter (file name to download) +; ${If} ${RunningX64} +; SetRegView 64 +; ${EndIf} +; ReadRegStr $1 HKLM "SOFTWARE\Microsoft\Cryptography" "MachineGuid" +; StrCpy $2 "https://www.sandboxie.com/img/$0?SessionId=$1" +; +; ;NSISdl::download_quiet /TIMEOUT=3000 $2 $TEMP\$0 +; inetc::get /SILENT /CONNECTTIMEOUT=5000 /RECEIVETIMEOUT=5000 $2 $TEMP\$0 /END +; Pop $0 ;Get the return value +; ;MessageBox MB_OK|MB_ICONSTOP "DownloadStatPng: $2$\n$0" +; ${If} ${RunningX64} +; SetRegView 32 +; ${EndIf} +FunctionEnd + + +Section "" + +;LogSet on +; +; Prepare KmdUtil and then use it to warn about running programs +; + + File "/oname=$PLUGINSDIR\KmdUtil.exe" "${BIN_ROOT}\KmdUtil.Exe" + File "/oname=$PLUGINSDIR\${SBIEMSG_DLL}" "${BIN_ROOT}\SbieMsg.dll" + File "/oname=$PLUGINSDIR\${SBIEDLL_DLL}" "${BIN_ROOT}\${SBIEDLL_DLL}" + + StrCpy $0 "" + IfSilent 0 +2 + StrCpy $0 "_silent" + StrCpy $0 "scandll$0" + Push $0 + Call KmdUtilX + IfErrors FindWindow_Abort + +; +; Close Sandboxie Control if it is running +; + +FindWindow_Check: + + FindWindow $0 "${SANDBOXIE_CONTROL}WndClass" "" + StrCmp $0 0 FindWindow_Done + + SendMessage $0 ${WM_DESTROY} 0 0 /TIMEOUT=2000 + Sleep 1000 + + FindWindow $0 "${SANDBOXIE_CONTROL}WndClass" "" + StrCmp $0 0 FindWindow_Done + + MessageBox MB_OKCANCEL|MB_ICONQUESTION "$(MSG_8051)" IDCANCEL FindWindow_Abort + + Goto FindWindow_Check + +FindWindow_Abort: + + Abort + +FindWindow_Done: + +; +; Stop Sandboxie Service +; + + Push "stop ${SBIESVC}" + Call KmdUtil + + ; Windows 10 doesn't allow copying a .sys on top of a running driver. So we have to stop it here. + Push "stop ${SBIEDRV}" + Call KmdUtil +; +; Branch to Install, Upgrade or Remove according to install mode +; + + StrCmp $InstallType "Install" Install + + ReadRegStr $0 HKLM "SOFTWARE\System Safety\System Safety Monitor\2" "Version" + StrCmp $0 "" NoSystemSafetyMonitor + StrCpy $MustReboot "Y" +NoSystemSafetyMonitor: + + ReadRegStr $0 HKLM "SOFTWARE\TrendMicro\PC-cillin" "version" + StrCmp $0 "" NoTrendMicro + StrCpy $MustReboot "Y" +NoTrendMicro: + + StrCmp $InstallType "Upgrade" Upgrade + StrCmp $InstallType "Remove" Remove + + Abort + +; +; Install and Upgrade +; + +Upgrade: + + Call DeleteProductKey + Call DeleteSystemKeys + Call DeleteShortCuts + ; we use this file download as a total # of upgrades counter + Push "sbietrayfullup.png" + Call DownloadStatPng + Goto Install2 + +Install: + + ; we use this file download as a total # of installs counter + Push "sbietrayfull.png" + Call DownloadStatPng + +Install2: + Call WriteProgramFiles + + !define DllSrcLocation32 "..\Build\Support" + +; MS libraries are all static with Visual Studio 2015 +;!if "${_BUILDARCH}" == "x64" +; !define DllSrcLocation64 "..\Build\Support\x64" +; !insertmacro InstallSystemDll "msvcr100.dll" false +; !insertmacro InstallSystemDll "mfc100u.dll" true +; !insertmacro InstallSystemDll "msvcr100.dll" true +; !insertmacro InstallSystemDll "msvcp100.dll" true +;!endif + +;!ifdef INCLUDE_VCREDIST_DNLD +; !insertmacro DownloadInstallVCRedist +;!else +; !insertmacro InstallSystemDll "msvcr100.dll" false +; !insertmacro InstallSystemDll "mfc100u.dll" false +; !insertmacro InstallSystemDll "msvcp100.dll" false +;!endif + + Call WriteProductKey + Call WriteShortCuts + + Goto Section_Done + +; +; Remove +; + +Remove: + + ; we use this file download as a total # of uninstalls counter + Push "sbietrayempty.png" + Call DownloadStatPng + Call DeleteProductKey + Call DeleteProgramFiles + Call DeleteSystemKeys + Call DeleteShortCuts + + Goto Section_Done + +; +; Done +; + +Section_Done: + + IfSilent 0 Section_Done2 + Call DriverPage + +Section_Done2: + +SectionEnd + +;---------------------------------------------------------------------------- +; Function WriteProgramFiles +;---------------------------------------------------------------------------- + +Function WriteProgramFiles + + SetOverwrite try + + SetOutPath "$INSTDIR" + + StrCpy $2 0 + +WriteLoop: + + ; + ; Write files + ; + + File /oname=${SBIEDLL_DLL} "${BIN_ROOT}\${SBIEDLL_DLL}" + + File /oname=${SBIESVC_EXE} "${BIN_ROOT}\SbieSvc.exe" + File /oname=${SBIESVC_EXE}.sig "${BIN_ROOT}\SbieSvc.exe.sig" + +!if "${_BUILDARCH}" == "x64" + + CreateDirectory $INSTDIR\32 + + File /oname=32\${SBIEDLL_DLL} "${BIN_ROOT_Win32}\${SBIEDLL_DLL}" + + File /oname=32\${SBIESVC_EXE} "${BIN_ROOT_Win32}\SbieSvc.exe" + +!endif + + File /oname=${SBIEMSG_DLL} "${BIN_ROOT}\SbieMsg.dll" + + File /oname=${SBIEDRV_SYS} "${BIN_ROOT}\SbieDrv.sys" +; File /oname=${SBIEDRV_SYS4} "${BIN_ROOT}\SbieDrv.sys.rc4" +; File /oname=${SBIEDRV_SYSX} "${BIN_ROOT}\SbieDrv.sys.w10" + + File /oname=KmdUtil.exe "${BIN_ROOT}\KmdUtil.Exe" + + File /oname=SboxHostDll.dll "${BIN_ROOT}\SboxHostDll.dll" + + File /oname=${SANDBOXIE}RpcSs.exe "${BIN_ROOT}\SandboxieRpcSs.exe" + File /oname=${SANDBOXIE}DcomLaunch.exe "${BIN_ROOT}\SandboxieDcomLaunch.exe" + File /oname=${SANDBOXIE}BITS.exe "${BIN_ROOT}\SandboxieBITS.exe" + File /oname=${SANDBOXIE}Crypto.exe "${BIN_ROOT}\SandboxieCrypto.exe" + File /oname=${SANDBOXIE}WUAU.exe "${BIN_ROOT}\SandboxieWUAU.exe" + + File /oname=${START_EXE} "${BIN_ROOT}\Start.exe" + + File /oname=${SBIECTRL_EXE} "${BIN_ROOT}\SbieCtrl.exe" + File /oname=${SBIECTRL_EXE}.sig "${BIN_ROOT}\SbieCtrl.exe.sig" + + File "..\install\Templates.ini" + + File "Manifest0.txt" + File "Manifest1.txt" + File "Manifest2.txt" + + File /oname=${SBIEINI_EXE} "${BIN_ROOT}\SbieIni.exe" + + ;File "${BIN_ROOT}\License.exe" + + File "LICENSE.TXT" + + ; + ; Check for files being held + ; + + IfErrors 0 WriteOk + + IntCmp $2 5 WriteError + IntOp $2 $2 + 1 + Sleep 1000 + Goto WriteLoop + +WriteError: + + IfSilent WriteAbort + StrCpy $2 0 + MessageBox MB_OKCANCEL|MB_ICONSTOP $(MSG_8052) IDOK WriteLoop + +WriteAbort: + + Abort + +WriteOk: + + SetOverwrite on + + ; + ; Create shortcut + ; + + CreateShortCut "$INSTDIR\QuickLaunch.lnk" "$INSTDIR\${START_EXE}" default_browser "" "" SW_SHOWNORMAL "" "$(MSG_8026)" + + ; + ; Copy this Installer program to the Windows\Installer directory + ; + + StrCmp $BundledInstall "Y" SkipCopyInstaller + + System::Call 'Kernel32::GetModuleFileNameA(i 0, t .r0, i 1024) i r1' + ; $0 --> Installer Filename + + CopyFiles "$0" "$WINDIR\Installer\${OUTFILE_${_BUILDARCH}}" + +SkipCopyInstaller: + + ; + ; Delete old files + ; + + Delete "$DESKTOP\${PRODUCT_NAME} Quick Launch.lnk" + Delete "$QUICKLAUNCH\${PRODUCT_NAME} Quick Launch.lnk" + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function DeleteProgramFiles +;---------------------------------------------------------------------------- + +Function DeleteProgramFiles + +; +; Delete program files +; + + Delete "$INSTDIR\${SBIEDLL_DLL}" + + Delete "$INSTDIR\${SBIESVC_EXE}" + Delete "$INSTDIR\${SBIESVC_EXE}.sig" + +!if "${_BUILDARCH}" == "x64" + + Delete "$INSTDIR\32\${SBIEDLL_DLL}" + + Delete "$INSTDIR\32\${SBIESVC_EXE}" + + RMDir "$INSTDIR\32" + +!endif + + Delete "$INSTDIR\${SBIEMSG_DLL}" + + Delete "$INSTDIR\${SBIEDRV_SYS}" +; Delete "$INSTDIR\${SBIEDRV_SYS4}" +; Delete "$INSTDIR\${SBIEDRV_SYSX}" + + Delete "$INSTDIR\KmdUtil.exe" + + Delete "$INSTDIR\SboxHostDll.dll" + + Delete "$INSTDIR\boxHostDll.dll" + + Delete "$INSTDIR\${SANDBOXIE}WUAU.exe" + Delete "$INSTDIR\${SANDBOXIE}EventSys.exe" + Delete "$INSTDIR\${SANDBOXIE}Crypto.exe" + Delete "$INSTDIR\${SANDBOXIE}BITS.exe" + Delete "$INSTDIR\${SANDBOXIE}DcomLaunch.exe" + Delete "$INSTDIR\${SANDBOXIE}RpcSs.exe" + + Delete "$INSTDIR\${START_EXE}" + + Delete "$INSTDIR\${SBIECTRL_EXE}" + Delete "$INSTDIR\${SBIECTRL_EXE}.sig" + + Delete "$INSTDIR\Templates.ini" + + Delete "$INSTDIR\Manifest0.txt" + Delete "$INSTDIR\Manifest1.txt" + Delete "$INSTDIR\Manifest2.txt" + + Delete "$INSTDIR\${SBIEINI_EXE}" + + Delete "$INSTDIR\LICENSE.EXE" + + Delete "$INSTDIR\LICENSE.TXT" + +; +; Delete installer +; + + Delete /REBOOTOK "$INSTDIR\${OUTFILE_Win32}" + Delete /REBOOTOK "$INSTDIR\${OUTFILE_x64}" + Delete /REBOOTOK "$INSTDIR\${OUTFILE_BOTH}" + Delete /REBOOTOK "$WINDIR\Installer\${OUTFILE_Win32}" + Delete /REBOOTOK "$WINDIR\Installer\${OUTFILE_x64}" + Delete /REBOOTOK "$WINDIR\Installer\${OUTFILE_BOTH}" + +; +; Delete shortcuts +; + + Delete "$INSTDIR\QuickLaunch.lnk" + + Push "$DESKTOP" + Call DeleteDesktopShortCuts + + Push "$QUICKLAUNCH" + Call DeleteDesktopShortCuts + + RMDir /r "$SENDTO\${PRODUCT_NAME}" + Delete "$SENDTO\${PRODUCT_NAME} - *.lnk" + +; +; Delete configuration files +; + + StrCmp $DeleteSandboxieIni "N" SkipDeleteSandboxieIni + Delete "$INSTDIR\${SANDBOXIE_INI}" + Delete "$WINDIR\${SANDBOXIE_INI}" +SkipDeleteSandboxieIni: + +; +; Delete installation folder +; + + RMDir "$INSTDIR" + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function WriteProductKey +;---------------------------------------------------------------------------- + +Function WriteProductKey + +; +; Create key for Add/Remove Programs +; + + StrCmp $BundledInstall "Y" SkipAddRemovePrograms + + !insertmacro Reg_CreateKey "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall" "${PRODUCT_NAME}" + !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" '"${NAME_${_BUILDARCH}}"' + !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" '$INSTDIR\Start.exe' + !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" '"${VERSION}"' + !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "Publisher" '"${COMPANY_NAME}"' + !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" `'"$WINDIR\Installer\${OUTFILE_${_BUILDARCH}}" /remove'` + +; +; Create GUID value for CancelAutoplay functionality in Sandboxie Control +; + + !insertmacro Reg_TestKey "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID" + Pop $0 + StrCmp $0 "0" CancelAutoplay_Done + !insertmacro Reg_WriteString "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID" "${MY_AUTOPLAY_CLSID}" '""' +CancelAutoplay_Done: + +SkipAddRemovePrograms: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function DeleteProductKey +;---------------------------------------------------------------------------- + +Function DeleteProductKey + +; +; Delete key for Add/Remove Programs +; + + !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Uninstall" "${PRODUCT_NAME}" + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function WriteShortCuts +;---------------------------------------------------------------------------- + +Function WriteShortCuts + + StrCmp $BundledInstall "Y" SkipWriteShortCuts + + SetShellVarContext all + + CreateDirectory "$SMPROGRAMS\${PRODUCT_FULL_NAME}" + CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8021)" "$INSTDIR\${START_EXE}" "/box:__ask__ run_dialog" "" "" SW_SHOWNORMAL "" "$(MSG_8022)" + CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8023)" "$INSTDIR\${START_EXE}" "/box:__ask__ start_menu" "" "" SW_SHOWNORMAL "" "$(MSG_8024)" + CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8025)" "$INSTDIR\${START_EXE}" "default_browser" "" "" SW_SHOWNORMAL "" "$(MSG_8026)" + CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8027)" "$INSTDIR\${START_EXE}" "." "" "" SW_SHOWNORMAL "" "$(MSG_8028)" + CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8029)" "$INSTDIR\${SBIECTRL_EXE}" "/open" "" "" SW_SHOWNORMAL "" "$(MSG_8030)" + CreateShortCut "$SMPROGRAMS\${PRODUCT_FULL_NAME}\$(MSG_8031)" "$WINDIR\Installer\${OUTFILE_${_BUILDARCH}}" "/remove" "" "" SW_SHOWNORMAL "" "$(MSG_8032)" + +SkipWriteShortCuts: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function DeleteShortCuts +;---------------------------------------------------------------------------- + +Function DeleteShortCuts + + SetShellVarContext all + Call DeleteShortCuts_2 + + SetShellVarContext current + Call DeleteShortCuts_2 + +FunctionEnd + +Function DeleteShortCuts_2 + + RMDir /r "$SMPROGRAMS\${PRODUCT_FULL_NAME}" + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function DeleteDesktopShortCuts +;---------------------------------------------------------------------------- + +Function DeleteDesktopShortCuts + + Pop $1 + Delete "$1\${PRODUCT_NAME} Quick Launch.lnk" + + ; delete #8025.lnk in selected language and in English + Delete "$1\$(MSG_8025)" + Delete "$1\Run Web browser sandboxed.lnk" + + ; delete #8033.lnk in selected language and in English + Delete "$1\$(MSG_8033)" + Delete "$1\Sandboxed Web Browser.lnk" + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function DeleteSystemKeys +;---------------------------------------------------------------------------- + +Function DeleteSystemKeys + + StrCmp $InstallType "Remove" 0 ShellKey_Folder_Done + +; +; Delete SandboxieControl value from Windows\Run key +; + + !insertmacro Reg_ReadString "" ${HKEY_CURRENT_USER} "Software\Microsoft\Windows\CurrentVersion\Run" "${SANDBOXIE_CONTROL}" + Pop $0 + StrCmp $0 "" RunKey_Done + + !insertmacro Reg_DeleteValue "" ${HKEY_CURRENT_USER} "Software\Microsoft\Windows\CurrentVersion\Run" "${SANDBOXIE_CONTROL}" + +RunKey_Done: + +; +; Delete GUID value for CancelAutoplay functionality in Sandboxie Control +; + + !insertmacro Reg_DeleteValue "" ${HKEY_LOCAL_MACHINE} "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID" "${MY_AUTOPLAY_CLSID}" + +; +; Delete sandbox key from HKCR\*\shell key +; + + !insertmacro Reg_TestKey "" ${HKEY_CLASSES_ROOT} "*\shell\${SANDBOX_VERB}" + Pop $0 + StrCmp $0 "0" ShellKey_Star_Done + + !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "*\shell\${SANDBOX_VERB}" "command" + !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "*\shell" "${SANDBOX_VERB}" + +ShellKey_Star_Done: + +; +; Delete sandbox key from HKCR\Folder\shell key +; + + !insertmacro Reg_TestKey "" ${HKEY_CLASSES_ROOT} "Folder\shell\${SANDBOX_VERB}" + Pop $0 + StrCmp $0 "0" ShellKey_Folder_Done + + !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "Folder\shell\${SANDBOX_VERB}" "command" + !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "Folder\shell" "${SANDBOX_VERB}" + +ShellKey_Folder_Done: + +; +; Delete keys which may have been left by old versions of Sandboxie +; +; HKLM\Software\Classes\*\shell\sandbox +; HKLM\Software\Classes\Folder\shell\sandbox +; HKCR\exefile\shell +; + +; +; Delete sandbox key from HKLM\Software\Classes\*\shell\sandbox +; + + !insertmacro Reg_TestKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\*\shell\${SANDBOX_VERB}" + Pop $0 + StrCmp $0 "0" HKLM_ShellKey_Star_Done + + !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\*\shell\${SANDBOX_VERB}" "command" + !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\*\shell" "${SANDBOX_VERB}" + +HKLM_ShellKey_Star_Done: + +; +; Delete sandbox key from HKLM\Software\Classes\Folder\shell key +; + + !insertmacro Reg_TestKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\Folder\shell\${SANDBOX_VERB}" + Pop $0 + StrCmp $0 "0" HKLM_ShellKey_Folder_Done + + !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\Folder\shell\${SANDBOX_VERB}" "command" + !insertmacro Reg_DeleteKey "" ${HKEY_LOCAL_MACHINE} "Software\Classes\Folder\shell" "${SANDBOX_VERB}" + +HKLM_ShellKey_Folder_Done: + +; +; Delete sandbox key from HKCR\exefile\shell key +; + + !insertmacro Reg_TestKey "" ${HKEY_CLASSES_ROOT} "exefile\shell\${SANDBOX_VERB}" + Pop $0 + StrCmp $0 "0" ShellKey_Exe_Done + + !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "exefile\shell\${SANDBOX_VERB}" "command" + !insertmacro Reg_DeleteKey "" ${HKEY_CLASSES_ROOT} "exefile\shell" "${SANDBOX_VERB}" + +ShellKey_Exe_Done: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function KmdUtilX +;---------------------------------------------------------------------------- + +Function KmdUtilX + + Pop $1 + DetailPrint "Running KmdUtil command: $1" + ;MessageBox MB_OK|MB_ICONEXCLAMATION "Running KmdUtil command: $1" + ClearErrors + SetDetailsPrint listonly + ExecWait '"$PLUGINSDIR\KmdUtil.exe" /lang=$Language $1' + SetDetailsPrint both + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function KmdUtil +;---------------------------------------------------------------------------- + +Function KmdUtil + + Call KmdUtilX + IfErrors KmdUtil_Errors + Goto KmdUtil_Done + +KmdUtil_Errors: + StrCmp $1 "stop ${SBIEDRV}" KmdUtil_SetReboot + DetailPrint "Could not process KmdUtil command: $1" + MessageBox MB_OK|MB_ICONEXCLAMATION "$(MSG_8053)$\n$\n$PLUGINSDIR\KmdUtil.exe $1" + StrCmp $1 "stop ${SBIESVC}" KmdUtil_SetReboot + Goto KmdUtil_Done + +KmdUtil_SetReboot: + SetRebootFlag true + +KmdUtil_Done: + ClearErrors + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function DriverPage +;---------------------------------------------------------------------------- + +Function DriverPage + +; +; Show the warning page, unless we're doing a Remove +; + + StrCmp $InstallType "Remove" Driver_Remove + + IfSilent Driver_Silent + + !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Settings" "RTL" "$(^RTL)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 1" "Text" "$(MSG_8012)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 2" "Text" "$(MSG_8013)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 4" "Text" "$(MSG_8014)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 5" "Text" "$(MSG_8015)" + + !insertmacro MUI_HEADER_TEXT "$(MSG_8010)" "$(MSG_8011)" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY_RETURN "Warning.ini" + + Pop $0 + StrCmp $0 "cancel" Driver_Done + +Driver_Silent: + +; +; For Install and Upgrade, install the driver +; + + StrCpy $0 'install ${SBIEDRV} "$INSTDIR\${SBIEDRV_SYS}" type=kernel start=demand "msgfile=$INSTDIR\${SBIEMSG_DLL}" altitude=${FILTER_ALTITUDE}' + Push $0 + Call KmdUtil + + Push 'install ${SBIESVC} "\"$INSTDIR\${SBIESVC_EXE}"\" type=own start=auto "display=${PRODUCT_FULL_NAME} Service" group=UIGroup "msgfile=$INSTDIR\${SBIEMSG_DLL}"' + Call KmdUtil + + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\${SBIESVC}" "Language" $Language + + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\${SBIESVC}" "PreferExternalManifest" 1 + + StrCmp $InstallType "Install" Driver_Install + StrCmp $InstallType "Upgrade" Driver_Upgrade + + Abort + +; +; For Upgrade, we make sure the driver is set to start manually, +; then stop driver (service was already stopped), and fallthrough +; to install processing to re-start the service (and driver). +; +; Note that KmdUtil "stop SbieDrv" will set the reboot flag, +; in case the driver cannot be unloaded. +; + +Driver_Upgrade: + + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\${SBIEDRV}" "Start" 3 + + Push "stop ${SBIEDRV}" + Call KmdUtil + + IfRebootFlag Driver_Done + StrCmp $MustReboot "N" Driver_Install + SetRebootFlag true + Goto Driver_Done + +; +; For Install, we start the driver and finish +; + +Driver_Install: + +; StrCmp $Win7Driver "" now_w7_Drv +; +;; MessageBox MB_OK $Win7Driver +; Delete "$INSTDIR\SbieDrv.sys.w10" +; Rename "$INSTDIR\SbieDrv.sys" "$INSTDIR\SbieDrv.sys.w10" +; CopyFiles $Win7Driver "$INSTDIR\SbieDrv.sys.rc4" +; +;now_w7_Drv: + + Push "start ${SBIESVC}" + Call KmdUtil + + StrCpy $LaunchControl "Y" + + Goto Driver_Done + +; +; For Remove, delete the driver and set the reboot flag +; + +Driver_Remove: + + Push "stop ${SBIESVC}" + Call KmdUtil + + Push "stop ${SBIEDRV}" + Call KmdUtil + + Push "delete ${SBIESVC}" + Call KmdUtil + + Push "delete ${SBIEDRV}" + Call KmdUtil + + StrCmp $MustReboot "N" Driver_Done + SetRebootFlag true + +Driver_Done: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function DisableBackButton +;---------------------------------------------------------------------------- + +Function DisableBackButton + + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "BackEnabled" "0" + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnabled" "0" + + StrCmp $InstallType "Remove" 0 DisableBackButton_Done + +; +; Replace "MUI_TEXT_FINISH_INFO_TEXT" with "MUI_UNTEXT_FINISH_INFO_TEXT". +; +; Note, for this to work, "Modern UI\System.nsh" must contain the following macro: +; +; !macro MUI_LANGUAGEFILE_UNLANGSTRING_PAGE_1 PAGE NAME +; LangString "${NAME}" 0 "${${NAME}}" +; !undef "${NAME}" +; !macroend +; +; and a line in System.nsh, in the macro "MUI_LANGUAGEFILE_END", must be changed from: +; +; !insertmacro MUI_LANGUAGEFILE_UNLANGSTRING_PAGE FINISH "MUI_UNTEXT_FINISH_INFO_TEXT" +; +; so that it invokes the special new _1 macro: +; +; !insertmacro MUI_LANGUAGEFILE_UNLANGSTRING_PAGE_1 FINISH "MUI_UNTEXT_FINISH_INFO_TEXT" +; + + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "$(MUI_UNTEXT_FINISH_INFO_TEXT)" + +DisableBackButton_Done: + +FunctionEnd + +;---------------------------------------------------------------------------- +; Function .onGUIEnd +;---------------------------------------------------------------------------- + +Function .onGUIEnd + + StrCmp $LaunchControl "Y" 0 Done + + ExecWait '"$INSTDIR\${START_EXE}" run_sbie_ctrl' $0 + +Done: + +FunctionEnd diff --git a/Sandboxie/install/release/release.manifest b/Sandboxie/install/release/release.manifest index 6b167bdc..cfbe65b7 100644 --- a/Sandboxie/install/release/release.manifest +++ b/Sandboxie/install/release/release.manifest @@ -1,18 +1,18 @@ - - - -Sandboxie Installer - - - - - - - - - - - - - - + + + +Sandboxie Installer + + + + + + + + + + + + + + diff --git a/Sandboxie/msgs/sbiemsg.def b/Sandboxie/msgs/sbiemsg.def index ad9999f0..2bd36c52 100644 --- a/Sandboxie/msgs/sbiemsg.def +++ b/Sandboxie/msgs/sbiemsg.def @@ -1 +1 @@ -LIBRARY SbieMsg +LIBRARY SbieMsg diff --git a/SandboxiePlus/MiscHelpers/LICENSE b/SandboxiePlus/MiscHelpers/LICENSE index 11e8067e..0a041280 100644 --- a/SandboxiePlus/MiscHelpers/LICENSE +++ b/SandboxiePlus/MiscHelpers/LICENSE @@ -1,165 +1,165 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/SandboxiePlus/MiscHelpers/MiscHelpers.pri b/SandboxiePlus/MiscHelpers/MiscHelpers.pri index fca21f58..b53a9c12 100644 --- a/SandboxiePlus/MiscHelpers/MiscHelpers.pri +++ b/SandboxiePlus/MiscHelpers/MiscHelpers.pri @@ -1,61 +1,61 @@ -# ---------------------------------------------------- -# This file is generated by the Qt Visual Studio Tools. -# ------------------------------------------------------ - -HEADERS += ./MiscHelpers.h \ - ./mischelpers_global.h \ - ./stdafx.h \ - ./Common/Common.h \ - ./Common/OtherFunctions.h \ - ./Common/DebugHelpers.h \ - ./Common/ExitDialog.h \ - ./Common/FlexError.h \ - ./Common/FlowLayout.h \ - ./Common/HistoryGraph.h \ - ./Common/IconExtreactor.h \ - ./Common/qRC4.h \ - ./Common/Xml.h \ - ./Common/CheckableMessageBox.h \ - ./Common/ComboInputDialog.h \ - ./Common/Finder.h \ - ./Common/ItemChooser.h \ - ./Common/KeyValueInputDialog.h \ - ./Common/ListItemModel.h \ - ./Common/MultiLineInputDialog.h \ - ./Common/PanelView.h \ - ./Common/ProgressDialog.h \ - ./Common/Settings.h \ - ./Common/SettingsWidgets.h \ - ./Common/SmartGridWidget.h \ - ./Common/SortFilterProxyModel.h \ - ./Common/SplitTreeView.h \ - ./Common/TabPanel.h \ - ./Common/TreeItemModel.h \ - ./Common/TreeViewEx.h \ - ./Common/TreeWidgetEx.h \ - ./Common/NetworkAccessManager.h - -SOURCES += ./MiscHelpers.cpp \ - ./stdafx.cpp \ - ./Common/CheckableMessageBox.cpp \ - ./Common/ComboInputDialog.cpp \ - ./Common/Common.cpp \ - ./Common/OtherFunctions.cpp \ - ./Common/DebugHelpers.cpp \ - ./Common/Finder.cpp \ - ./Common/FlowLayout.cpp \ - ./Common/IconExtreactor.cpp \ - ./Common/ItemChooser.cpp \ - ./Common/KeyValueInputDialog.cpp \ - ./Common/ListItemModel.cpp \ - ./Common/MultiLineInputDialog.cpp \ - ./Common/PanelView.cpp \ - ./Common/qRC4.cpp \ - ./Common/NetworkAccessManager.cpp \ - ./Common/Settings.cpp \ - ./Common/SettingsWidgets.cpp \ - ./Common/SmartGridWidget.cpp \ - ./Common/SplitTreeView.cpp \ - ./Common/TabPanel.cpp \ - ./Common/TreeItemModel.cpp \ - ./Common/Xml.cpp +# ---------------------------------------------------- +# This file is generated by the Qt Visual Studio Tools. +# ------------------------------------------------------ + +HEADERS += ./MiscHelpers.h \ + ./mischelpers_global.h \ + ./stdafx.h \ + ./Common/Common.h \ + ./Common/OtherFunctions.h \ + ./Common/DebugHelpers.h \ + ./Common/ExitDialog.h \ + ./Common/FlexError.h \ + ./Common/FlowLayout.h \ + ./Common/HistoryGraph.h \ + ./Common/IconExtreactor.h \ + ./Common/qRC4.h \ + ./Common/Xml.h \ + ./Common/CheckableMessageBox.h \ + ./Common/ComboInputDialog.h \ + ./Common/Finder.h \ + ./Common/ItemChooser.h \ + ./Common/KeyValueInputDialog.h \ + ./Common/ListItemModel.h \ + ./Common/MultiLineInputDialog.h \ + ./Common/PanelView.h \ + ./Common/ProgressDialog.h \ + ./Common/Settings.h \ + ./Common/SettingsWidgets.h \ + ./Common/SmartGridWidget.h \ + ./Common/SortFilterProxyModel.h \ + ./Common/SplitTreeView.h \ + ./Common/TabPanel.h \ + ./Common/TreeItemModel.h \ + ./Common/TreeViewEx.h \ + ./Common/TreeWidgetEx.h \ + ./Common/NetworkAccessManager.h + +SOURCES += ./MiscHelpers.cpp \ + ./stdafx.cpp \ + ./Common/CheckableMessageBox.cpp \ + ./Common/ComboInputDialog.cpp \ + ./Common/Common.cpp \ + ./Common/OtherFunctions.cpp \ + ./Common/DebugHelpers.cpp \ + ./Common/Finder.cpp \ + ./Common/FlowLayout.cpp \ + ./Common/IconExtreactor.cpp \ + ./Common/ItemChooser.cpp \ + ./Common/KeyValueInputDialog.cpp \ + ./Common/ListItemModel.cpp \ + ./Common/MultiLineInputDialog.cpp \ + ./Common/PanelView.cpp \ + ./Common/qRC4.cpp \ + ./Common/NetworkAccessManager.cpp \ + ./Common/Settings.cpp \ + ./Common/SettingsWidgets.cpp \ + ./Common/SmartGridWidget.cpp \ + ./Common/SplitTreeView.cpp \ + ./Common/TabPanel.cpp \ + ./Common/TreeItemModel.cpp \ + ./Common/Xml.cpp diff --git a/SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro b/SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro index 83a6b95a..8815c964 100644 --- a/SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro +++ b/SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro @@ -1,40 +1,40 @@ - -TEMPLATE = lib -TARGET = MiscHelpers -QT += core network widgets winextras -#CONFIG += debug -# DEFINES += QT_LARGEFILE_SUPPORT QTSERVICE_LIB QT_WIDGETS_LIB QT_QTSINGLEAPPLICATION_EXPORT -DEFINES += MISCHELPERS_LIB -#LIBS += -L"." -PRECOMPILED_HEADER = stdafx.h -#DEPENDPATH += . -#MOC_DIR += ./GeneratedFiles/$(ConfigurationName) -#OBJECTS_DIR += debug -#UI_DIR += ./GeneratedFiles -#RCC_DIR += ./GeneratedFiles -win32:LIBS += -lUser32 -lShell32 - -!mac:unix:QMAKE_LFLAGS += -Wl,-rpath,'\$\$ORIGIN' -mac:QMAKE_CXXFLAGS += -std=c++11 - -!win32:QMAKE_LFLAGS +=-rdynamic - -CONFIG(release, debug|release):{ -QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO -} - -CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Debug -CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Release -CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Debug -CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Release - -INCLUDEPATH += . -DEPENDPATH += . -#MOC_DIR += ./GeneratedFiles -#OBJECTS_DIR += ./ObjectFiles -#UI_DIR += ./GeneratedFiles -#RCC_DIR += ./GeneratedFiles - - -include(MiscHelpers.pri) + +TEMPLATE = lib +TARGET = MiscHelpers +QT += core network widgets winextras +#CONFIG += debug +# DEFINES += QT_LARGEFILE_SUPPORT QTSERVICE_LIB QT_WIDGETS_LIB QT_QTSINGLEAPPLICATION_EXPORT +DEFINES += MISCHELPERS_LIB +#LIBS += -L"." +PRECOMPILED_HEADER = stdafx.h +#DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles/$(ConfigurationName) +#OBJECTS_DIR += debug +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles +win32:LIBS += -lUser32 -lShell32 + +!mac:unix:QMAKE_LFLAGS += -Wl,-rpath,'\$\$ORIGIN' +mac:QMAKE_CXXFLAGS += -std=c++11 + +!win32:QMAKE_LFLAGS +=-rdynamic + +CONFIG(release, debug|release):{ +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO +QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +} + +CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Debug +CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Release +CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Debug +CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Release + +INCLUDEPATH += . +DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles +#OBJECTS_DIR += ./ObjectFiles +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles + + +include(MiscHelpers.pri) diff --git a/SandboxiePlus/QSbieAPI/LICENSE b/SandboxiePlus/QSbieAPI/LICENSE index 11e8067e..0a041280 100644 --- a/SandboxiePlus/QSbieAPI/LICENSE +++ b/SandboxiePlus/QSbieAPI/LICENSE @@ -1,165 +1,165 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/SandboxiePlus/QSbieAPI/QSbieAPI.pri b/SandboxiePlus/QSbieAPI/QSbieAPI.pri index 8bf6d33a..098c4554 100644 --- a/SandboxiePlus/QSbieAPI/QSbieAPI.pri +++ b/SandboxiePlus/QSbieAPI/QSbieAPI.pri @@ -1,30 +1,30 @@ -# ---------------------------------------------------- -# This file is generated by the Qt Visual Studio Tools. -# ------------------------------------------------------ - - -HEADERS += ./qsbieapi_global.h \ - ./stdafx.h \ - ../../Sandboxie/common/win32_ntddk.h \ - ./SbieDefs.h \ - ./SbieUtils.h \ - ./SbieAPI.h \ - ./SbieTrace.h \ - ./SbieStatus.h \ - ./Sandboxie/BoxedProcess.h \ - ./Sandboxie/SandBox.h \ - ./Sandboxie/SbieIni.h \ - ./Sandboxie/BoxBorder.h \ - ./Sandboxie/SbieTemplates.h \ - ./Helpers/NtIO.h - -SOURCES += ./stdafx.cpp \ - ./SbieAPI.cpp \ - ./SbieTrace.cpp \ - ./SbieUtils.cpp \ - ./Sandboxie/BoxBorder.cpp \ - ./Sandboxie/BoxedProcess.cpp \ - ./Sandboxie/SandBox.cpp \ - ./Sandboxie/SbieIni.cpp \ - ./Sandboxie/SbieTemplates.cpp \ - ./Helpers/NtIO.cpp +# ---------------------------------------------------- +# This file is generated by the Qt Visual Studio Tools. +# ------------------------------------------------------ + + +HEADERS += ./qsbieapi_global.h \ + ./stdafx.h \ + ../../Sandboxie/common/win32_ntddk.h \ + ./SbieDefs.h \ + ./SbieUtils.h \ + ./SbieAPI.h \ + ./SbieTrace.h \ + ./SbieStatus.h \ + ./Sandboxie/BoxedProcess.h \ + ./Sandboxie/SandBox.h \ + ./Sandboxie/SbieIni.h \ + ./Sandboxie/BoxBorder.h \ + ./Sandboxie/SbieTemplates.h \ + ./Helpers/NtIO.h + +SOURCES += ./stdafx.cpp \ + ./SbieAPI.cpp \ + ./SbieTrace.cpp \ + ./SbieUtils.cpp \ + ./Sandboxie/BoxBorder.cpp \ + ./Sandboxie/BoxedProcess.cpp \ + ./Sandboxie/SandBox.cpp \ + ./Sandboxie/SbieIni.cpp \ + ./Sandboxie/SbieTemplates.cpp \ + ./Helpers/NtIO.cpp diff --git a/SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro b/SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro index d98d39cd..971429d8 100644 --- a/SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro +++ b/SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro @@ -1,40 +1,40 @@ - -TEMPLATE = lib -TARGET = QSbieAPI -QT += core concurrent -#CONFIG += debug -# DEFINES += QT_LARGEFILE_SUPPORT QTSERVICE_LIB QT_WIDGETS_LIB QT_QTSINGLEAPPLICATION_EXPORT -DEFINES += QSBIEAPI_LIB -#LIBS += -L"." -PRECOMPILED_HEADER = stdafx.h -#DEPENDPATH += . -#MOC_DIR += ./GeneratedFiles/$(ConfigurationName) -#OBJECTS_DIR += debug -#UI_DIR += ./GeneratedFiles -#RCC_DIR += ./GeneratedFiles -LIBS += -lNtdll -lAdvapi32 -lOle32 -lUser32 -lShell32 -lGdi32 - -CONFIG(release, debug|release):{ -QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO -} - -QMAKE_CXXFLAGS_RELEASE -= -O2 - -CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Debug -CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Release -CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Debug -CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Release - -INCLUDEPATH += . -DEPENDPATH += . -#MOC_DIR += ./GeneratedFiles -#OBJECTS_DIR += ./ObjectFiles -#UI_DIR += ./GeneratedFiles -#RCC_DIR += ./GeneratedFiles - - -include(QSbieAPI.pri) - -win32:RC_FILE = QSbieAPI.rc - + +TEMPLATE = lib +TARGET = QSbieAPI +QT += core concurrent +#CONFIG += debug +# DEFINES += QT_LARGEFILE_SUPPORT QTSERVICE_LIB QT_WIDGETS_LIB QT_QTSINGLEAPPLICATION_EXPORT +DEFINES += QSBIEAPI_LIB +#LIBS += -L"." +PRECOMPILED_HEADER = stdafx.h +#DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles/$(ConfigurationName) +#OBJECTS_DIR += debug +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles +LIBS += -lNtdll -lAdvapi32 -lOle32 -lUser32 -lShell32 -lGdi32 + +CONFIG(release, debug|release):{ +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO +QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +} + +QMAKE_CXXFLAGS_RELEASE -= -O2 + +CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Debug +CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Release +CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Debug +CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Release + +INCLUDEPATH += . +DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles +#OBJECTS_DIR += ./ObjectFiles +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles + + +include(QSbieAPI.pri) + +win32:RC_FILE = QSbieAPI.rc + diff --git a/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.pri b/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.pri index 1a14cb05..3cf7b880 100644 --- a/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.pri +++ b/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.pri @@ -1,11 +1,11 @@ # ---------------------------------------------------- # This file is generated by the Qt Visual Studio Add-in. # ------------------------------------------------------ - -HEADERS += ../../src/qtlockedfile.h \ - ../../src/qtlocalpeer.h \ - ../../src/qtsingleapplication.h \ - ../../src/qtsinglecoreapplication.h -SOURCES += ../../src/qtlocalpeer.cpp \ - ../../src/qtsingleapplication.cpp \ - ../../src/qtsinglecoreapplication.cpp + +HEADERS += ../../src/qtlockedfile.h \ + ../../src/qtlocalpeer.h \ + ../../src/qtsingleapplication.h \ + ../../src/qtsinglecoreapplication.h +SOURCES += ../../src/qtlocalpeer.cpp \ + ../../src/qtsingleapplication.cpp \ + ../../src/qtsinglecoreapplication.cpp diff --git a/SandboxiePlus/SandMan/Forms/FileBrowserWindow.ui b/SandboxiePlus/SandMan/Forms/FileBrowserWindow.ui index c968ff90..c62fa8df 100644 --- a/SandboxiePlus/SandMan/Forms/FileBrowserWindow.ui +++ b/SandboxiePlus/SandMan/Forms/FileBrowserWindow.ui @@ -1,46 +1,46 @@ - - - FileBrowserWindow - - - - 0 - 0 - 573 - 451 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - SandboxiePlus - Snapshots - - - - - - - - - - - - - - + + + FileBrowserWindow + + + + 0 + 0 + 573 + 451 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + SandboxiePlus - Snapshots + + + + + + + + + + + + + + diff --git a/SandboxiePlus/SandMan/Forms/NewBoxWindow.ui b/SandboxiePlus/SandMan/Forms/NewBoxWindow.ui index dc20fe7e..af9f7879 100644 --- a/SandboxiePlus/SandMan/Forms/NewBoxWindow.ui +++ b/SandboxiePlus/SandMan/Forms/NewBoxWindow.ui @@ -1,169 +1,169 @@ - - - NewBoxWindow - - - - 0 - 0 - 333 - 263 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 500 - 263 - - - - SandboxiePlus new box - - - - - - - - Select restriction/isolation template: - - - - - - - Initial sandbox configuration: - - - - - - - 32 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Copy options from an existing box: - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Sandbox Name: - - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - txtName - radTemplate - cmbTemplates - radCopy - cmbBoxes - - - - + + + NewBoxWindow + + + + 0 + 0 + 333 + 263 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 500 + 263 + + + + SandboxiePlus new box + + + + + + + + Select restriction/isolation template: + + + + + + + Initial sandbox configuration: + + + + + + + 32 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Copy options from an existing box: + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Sandbox Name: + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + + txtName + radTemplate + cmbTemplates + radCopy + cmbBoxes + + + + diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 46ed05d7..b9c260c4 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -1,2758 +1,2758 @@ - - - OptionsWindow - - - - 0 - 0 - 659 - 479 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - SandboxiePlus Options - - - - - - - - - true - - - - QTabWidget::North - - - 0 - - - - General Options - - - - - - 0 - - - - Box Options - - - - - - - - Drop rights from Administrators and Power Users groups - - - - - - - - - - 1 - - - 10 - - - 1 - - - - - - - - - - - - - - Sandbox Indicator in title: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 75 - true - true - - - - (Recommended) - - - - - - - - 0 - 0 - - - - - 16 - 16777215 - - - - - - - - - - - - 75 - true - true - - - - CAUTION: When running under the built in administrator, processes can not drop administrative privileges. - - - true - - - - - - - - 75 - true - true - - - - Protect the system from sandboxed processes - - - Elevation restrictions - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Show this box in the 'run in box' selection prompt - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - true - - - - Appearance - - - - - - - Make applications think they are running elevated (allows to run installers safely) - - - - - - - - - - px Width - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 75 - true - true - - - - Security note: Elevated applications running under the supervision of Sandboxie, with an admin or system token, have more opportunities to bypass isolation and modify the system outside the sandbox. - - - true - - - - - - - Sandboxed window border: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Allow MSIServer to run with a sandboxed system token and apply other exceptions if required - - - - - - - Note: Msi Installer Exemptions should not be required, but if you encounter issues installing a msi package which you trust, this option may help the installation complete successfully. You can also try disabling drop admin rights. - - - true - - - - - - - - - - File Options - - - - - - - - Auto delete content when last sandboxed process terminates - - - - - - - Copy file size limit: - - - - - - - - 75 - true - true - - - - Box Delete options - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Protect this sandbox from deletion or emptying - - - - - - - - 75 - true - true - - - - Raw Disk access - - - - - - - - 75 - true - true - - - - File Migration - - - - - - - Allow elevated sandboxed applications to read the harddrive - - - - - - - Warn when an application opens a harddrive handle - - - - - - - kilobytes - - - - - - - - 75 - 16777215 - - - - - - - - Issue message 2102 when a file is too large - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 20 - 16777215 - - - - - - - - - - - Prompt user for large file migration - - - - - - - - - - Access Restrictions - - - - - - - - Open Windows Credentials Store - - - - - - - - 0 - 0 - - - - Allow the print spooler to print to files outside the sandbox - - - - - - - Remove spooler restriction, printers can be installed outside the sandbox - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Block read access to the clipboard - - - - - - - Open System Protected Storage - - - - - - - Block access to the printer spooler - - - - - - - - 75 - true - true - - - - Protect the system from sandboxed processes - - - Other restrictions - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - true - - - - Protect the system from sandboxed processes - - - Printing restrictions - - - - - - - - 20 - 0 - - - - - 20 - 16777215 - - - - - - - - - - - - 75 - true - true - - - - Protect the system from sandboxed processes - - - Network restrictions - - - - - - - Block network files and folders, unless specifically opened. - - - - - - - Prevent change to network and firewall parameters - - - - - - - - - - Run Menu - - - - - - You can configure custom entries for the sandbox run menu. - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Name - - - - - Command Line - - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add program - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Remove - - - - - - - - Auto Start - - - - - - Here you can specify programs and/or services that are to be started automatically in the sandbox when it is activated - - - true - - - - - - - - Type - - - - - Program/Service - - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Remove - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add program - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add service - - - - - - - - - - - - Program Groups - - - - - - - - Add Group - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - true - - - - Name - - - - - - - - Add Program - - - - - - - You can group programs together and give them a group name. Program groups can be used with some of the settings instead of program names. Groups defined for the box overwrite groups defined in templates. - - - true - - - - - - - Remove - - - - - - - Show Templates - - - - - - - - - - Forced Programs - - - - 9 - - - 9 - - - 9 - - - 9 - - - - - - - Remove - - - - - - - Force Folder - - - - - - - true - - - - Type - - - - - Path - - - - - - - - Force Program - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Show Templates - - - - - - - Programs entered here, or programs started from entered locations, will be put in this sandbox automatically, unless they are explicitly started in another sandbox. - - - true - - - - - - - - - - Stop Behaviour - - - - - - - - Remove Program - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Add Leader Program - - - - - - - Add Lingering Program - - - - - - - true - - - - Type - - - - - Path - - - - - - - - Show Templates - - - - - - - Lingering programs will be automatically terminated if they are still running after all other processes have been terminated. - -If leader processes are defined, all others are treated as lingering processes. - - - true - - - - - - - - - - Start Restrictions - - - - - - - - true - - - - Name - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Remove Program - - - - - - - Issue message 1308 when a program fails to start - - - - - - - Add Program - - - - - - - 0 - - - - - Allow only selected programs to start in this sandbox. * - - - - - - - Prevent selected programs from starting in this sandbox. - - - - - - - Allow all programs to start in this sandbox. - - - - - - - * Note: Programs installed to this sandbox won't be able to start at all. - - - true - - - - - - - - - - - - Internet Restrictions - - - - - - 0 - - - - Process Restrictions - - - - 3 - - - 6 - - - 3 - - - 0 - - - - - - - Issue message 1307 when a program is denied internet access - - - - - - - Add Program - - - - - - - Prompt user whether to allow an exemption from the blockade. - - - - - - - Remove Program - - - - - - - Note: Programs installed to this sandbox won't be able to access the internet at all. - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - true - - - - Name - - - - - Access - - - - - - - - - - Set network/internet access for unlisted processes: - - - - - - - - - - - - - - - Network Restrictions - - - - 3 - - - 3 - - - 0 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Test Rules, Program: - - - - - - - - - - Port: - - - - - - - - - - IP: - - - - - - - - - - Protocol: - - - - - - - - - - X - - - - - - - - - Remove Rule - - - - - - - Add Rule - - - - - - - - Program - - - - - Action - - - - - Port - - - - - IP - - - - - Protocol - - - - - - - - Show Templates - - - - - - - - 75 - true - true - - - - CAUTION: Windows Filtering Platform is not enabled with the driver, therefore these rules will be applied only in user mode and can not be enforced!!! This means that malicious applications may bypass them. - - - true - - - - - - - - - - - - - - Resource Access - - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add File/Folder - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add Wnd Class - - - - - - - Move Down - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add IPC Path - - - - - - - Show Templates - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add Reg Key - - - - - - - true - - - - Type - - - - - Program - - - - - Access - - - - - Path - - - - - - - - Remove - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - Add COM Object - - - - - - - Move Up - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Configure which processes can access what resources. Double click on an entry to edit it. -'Direct' File and Key access only applies to program binaries located outside the sandbox. -For files access you can use 'Direct All' instead to make it apply to all programs. - - - - - - - Apply Close...=!<program>,... directives also to all binaries located in the sandboxed. - - - - - - - - - - File Recovery - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Add Folder - - - - - - - Ignore Extension - - - - - - - Ignore Folder - - - - - - - Show Templates - - - - - - - Enable Immediate Recovery prompt to be able to recover files as soon as they are created. - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 40 - - - - - - - - - Type - - - - - Name - - - - - - - - Remove - - - - - - - You can exclude folders and file types (or file extensions) from Immediate Recovery. - - - true - - - - - - - When the Quick Recovery function is invoked, the following folders will be checked for sandboxed content. - - - true - - - - - - - - - - Advanced Options - - - - - - - - - 50 - false - true - - - - 0 - - - - - 50 - false - true - - - - Miscellaneous - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Don't alter window class names created by sandboxed programs - - - - - - - Do not start sandboxed services using a system token (recommended) - - - - - - - - 75 - true - true - - - - Protect the sandbox integrity itself - - - Sandbox isolation - - - - - - - Force usage of custom dummy Manifest files (legacy behaviour) - - - - - - - Limit access to the emulated service control manager to privileged processes - - - - - - - - 75 - true - true - - - - Compatibility - - - - - - - Emulate sandboxed window station for all processes - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Allow use of nested job objects (experimental, works on Windows 8 and later) - - - - - - - - - - Isolation - - - - - - - - Allow sandboxed programs to manage Hardware/Devices - - - - - - - Open access to Windows Security Account Manager - - - - - - - Open access to Windows Local Security Authority - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - true - - - - Protect the sandbox integrity itself - - - Access isolation - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Various advanced isolation features can break compatibility, with some applications, if you are using this sandbox <b>NOT for Security</b> but for simple application portability by changing these options you can restore compatibility by sacrificing some security.<br>These options can be used securely when you don't grant any of the sandboxed process admin rights. - - - true - - - - - - - - - - Auto Exec - - - - - - Add Command - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Remove - - - - - - - Here you can specify a list of commands that are executed every time the sandbox is initially populated. - - - true - - - - - - - - - - - - 50 - false - true - - - - Hide Processes - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Add Process - - - - - - - - - - Hide host processes from processes running in the sandbox. - - - true - - - - - - - Remove - - - - - - - Don't allow sandboxed processes to see processes running in other boxes - - - - - - - - - 50 - false - true - - - - Users - - - - - - Restrict Resource Access monitor to administrators only - - - - - - - Add User - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Remove User - - - - - - - Add user accounts and user groups to the list below to limit use of the sandbox to only those accounts. If the list is empty, the sandbox can be used by all user accounts. - -Note: Forced Programs and Force Folders settings for a sandbox do not apply to user accounts which cannot use the sandbox. - - - true - - - - - - - - Tracing - - - - - - - - API call trace (requirers logapi to be installed in the sbie dir) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Pipe Trace - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Log all SetError's to Trace log (creates a lot of output) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Log Debug Output to the Trace Log - - - - - - - Log all access events as seen by the driver to the resource access log. - -This options set the event mask to "*" - All access events -You can customize the logging using the ini by specifying -"A" - Allowed accesses -"D" - Denied accesses -"I" - Ignore access requests -instead of "*". - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - - Ntdll syscall Trace (creates a lot of output) - - - - - - - File Trace - - - - - - - Disable Resource Access Monitor - - - - - - - IPC Trace - - - - - - - GUI Trace - - - - - - - - 75 - true - true - - - - Resource Access Monitor - - - - - - - - 20 - 16777215 - - - - - - - - - - - - 75 - true - true - - - - Access Tracing - - - - - - - COM Class Trace - - - - - - - Key Trace - - - - - - - Network Firewall - - - - - - - - - - - 50 - false - true - - - - Debug - - - - - - true - - - - - 0 - 0 - 98 - 28 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - 75 - true - true - - - - WARNING, these options can disable core security guarantees and break sandbox security!!! - - - true - - - - - - - These options are intended for debugging compatibility issues, please do not use them in production use. - - - true - - - - - - - - - - - - - - App Templates - - - - - - - - 0 - - - - Compatibility Templates - - - - - - - - Filter Categories - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Text Filter - - - - - - - Add Template - - - - - - - This list contains a large amount of sandbox compatibility enhancing templates - - - true - - - - - - - - - - Remove Template - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - true - - - - Category - - - - - Name - - - - - - - - - - - Template Folders - - - - - - - - Configure the folder locations used by your other applications. - -Please note that this values are currently user specific and saved globally for all boxes. - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Name - - - - - Value - - - - - - - - - - - Accessibility - - - - - - - - To compensate for the lost protection, please consult the Drop Rights settings page in the Restrictions settings group. - - - - - - - Screen Readers: JAWS, NVDA, Window-Eyes, System Access - - - - - - - The following settings enable the use of Sandboxie in combination with accessibility software. Please note that some measure of Sandboxie protection is necessarily lost when these settings are in effect. - - - true - - - - - - - - - - - - - - - - - - - - - - - Edit ini Section - - - - - - Edit ini - - - false - - - - - - - false - - - Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - Save - - - - - - - QPlainTextEdit::NoWrap - - - - - - - - - - - - - QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - tabs - tabWidget - cmbBoxIndicator - cmbBoxBorder - btnBorderColor - spinBorderWidth - treeRun - btnAddCmd - btnDelCmd - chkCopyLimit - chkNoCopyWarn - chkAutoEmpty - chkProtectBox - treeAutoStart - btnAddAutoExe - btnAddAutoSvc - btnDelAuto - treeGroups - btnAddGroup - btnAddProg - btnDelProg - treeForced - btnForceProg - btnForceDir - chkShowForceTmpl - btnDelForce - treeStop - btnAddLingering - btnAddLeader - chkShowStopTmpl - btnDelStopProg - radStartAll - radStartExcept - radStartSelected - treeStart - btnAddStartProg - btnDelStartProg - chkStartBlockMsg - chkINetBlockPrompt - treeINet - btnAddINetProg - btnDelINetProg - chkINetBlockMsg - treeAccess - btnAddFile - btnAddKey - btnAddIPC - btnAddWnd - btnAddCOM - btnMoveUp - btnMoveDown - chkShowAccessTmpl - btnDelAccess - chkAutoRecovery - treeRecovery - btnAddRecovery - btnAddRecIgnore - btnAddRecIgnoreExt - chkShowRecoveryTmpl - btnDelRecovery - tabsAdvanced - chkPreferExternalManifest - chkNoWindowRename - chkRestrictServices - lstAutoExec - btnAddAutoExec - btnDelAutoExec - chkHideOtherBoxes - lstProcesses - btnAddProcess - btnDelProcess - lstUsers - btnAddUser - btnDelUser - chkMonitorAdminOnly - chkFileTrace - chkPipeTrace - chkKeyTrace - chkIpcTrace - chkGuiTrace - chkComTrace - chkDbgTrace - scrollArea - treeTemplates - cmbCategories - txtTemplates - btnEditIni - txtIniSection - btnSaveIni - btnCancelEdit - - - - + + + OptionsWindow + + + + 0 + 0 + 659 + 479 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + SandboxiePlus Options + + + + + + + + + true + + + + QTabWidget::North + + + 0 + + + + General Options + + + + + + 0 + + + + Box Options + + + + + + + + Drop rights from Administrators and Power Users groups + + + + + + + + + + 1 + + + 10 + + + 1 + + + + + + + + + + + + + + Sandbox Indicator in title: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 75 + true + true + + + + (Recommended) + + + + + + + + 0 + 0 + + + + + 16 + 16777215 + + + + + + + + + + + + 75 + true + true + + + + CAUTION: When running under the built in administrator, processes can not drop administrative privileges. + + + true + + + + + + + + 75 + true + true + + + + Protect the system from sandboxed processes + + + Elevation restrictions + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Show this box in the 'run in box' selection prompt + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + true + + + + Appearance + + + + + + + Make applications think they are running elevated (allows to run installers safely) + + + + + + + + + + px Width + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 75 + true + true + + + + Security note: Elevated applications running under the supervision of Sandboxie, with an admin or system token, have more opportunities to bypass isolation and modify the system outside the sandbox. + + + true + + + + + + + Sandboxed window border: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Allow MSIServer to run with a sandboxed system token and apply other exceptions if required + + + + + + + Note: Msi Installer Exemptions should not be required, but if you encounter issues installing a msi package which you trust, this option may help the installation complete successfully. You can also try disabling drop admin rights. + + + true + + + + + + + + + + File Options + + + + + + + + Auto delete content when last sandboxed process terminates + + + + + + + Copy file size limit: + + + + + + + + 75 + true + true + + + + Box Delete options + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Protect this sandbox from deletion or emptying + + + + + + + + 75 + true + true + + + + Raw Disk access + + + + + + + + 75 + true + true + + + + File Migration + + + + + + + Allow elevated sandboxed applications to read the harddrive + + + + + + + Warn when an application opens a harddrive handle + + + + + + + kilobytes + + + + + + + + 75 + 16777215 + + + + + + + + Issue message 2102 when a file is too large + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 20 + 16777215 + + + + + + + + + + + Prompt user for large file migration + + + + + + + + + + Access Restrictions + + + + + + + + Open Windows Credentials Store + + + + + + + + 0 + 0 + + + + Allow the print spooler to print to files outside the sandbox + + + + + + + Remove spooler restriction, printers can be installed outside the sandbox + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Block read access to the clipboard + + + + + + + Open System Protected Storage + + + + + + + Block access to the printer spooler + + + + + + + + 75 + true + true + + + + Protect the system from sandboxed processes + + + Other restrictions + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + true + + + + Protect the system from sandboxed processes + + + Printing restrictions + + + + + + + + 20 + 0 + + + + + 20 + 16777215 + + + + + + + + + + + + 75 + true + true + + + + Protect the system from sandboxed processes + + + Network restrictions + + + + + + + Block network files and folders, unless specifically opened. + + + + + + + Prevent change to network and firewall parameters + + + + + + + + + + Run Menu + + + + + + You can configure custom entries for the sandbox run menu. + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Name + + + + + Command Line + + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add program + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Remove + + + + + + + + Auto Start + + + + + + Here you can specify programs and/or services that are to be started automatically in the sandbox when it is activated + + + true + + + + + + + + Type + + + + + Program/Service + + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add program + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add service + + + + + + + + + + + + Program Groups + + + + + + + + Add Group + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + true + + + + Name + + + + + + + + Add Program + + + + + + + You can group programs together and give them a group name. Program groups can be used with some of the settings instead of program names. Groups defined for the box overwrite groups defined in templates. + + + true + + + + + + + Remove + + + + + + + Show Templates + + + + + + + + + + Forced Programs + + + + 9 + + + 9 + + + 9 + + + 9 + + + + + + + Remove + + + + + + + Force Folder + + + + + + + true + + + + Type + + + + + Path + + + + + + + + Force Program + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Show Templates + + + + + + + Programs entered here, or programs started from entered locations, will be put in this sandbox automatically, unless they are explicitly started in another sandbox. + + + true + + + + + + + + + + Stop Behaviour + + + + + + + + Remove Program + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Add Leader Program + + + + + + + Add Lingering Program + + + + + + + true + + + + Type + + + + + Path + + + + + + + + Show Templates + + + + + + + Lingering programs will be automatically terminated if they are still running after all other processes have been terminated. + +If leader processes are defined, all others are treated as lingering processes. + + + true + + + + + + + + + + Start Restrictions + + + + + + + + true + + + + Name + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Remove Program + + + + + + + Issue message 1308 when a program fails to start + + + + + + + Add Program + + + + + + + 0 + + + + + Allow only selected programs to start in this sandbox. * + + + + + + + Prevent selected programs from starting in this sandbox. + + + + + + + Allow all programs to start in this sandbox. + + + + + + + * Note: Programs installed to this sandbox won't be able to start at all. + + + true + + + + + + + + + + + + Internet Restrictions + + + + + + 0 + + + + Process Restrictions + + + + 3 + + + 6 + + + 3 + + + 0 + + + + + + + Issue message 1307 when a program is denied internet access + + + + + + + Add Program + + + + + + + Prompt user whether to allow an exemption from the blockade. + + + + + + + Remove Program + + + + + + + Note: Programs installed to this sandbox won't be able to access the internet at all. + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + true + + + + Name + + + + + Access + + + + + + + + + + Set network/internet access for unlisted processes: + + + + + + + + + + + + + + + Network Restrictions + + + + 3 + + + 3 + + + 0 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Test Rules, Program: + + + + + + + + + + Port: + + + + + + + + + + IP: + + + + + + + + + + Protocol: + + + + + + + + + + X + + + + + + + + + Remove Rule + + + + + + + Add Rule + + + + + + + + Program + + + + + Action + + + + + Port + + + + + IP + + + + + Protocol + + + + + + + + Show Templates + + + + + + + + 75 + true + true + + + + CAUTION: Windows Filtering Platform is not enabled with the driver, therefore these rules will be applied only in user mode and can not be enforced!!! This means that malicious applications may bypass them. + + + true + + + + + + + + + + + + + + Resource Access + + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add File/Folder + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add Wnd Class + + + + + + + Move Down + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add IPC Path + + + + + + + Show Templates + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add Reg Key + + + + + + + true + + + + Type + + + + + Program + + + + + Access + + + + + Path + + + + + + + + Remove + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + Add COM Object + + + + + + + Move Up + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Configure which processes can access what resources. Double click on an entry to edit it. +'Direct' File and Key access only applies to program binaries located outside the sandbox. +For files access you can use 'Direct All' instead to make it apply to all programs. + + + + + + + Apply Close...=!<program>,... directives also to all binaries located in the sandboxed. + + + + + + + + + + File Recovery + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Add Folder + + + + + + + Ignore Extension + + + + + + + Ignore Folder + + + + + + + Show Templates + + + + + + + Enable Immediate Recovery prompt to be able to recover files as soon as they are created. + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 40 + + + + + + + + + Type + + + + + Name + + + + + + + + Remove + + + + + + + You can exclude folders and file types (or file extensions) from Immediate Recovery. + + + true + + + + + + + When the Quick Recovery function is invoked, the following folders will be checked for sandboxed content. + + + true + + + + + + + + + + Advanced Options + + + + + + + + + 50 + false + true + + + + 0 + + + + + 50 + false + true + + + + Miscellaneous + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Don't alter window class names created by sandboxed programs + + + + + + + Do not start sandboxed services using a system token (recommended) + + + + + + + + 75 + true + true + + + + Protect the sandbox integrity itself + + + Sandbox isolation + + + + + + + Force usage of custom dummy Manifest files (legacy behaviour) + + + + + + + Limit access to the emulated service control manager to privileged processes + + + + + + + + 75 + true + true + + + + Compatibility + + + + + + + Emulate sandboxed window station for all processes + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Allow use of nested job objects (experimental, works on Windows 8 and later) + + + + + + + + + + Isolation + + + + + + + + Allow sandboxed programs to manage Hardware/Devices + + + + + + + Open access to Windows Security Account Manager + + + + + + + Open access to Windows Local Security Authority + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + true + + + + Protect the sandbox integrity itself + + + Access isolation + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Various advanced isolation features can break compatibility, with some applications, if you are using this sandbox <b>NOT for Security</b> but for simple application portability by changing these options you can restore compatibility by sacrificing some security.<br>These options can be used securely when you don't grant any of the sandboxed process admin rights. + + + true + + + + + + + + + + Auto Exec + + + + + + Add Command + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Remove + + + + + + + Here you can specify a list of commands that are executed every time the sandbox is initially populated. + + + true + + + + + + + + + + + + 50 + false + true + + + + Hide Processes + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Add Process + + + + + + + + + + Hide host processes from processes running in the sandbox. + + + true + + + + + + + Remove + + + + + + + Don't allow sandboxed processes to see processes running in other boxes + + + + + + + + + 50 + false + true + + + + Users + + + + + + Restrict Resource Access monitor to administrators only + + + + + + + Add User + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Remove User + + + + + + + Add user accounts and user groups to the list below to limit use of the sandbox to only those accounts. If the list is empty, the sandbox can be used by all user accounts. + +Note: Forced Programs and Force Folders settings for a sandbox do not apply to user accounts which cannot use the sandbox. + + + true + + + + + + + + Tracing + + + + + + + + API call trace (requirers logapi to be installed in the sbie dir) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Pipe Trace + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Log all SetError's to Trace log (creates a lot of output) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Log Debug Output to the Trace Log + + + + + + + Log all access events as seen by the driver to the resource access log. + +This options set the event mask to "*" - All access events +You can customize the logging using the ini by specifying +"A" - Allowed accesses +"D" - Denied accesses +"I" - Ignore access requests +instead of "*". + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + Ntdll syscall Trace (creates a lot of output) + + + + + + + File Trace + + + + + + + Disable Resource Access Monitor + + + + + + + IPC Trace + + + + + + + GUI Trace + + + + + + + + 75 + true + true + + + + Resource Access Monitor + + + + + + + + 20 + 16777215 + + + + + + + + + + + + 75 + true + true + + + + Access Tracing + + + + + + + COM Class Trace + + + + + + + Key Trace + + + + + + + Network Firewall + + + + + + + + + + + 50 + false + true + + + + Debug + + + + + + true + + + + + 0 + 0 + 98 + 28 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 75 + true + true + + + + WARNING, these options can disable core security guarantees and break sandbox security!!! + + + true + + + + + + + These options are intended for debugging compatibility issues, please do not use them in production use. + + + true + + + + + + + + + + + + + + App Templates + + + + + + + + 0 + + + + Compatibility Templates + + + + + + + + Filter Categories + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + Text Filter + + + + + + + Add Template + + + + + + + This list contains a large amount of sandbox compatibility enhancing templates + + + true + + + + + + + + + + Remove Template + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + true + + + + Category + + + + + Name + + + + + + + + + + + Template Folders + + + + + + + + Configure the folder locations used by your other applications. + +Please note that this values are currently user specific and saved globally for all boxes. + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Name + + + + + Value + + + + + + + + + + + Accessibility + + + + + + + + To compensate for the lost protection, please consult the Drop Rights settings page in the Restrictions settings group. + + + + + + + Screen Readers: JAWS, NVDA, Window-Eyes, System Access + + + + + + + The following settings enable the use of Sandboxie in combination with accessibility software. Please note that some measure of Sandboxie protection is necessarily lost when these settings are in effect. + + + true + + + + + + + + + + + + + + + + + + + + + + + Edit ini Section + + + + + + Edit ini + + + false + + + + + + + false + + + Cancel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + Save + + + + + + + QPlainTextEdit::NoWrap + + + + + + + + + + + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + tabs + tabWidget + cmbBoxIndicator + cmbBoxBorder + btnBorderColor + spinBorderWidth + treeRun + btnAddCmd + btnDelCmd + chkCopyLimit + chkNoCopyWarn + chkAutoEmpty + chkProtectBox + treeAutoStart + btnAddAutoExe + btnAddAutoSvc + btnDelAuto + treeGroups + btnAddGroup + btnAddProg + btnDelProg + treeForced + btnForceProg + btnForceDir + chkShowForceTmpl + btnDelForce + treeStop + btnAddLingering + btnAddLeader + chkShowStopTmpl + btnDelStopProg + radStartAll + radStartExcept + radStartSelected + treeStart + btnAddStartProg + btnDelStartProg + chkStartBlockMsg + chkINetBlockPrompt + treeINet + btnAddINetProg + btnDelINetProg + chkINetBlockMsg + treeAccess + btnAddFile + btnAddKey + btnAddIPC + btnAddWnd + btnAddCOM + btnMoveUp + btnMoveDown + chkShowAccessTmpl + btnDelAccess + chkAutoRecovery + treeRecovery + btnAddRecovery + btnAddRecIgnore + btnAddRecIgnoreExt + chkShowRecoveryTmpl + btnDelRecovery + tabsAdvanced + chkPreferExternalManifest + chkNoWindowRename + chkRestrictServices + lstAutoExec + btnAddAutoExec + btnDelAutoExec + chkHideOtherBoxes + lstProcesses + btnAddProcess + btnDelProcess + lstUsers + btnAddUser + btnDelUser + chkMonitorAdminOnly + chkFileTrace + chkPipeTrace + chkKeyTrace + chkIpcTrace + chkGuiTrace + chkComTrace + chkDbgTrace + scrollArea + treeTemplates + cmbCategories + txtTemplates + btnEditIni + txtIniSection + btnSaveIni + btnCancelEdit + + + + diff --git a/SandboxiePlus/SandMan/Forms/PopUpWindow.ui b/SandboxiePlus/SandMan/Forms/PopUpWindow.ui index f16dee1f..568b1210 100644 --- a/SandboxiePlus/SandMan/Forms/PopUpWindow.ui +++ b/SandboxiePlus/SandMan/Forms/PopUpWindow.ui @@ -1,46 +1,46 @@ - - - PopUpWindow - - - - 0 - 0 - 573 - 179 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - SandboxiePlus Notifications - - - - - - - - - - - - - - + + + PopUpWindow + + + + 0 + 0 + 573 + 179 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + SandboxiePlus Notifications + + + + + + + + + + + + + + diff --git a/SandboxiePlus/SandMan/Forms/RecoveryWindow.ui b/SandboxiePlus/SandMan/Forms/RecoveryWindow.ui index 079923f5..7130da8a 100644 --- a/SandboxiePlus/SandMan/Forms/RecoveryWindow.ui +++ b/SandboxiePlus/SandMan/Forms/RecoveryWindow.ui @@ -1,170 +1,170 @@ - - - RecoveryWindow - - - - 0 - 0 - 512 - 360 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - SandboxiePlus - Recovery - - - - - - - - - - - - - - 16777215 - 1 - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Close - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - TextLabel - - - - - - - - 0 - 0 - - - - Delete all - - - - - - - Show All Files - - - - - - - Recover target: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 75 - 23 - - - - Recover - - - - - - - Add Folder - - - - - - - Refresh - - - - - - - - - - - treeFiles - chkShowAll - btnDeleteAll - - - - + + + RecoveryWindow + + + + 0 + 0 + 512 + 360 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + SandboxiePlus - Recovery + + + + + + + + + + + + + + 16777215 + 1 + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Close + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + TextLabel + + + + + + + + 0 + 0 + + + + Delete all + + + + + + + Show All Files + + + + + + + Recover target: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 75 + 23 + + + + Recover + + + + + + + Add Folder + + + + + + + Refresh + + + + + + + + + + + treeFiles + chkShowAll + btnDeleteAll + + + + diff --git a/SandboxiePlus/SandMan/Forms/SelectBoxWindow.ui b/SandboxiePlus/SandMan/Forms/SelectBoxWindow.ui index 8995de26..b8fd0de0 100644 --- a/SandboxiePlus/SandMan/Forms/SelectBoxWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SelectBoxWindow.ui @@ -1,107 +1,107 @@ - - - SelectBoxWindow - - - - 0 - 0 - 280 - 400 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - SandboxiePlus select box - - - - - - - - Select the sandbox in which to start the program, installer or document. - - - true - - - - - - - - Sandbox - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Run As UAC Administrator - - - - - - - Run Sandboxed - - - true - - - - - - - Run Outside the Sandbox - - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - - - - - - - - + + + SelectBoxWindow + + + + 0 + 0 + 280 + 400 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + SandboxiePlus select box + + + + + + + + Select the sandbox in which to start the program, installer or document. + + + true + + + + + + + + Sandbox + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Run As UAC Administrator + + + + + + + Run Sandboxed + + + true + + + + + + + Run Outside the Sandbox + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + + + + + + + diff --git a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui index 9567a7bd..68edff4b 100644 --- a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui @@ -1,882 +1,882 @@ - - - SettingsWindow - - - - 0 - 0 - 634 - 440 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - SandboxiePlus Settings - - - - - - - - - true - - - - QTabWidget::North - - - 0 - - - - General Config - - - - - - - - Open urls from this ui sandboxed - - - true - - - - - - - Show Notifications for relevant log Messages - - - false - - - - - - - - - - - - - Restart required (!) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 75 - true - true - - - - Systray options - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Watch Sandboxie.ini for changes - - - - - - - - - Hotkey for terminating all boxed processes: - - - - - - - - - - - - Show recoverable files as notifications - - - - - - - Use Dark Theme (fully applied after a restart) - - - true - - - - - - - Show first recovery window when emptying sandboxes - - - - - - - On main window close: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - UI Language: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Show Icon in Systray: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - - - - - - - - Shell Integration - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 75 - true - true - - - - Run Sandboxed - Actions - - - - - - - Start UI with Windows - - - - - - - Always use DefaultBox - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - true - - - - Start Sandbox Manager - - - - - - - Start UI when a sandboxed process is started - - - - - - - Add 'Run Sandboxed' to the explorer context menu - - - - - - - - - - Advanced Config - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Sandbox <a href="sbie://docs/ipcrootpath">ipc root</a>: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - - - - - Sandbox <a href="sbie://docs/filerootpath">file system root</a>: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - - - - - Portable root folder - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 23 - 16777215 - - - - ... - - - - - - - Sandbox <a href="sbie://docs/keyrootpath">registry root</a>: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - - - - - Use Windows Filtering Platform to restrict network access (experimental) - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Separate user folders - - - - - - - - 75 - true - true - - - - Sandboxing features - - - - - - - - 75 - true - true - - - - Sandbox default - - - - - - - - - - Program Control - - - - - - - - - Name - - - - - Path - - - - - - - - Remove Program - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Add Program - - - - - - - When any of the following programs is launched outside any sandbox, Sandboxie will issue message SBIE1301. - - - true - - - - - - - Add Folder - - - - - - - Prevent the listed programs from starting on this system - - - - - - - - - Issue message 1308 when a program fails to start - - - - - - - - Config Protection - - - - - - - - - 75 - true - true - - - - Config protection - - - - - - - Clear password when main window becomes hidden - - - - - - - Only Administrator user accounts can make changes - - - - - - - Only Administrator user accounts can use Disable Forced Programs command - - - - - - - Password must be entered in order to make changes - - - - - - - Change Password - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Compatibility - - - - - - - - In the future, don't check software compatibility - - - - - - - Enable - - - - - - - Disable - - - - - - - - Name - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Sandboxie has detected the following software applications in your system. Click OK to apply configuration settings, which will improve compatibility with these applications. These configuration settings will have effect in all existing sandboxes and in any new sandboxes. - - - true - - - - - - - - - - Support - - - - - - 0 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Install updates automatically - - - - - - - Check periodically for updates of Sandboxie-Plus - - - - - - - - 0 - 0 - - - - Keeping Sandboxie up to date with the rolling releases of Windows and compatible with all web browsers is a never-ending endeavor. Please consider supporting this work with a donation.<br />You can support the development with a <a href="https://sandboxie-plus.com/go.php?to=donate">PayPal donation</a>, working also with credit cards.<br />Or you can provide continuous support with a <a href="https://sandboxie-plus.com/go.php?to=patreon">Patreon subscription</a>. - - - Qt::RichText - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 16777215 - 60 - - - - Enter the support certificate here - - - - - - - - 75 - true - true - - - - Support Settings - - - - - - - Supporters of the Sandboxie-Plus project receive a <a href="https://sandboxie-plus.com/go.php?to=sbie-cert">supporter certificate</a>. It's like a license key but for awesome people using open source software. :-) - - - true - - - - - - - - 75 - true - true - - - - This supporter certificate has expired, please get an updated certificate. - - - - - - - - - - :/HelpingHand.png - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - - - - QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - tabs - uiLang - chkDarkTheme - chkNotifications - chkSandboxUrls - chkShowRecovery - fileRoot - btnBrowse - chkSeparateUserFolders - chkAutoRoot - regRoot - ipcRoot - chkStartBlock - treeWarnProgs - btnAddWarnProg - btnAddWarnFolder - btnDelWarnProg - chkStartBlockMsg - treeCompat - btnAddCompat - btnDelCompat - chkNoCompat - - - - - - + + + SettingsWindow + + + + 0 + 0 + 634 + 440 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + SandboxiePlus Settings + + + + + + + + + true + + + + QTabWidget::North + + + 0 + + + + General Config + + + + + + + + Open urls from this ui sandboxed + + + true + + + + + + + Show Notifications for relevant log Messages + + + false + + + + + + + + + + + + + Restart required (!) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 75 + true + true + + + + Systray options + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Watch Sandboxie.ini for changes + + + + + + + + + Hotkey for terminating all boxed processes: + + + + + + + + + + + + Show recoverable files as notifications + + + + + + + Use Dark Theme (fully applied after a restart) + + + true + + + + + + + Show first recovery window when emptying sandboxes + + + + + + + On main window close: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + UI Language: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + Show Icon in Systray: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + + + + + Shell Integration + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 75 + true + true + + + + Run Sandboxed - Actions + + + + + + + Start UI with Windows + + + + + + + Always use DefaultBox + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + true + + + + Start Sandbox Manager + + + + + + + Start UI when a sandboxed process is started + + + + + + + Add 'Run Sandboxed' to the explorer context menu + + + + + + + + + + Advanced Config + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Sandbox <a href="sbie://docs/ipcrootpath">ipc root</a>: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + + Sandbox <a href="sbie://docs/filerootpath">file system root</a>: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + + Portable root folder + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 23 + 16777215 + + + + ... + + + + + + + Sandbox <a href="sbie://docs/keyrootpath">registry root</a>: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + + Use Windows Filtering Platform to restrict network access (experimental) + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Separate user folders + + + + + + + + 75 + true + true + + + + Sandboxing features + + + + + + + + 75 + true + true + + + + Sandbox default + + + + + + + + + + Program Control + + + + + + + + + Name + + + + + Path + + + + + + + + Remove Program + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Add Program + + + + + + + When any of the following programs is launched outside any sandbox, Sandboxie will issue message SBIE1301. + + + true + + + + + + + Add Folder + + + + + + + Prevent the listed programs from starting on this system + + + + + + + + + Issue message 1308 when a program fails to start + + + + + + + + Config Protection + + + + + + + + + 75 + true + true + + + + Config protection + + + + + + + Clear password when main window becomes hidden + + + + + + + Only Administrator user accounts can make changes + + + + + + + Only Administrator user accounts can use Disable Forced Programs command + + + + + + + Password must be entered in order to make changes + + + + + + + Change Password + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Compatibility + + + + + + + + In the future, don't check software compatibility + + + + + + + Enable + + + + + + + Disable + + + + + + + + Name + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Sandboxie has detected the following software applications in your system. Click OK to apply configuration settings, which will improve compatibility with these applications. These configuration settings will have effect in all existing sandboxes and in any new sandboxes. + + + true + + + + + + + + + + Support + + + + + + 0 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Install updates automatically + + + + + + + Check periodically for updates of Sandboxie-Plus + + + + + + + + 0 + 0 + + + + Keeping Sandboxie up to date with the rolling releases of Windows and compatible with all web browsers is a never-ending endeavor. Please consider supporting this work with a donation.<br />You can support the development with a <a href="https://sandboxie-plus.com/go.php?to=donate">PayPal donation</a>, working also with credit cards.<br />Or you can provide continuous support with a <a href="https://sandboxie-plus.com/go.php?to=patreon">Patreon subscription</a>. + + + Qt::RichText + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 16777215 + 60 + + + + Enter the support certificate here + + + + + + + + 75 + true + true + + + + Support Settings + + + + + + + Supporters of the Sandboxie-Plus project receive a <a href="https://sandboxie-plus.com/go.php?to=sbie-cert">supporter certificate</a>. It's like a license key but for awesome people using open source software. :-) + + + true + + + + + + + + 75 + true + true + + + + This supporter certificate has expired, please get an updated certificate. + + + + + + + + + + :/HelpingHand.png + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + + + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + tabs + uiLang + chkDarkTheme + chkNotifications + chkSandboxUrls + chkShowRecovery + fileRoot + btnBrowse + chkSeparateUserFolders + chkAutoRoot + regRoot + ipcRoot + chkStartBlock + treeWarnProgs + btnAddWarnProg + btnAddWarnFolder + btnDelWarnProg + chkStartBlockMsg + treeCompat + btnAddCompat + btnDelCompat + chkNoCompat + + + + + + diff --git a/SandboxiePlus/SandMan/Forms/SnapshotsWindow.ui b/SandboxiePlus/SandMan/Forms/SnapshotsWindow.ui index 83f5322f..c8c17735 100644 --- a/SandboxiePlus/SandMan/Forms/SnapshotsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SnapshotsWindow.ui @@ -1,157 +1,157 @@ - - - SnapshotsWindow - - - - 0 - 0 - 573 - 451 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - SandboxiePlus - Snapshots - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Selected Snapshot Details - - - - - - Name: - - - - - - - Description: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - - - - - - - - 16777215 - 125 - - - - Snapshot Actions - - - - - - Remove Snapshot - - - - - - - Go to Snapshot - - - - - - - Take Snapshot - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - btnTake - treeSnapshots - btnSelect - btnRemove - txtName - txtInfo - - - - + + + SnapshotsWindow + + + + 0 + 0 + 573 + 451 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + SandboxiePlus - Snapshots + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Selected Snapshot Details + + + + + + Name: + + + + + + + Description: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + + + + + + + + + 16777215 + 125 + + + + Snapshot Actions + + + + + + Remove Snapshot + + + + + + + Go to Snapshot + + + + + + + Take Snapshot + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + btnTake + treeSnapshots + btnSelect + btnRemove + txtName + txtInfo + + + + diff --git a/SandboxiePlus/SandMan/LICENSE b/SandboxiePlus/SandMan/LICENSE index 97c8f350..2d87f99f 100644 --- a/SandboxiePlus/SandMan/LICENSE +++ b/SandboxiePlus/SandMan/LICENSE @@ -1,11 +1,11 @@ -Copyright 2020 - 2021 David Xanatos (xanasoft.com) - -This software is provided under the Creative Commons -Attribution-NonCommercial-ShareAlike 4.0 International Public License - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +Copyright 2020 - 2021 David Xanatos (xanasoft.com) + +This software is provided under the Creative Commons +Attribution-NonCommercial-ShareAlike 4.0 International Public License + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/SandboxiePlus/SandMan/SandMan.pri b/SandboxiePlus/SandMan/SandMan.pri index f7843329..ef27f551 100644 --- a/SandboxiePlus/SandMan/SandMan.pri +++ b/SandboxiePlus/SandMan/SandMan.pri @@ -1,79 +1,79 @@ -# ---------------------------------------------------- -# This file is generated by the Qt Visual Studio Tools. -# ------------------------------------------------------ - - -HEADERS += ./stdafx.h \ - ./SandMan.h \ - ./SbiePlusAPI.h \ - ./Models/SbieModel.h \ - ./Models/TraceModel.h \ - ./Views/SbieView.h \ - ./Views/TraceView.h \ - ./Dialogs/MultiErrorDialog.h \ - ./Helpers/FindTool.h \ - ./Helpers/WinAdmin.h \ - ./Windows/NewBoxWindow.h \ - ./Windows/RecoveryWindow.h \ - ./Windows/PopUpWindow.h \ - ./Windows/SnapshotsWindow.h \ - ./Windows/SettingsWindow.h \ - ./Windows/OptionsWindow.h \ - ./Windows/SelectBoxWindow.h \ - ./Windows/FileBrowserWindow.h - -SOURCES += ./main.cpp \ - ./stdafx.cpp \ - ./SandMan.cpp \ - ./SbiePlusAPI.cpp \ - ./Models/TraceModel.cpp \ - ./Models/SbieModel.cpp \ - ./Views/SbieView.cpp \ - ./Views/TraceView.cpp \ - ./Dialogs/MultiErrorDialog.cpp \ - ./Helpers/FindTool.cpp \ - ./Helpers/WinAdmin.cpp \ - ./Helpers/WindowFromPointEx.cpp \ - ./Windows/NewBoxWindow.cpp \ - ./Windows/OptionsWindow.cpp \ - ./Windows/OptionsAccess.cpp \ - ./Windows/OptionsAdvanced.cpp \ - ./Windows/OptionsForce.cpp \ - ./Windows/OptionsGeneral.cpp \ - ./Windows/OptionsGrouping.cpp \ - ./Windows/OptionsNetwork.cpp \ - ./Windows/OptionsRecovery.cpp \ - ./Windows/OptionsStart.cpp \ - ./Windows/OptionsStop.cpp \ - ./Windows/OptionsTemplates.cpp \ - ./Windows/PopUpWindow.cpp \ - ./Windows/RecoveryWindow.cpp \ - ./Windows/SettingsWindow.cpp \ - ./Windows/SnapshotsWindow.cpp \ - ./Windows/SelectBoxWindow.cpp \ - ./Windows/FileBrowserWindow.cpp - -FORMS += ./Forms/NewBoxWindow.ui \ - ./Forms/OptionsWindow.ui \ - ./Forms/PopUpWindow.ui \ - ./Forms/RecoveryWindow.ui \ - ./Forms/SettingsWindow.ui \ - ./Forms/SnapshotsWindow.ui \ - ./Forms/SelectBoxWindow.ui \ - ./Forms/FileBrowserWindow.ui - -TRANSLATIONS += sandman_de.ts \ - sandman_en.ts \ - sandman_es.ts \ - sandman_fr.ts \ - sandman_it.ts \ - sandman_nl.ts \ - sandman_pl.ts \ - sandman_pt.ts \ - sandman_ru.ts \ - sandman_zh-CN.ts \ - sandman_zh-TW.ts - -# sandman_tr.ts (unmaintained) - -RESOURCES += Resources/SandMan.qrc +# ---------------------------------------------------- +# This file is generated by the Qt Visual Studio Tools. +# ------------------------------------------------------ + + +HEADERS += ./stdafx.h \ + ./SandMan.h \ + ./SbiePlusAPI.h \ + ./Models/SbieModel.h \ + ./Models/TraceModel.h \ + ./Views/SbieView.h \ + ./Views/TraceView.h \ + ./Dialogs/MultiErrorDialog.h \ + ./Helpers/FindTool.h \ + ./Helpers/WinAdmin.h \ + ./Windows/NewBoxWindow.h \ + ./Windows/RecoveryWindow.h \ + ./Windows/PopUpWindow.h \ + ./Windows/SnapshotsWindow.h \ + ./Windows/SettingsWindow.h \ + ./Windows/OptionsWindow.h \ + ./Windows/SelectBoxWindow.h \ + ./Windows/FileBrowserWindow.h + +SOURCES += ./main.cpp \ + ./stdafx.cpp \ + ./SandMan.cpp \ + ./SbiePlusAPI.cpp \ + ./Models/TraceModel.cpp \ + ./Models/SbieModel.cpp \ + ./Views/SbieView.cpp \ + ./Views/TraceView.cpp \ + ./Dialogs/MultiErrorDialog.cpp \ + ./Helpers/FindTool.cpp \ + ./Helpers/WinAdmin.cpp \ + ./Helpers/WindowFromPointEx.cpp \ + ./Windows/NewBoxWindow.cpp \ + ./Windows/OptionsWindow.cpp \ + ./Windows/OptionsAccess.cpp \ + ./Windows/OptionsAdvanced.cpp \ + ./Windows/OptionsForce.cpp \ + ./Windows/OptionsGeneral.cpp \ + ./Windows/OptionsGrouping.cpp \ + ./Windows/OptionsNetwork.cpp \ + ./Windows/OptionsRecovery.cpp \ + ./Windows/OptionsStart.cpp \ + ./Windows/OptionsStop.cpp \ + ./Windows/OptionsTemplates.cpp \ + ./Windows/PopUpWindow.cpp \ + ./Windows/RecoveryWindow.cpp \ + ./Windows/SettingsWindow.cpp \ + ./Windows/SnapshotsWindow.cpp \ + ./Windows/SelectBoxWindow.cpp \ + ./Windows/FileBrowserWindow.cpp + +FORMS += ./Forms/NewBoxWindow.ui \ + ./Forms/OptionsWindow.ui \ + ./Forms/PopUpWindow.ui \ + ./Forms/RecoveryWindow.ui \ + ./Forms/SettingsWindow.ui \ + ./Forms/SnapshotsWindow.ui \ + ./Forms/SelectBoxWindow.ui \ + ./Forms/FileBrowserWindow.ui + +TRANSLATIONS += sandman_de.ts \ + sandman_en.ts \ + sandman_es.ts \ + sandman_fr.ts \ + sandman_it.ts \ + sandman_nl.ts \ + sandman_pl.ts \ + sandman_pt.ts \ + sandman_ru.ts \ + sandman_zh-CN.ts \ + sandman_zh-TW.ts + +# sandman_tr.ts (unmaintained) + +RESOURCES += Resources/SandMan.qrc diff --git a/SandboxiePlus/SandMan/SandMan.qc.pro b/SandboxiePlus/SandMan/SandMan.qc.pro index 2e2855d1..d11f1c99 100644 --- a/SandboxiePlus/SandMan/SandMan.qc.pro +++ b/SandboxiePlus/SandMan/SandMan.qc.pro @@ -1,40 +1,40 @@ - -TEMPLATE = app -TARGET = SandMan -PRECOMPILED_HEADER = stdafx.h - -QT += core gui network widgets winextras concurrent - -CONFIG += lrelease - -CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/x64/Debug -CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/x64/Release -CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/Win32/Debug -CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/Win32/Release - -LIBS += -lNtdll -lAdvapi32 -lOle32 -lUser32 -lShell32 -lGdi32 -lQSbieAPI -lMiscHelpers -lqtsingleapp -lUGlobalHotkey - -CONFIG(release, debug|release):{ -QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO -} - -CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Debug -CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Release -CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Debug -CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Release - -INCLUDEPATH += . -DEPENDPATH += . -MOC_DIR += . -OBJECTS_DIR += debug -UI_DIR += . -RCC_DIR += . - - - -include(SandMan.pri) - -win32:RC_FILE = SandMan.rc - - + +TEMPLATE = app +TARGET = SandMan +PRECOMPILED_HEADER = stdafx.h + +QT += core gui network widgets winextras concurrent + +CONFIG += lrelease + +CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/x64/Debug +CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/x64/Release +CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/Win32/Debug +CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):LIBS += -L../Bin/Win32/Release + +LIBS += -lNtdll -lAdvapi32 -lOle32 -lUser32 -lShell32 -lGdi32 -lQSbieAPI -lMiscHelpers -lqtsingleapp -lUGlobalHotkey + +CONFIG(release, debug|release):{ +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO +QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +} + +CONFIG(debug, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Debug +CONFIG(release, debug|release):contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/x64/Release +CONFIG(debug, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Debug +CONFIG(release, debug|release):!contains(QMAKE_HOST.arch, x86_64):DESTDIR = ../Bin/Win32/Release + +INCLUDEPATH += . +DEPENDPATH += . +MOC_DIR += . +OBJECTS_DIR += debug +UI_DIR += . +RCC_DIR += . + + + +include(SandMan.pri) + +win32:RC_FILE = SandMan.rc + + diff --git a/SandboxiePlus/SandboxiePlus.pro b/SandboxiePlus/SandboxiePlus.pro index fd7fc721..a0d2b323 100644 --- a/SandboxiePlus/SandboxiePlus.pro +++ b/SandboxiePlus/SandboxiePlus.pro @@ -1,14 +1,14 @@ -# ---------------------------------------------------- -# This file is generated by the Qt Visual Studio Tools. -# ------------------------------------------------------ - -# This is a reminder that you are using a generated .pro file. -# Remove it when you are finished editing this file. -message("You are running qmake on a generated .pro file. This may not work!") - - -TEMPLATE = subdirs -SUBDIRS += SandMan/SandMan.qc.pro \ - QSbieAPI/QSbieAPI.qc.pro \ - MiscHelpers/MiscHelpers.qc.pro \ - QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.qc.pro +# ---------------------------------------------------- +# This file is generated by the Qt Visual Studio Tools. +# ------------------------------------------------------ + +# This is a reminder that you are using a generated .pro file. +# Remove it when you are finished editing this file. +message("You are running qmake on a generated .pro file. This may not work!") + + +TEMPLATE = subdirs +SUBDIRS += SandMan/SandMan.qc.pro \ + QSbieAPI/QSbieAPI.qc.pro \ + MiscHelpers/MiscHelpers.qc.pro \ + QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.qc.pro diff --git a/SandboxiePlus/UGlobalHotkey/.qmake.stash b/SandboxiePlus/UGlobalHotkey/.qmake.stash index ef45e8e6..89f591b2 100644 --- a/SandboxiePlus/UGlobalHotkey/.qmake.stash +++ b/SandboxiePlus/UGlobalHotkey/.qmake.stash @@ -1,22 +1,22 @@ -QMAKE_CXX.INCDIRS = \ - "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\include" \ - "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\include" \ - "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um" \ - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt" \ - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared" \ - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um" \ - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt" \ - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt" -QMAKE_CXX.LIBDIRS = \ - "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\lib\\x86" \ - "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\lib\\x86" \ - "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x86" \ - "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\ucrt\\x86" \ - "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\um\\x86" -QMAKE_CXX.QT_COMPILER_STDCXX = 199711L -QMAKE_CXX.QMAKE_MSC_VER = 1915 -QMAKE_CXX.QMAKE_MSC_FULL_VER = 191526730 -QMAKE_CXX.COMPILER_MACROS = \ - QT_COMPILER_STDCXX \ - QMAKE_MSC_VER \ - QMAKE_MSC_FULL_VER +QMAKE_CXX.INCDIRS = \ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\include" \ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\include" \ + "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um" \ + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt" \ + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared" \ + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um" \ + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt" \ + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt" +QMAKE_CXX.LIBDIRS = \ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\lib\\x86" \ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\lib\\x86" \ + "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x86" \ + "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\ucrt\\x86" \ + "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\um\\x86" +QMAKE_CXX.QT_COMPILER_STDCXX = 199711L +QMAKE_CXX.QMAKE_MSC_VER = 1915 +QMAKE_CXX.QMAKE_MSC_FULL_VER = 191526730 +QMAKE_CXX.COMPILER_MACROS = \ + QT_COMPILER_STDCXX \ + QMAKE_MSC_VER \ + QMAKE_MSC_FULL_VER