sandboxie-plus / Sandboxie

Sandboxie Plus & Classic
https://Sandboxie-Plus.com
GNU General Public License v3.0
13.45k stars 1.5k forks source link

Cannot build classic sandboxie #1126

Closed ghost closed 2 years ago

ghost commented 3 years ago

Describe the bug I'm a visual studio newbie trying to compile classic sandboxie from source.

To Reproduce Steps to reproduce the behavior:

  1. Clone the repository
  2. Checkout tag 0.9.3
  3. Open Sandboxie.sln in visual studio
  4. Press the run button

When I do that, an error dialog appears saying Common.lib is not a valid win32 executable. Can you please describe how to get the build pipeline up and running?

System details and installed software (please provide the following information):

Additional context My sdk configuration:

{
  "version": "1.0",
  "components": [
    "Microsoft.VisualStudio.Component.CoreEditor",
    "Microsoft.VisualStudio.Workload.CoreEditor",
    "Microsoft.NetCore.Component.Runtime.5.0",
    "Microsoft.NetCore.Component.Runtime.3.1",
    "Microsoft.NetCore.Component.SDK",
    "Microsoft.VisualStudio.Component.NuGet",
    "Microsoft.Net.Component.4.6.1.TargetingPack",
    "Microsoft.VisualStudio.Component.Roslyn.Compiler",
    "Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
    "Microsoft.VisualStudio.Component.FSharp",
    "Microsoft.ComponentGroup.ClickOnce.Publish",
    "Microsoft.NetCore.Component.DevelopmentTools",
    "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
    "Microsoft.VisualStudio.Component.DockerTools",
    "Microsoft.Net.Component.4.8.SDK",
    "Microsoft.Net.Component.4.7.2.TargetingPack",
    "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
    "Microsoft.VisualStudio.Component.TypeScript.4.3",
    "Microsoft.VisualStudio.Component.JavaScript.TypeScript",
    "Microsoft.VisualStudio.Component.JavaScript.Diagnostics",
    "Microsoft.Component.MSBuild",
    "Microsoft.VisualStudio.Component.TextTemplating",
    "Component.Microsoft.VisualStudio.RazorExtension",
    "Microsoft.VisualStudio.Component.IISExpress",
    "Microsoft.VisualStudio.Component.SQL.ADAL",
    "Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime",
    "Microsoft.VisualStudio.Component.Common.Azure.Tools",
    "Microsoft.VisualStudio.Component.SQL.CLR",
    "Microsoft.VisualStudio.Component.MSODBC.SQL",
    "Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils",
    "Microsoft.VisualStudio.Component.ManagedDesktop.Core",
    "Microsoft.Net.Component.4.5.2.TargetingPack",
    "Microsoft.Net.Component.4.5.TargetingPack",
    "Microsoft.VisualStudio.Component.SQL.SSDT",
    "Microsoft.VisualStudio.Component.SQL.DataSources",
    "Component.Microsoft.Web.LibraryManager",
    "Component.Microsoft.WebTools.BrowserLink.WebLivePreview",
    "Microsoft.VisualStudio.ComponentGroup.Web",
    "Microsoft.VisualStudio.Component.Web",
    "Microsoft.Net.Component.4.TargetingPack",
    "Microsoft.Net.Component.4.5.1.TargetingPack",
    "Microsoft.Net.Component.4.6.TargetingPack",
    "Microsoft.Net.ComponentGroup.TargetingPacks.Common",
    "Microsoft.VisualStudio.Component.Azure.Compute.Emulator",
    "Microsoft.VisualStudio.Component.Azure.Storage.Emulator",
    "Microsoft.VisualStudio.Component.Azure.ClientLibs",
    "Microsoft.VisualStudio.Component.Azure.AuthoringTools",
    "Microsoft.VisualStudio.Component.CloudExplorer",
    "Microsoft.VisualStudio.Component.DiagnosticTools",
    "Microsoft.VisualStudio.Component.EntityFramework",
    "Microsoft.VisualStudio.Component.Debugger.JustInTime",
    "Component.Microsoft.VisualStudio.LiveShare",
    "Microsoft.VisualStudio.Component.IntelliCode",
    "Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools",
    "Microsoft.VisualStudio.Component.Azure.Waverton",
    "Microsoft.Component.Azure.DataLake.Tools",
    "Microsoft.VisualStudio.Component.VC.CoreIde",
    "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
    "Microsoft.VisualStudio.Component.Graphics.Tools",
    "Microsoft.VisualStudio.Component.VC.DiagnosticTools",
    "Microsoft.VisualStudio.Component.Windows10SDK.19041",
    "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
    "Microsoft.ComponentGroup.Blend",
    "Microsoft.VisualStudio.Component.DotNetModelBuilder",
    "Microsoft.VisualStudio.Workload.ManagedDesktop",
    "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
    "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
    "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake",
    "Microsoft.VisualStudio.Component.VC.CMake.Project",
    "Microsoft.VisualStudio.Component.VC.ATL",
    "Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest",
    "Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest",
    "Microsoft.VisualStudio.Component.VC.ATLMFC",
    "Microsoft.VisualStudio.Component.VC.ASAN",
    "Microsoft.VisualStudio.Component.Windows10SDK.17134",
    "Microsoft.VisualStudio.Workload.NativeDesktop",
    "Microsoft.VisualStudio.Workload.Data",
    "Microsoft.VisualStudio.Component.VC.14.29.16.10.ATL",
    "Microsoft.VisualStudio.Component.VC.14.29.16.10.MFC"
  ]
}
ansnapx commented 3 years ago

VS 2019 (latest updates 16.11.0 ), WDK - Win10 (10.0.19041.685), please use the SbieRelease/Win32 or SibeRelease/x64, no error .

LakerMoon commented 3 years ago

VS 2019 (latest updates 16.11.0 ), WDK - Win10 (10.0.19041.685), please use the SbieRelease/Win32 or SibeRelease/x64, no error .

VS2019,WDK-Win10 (10.0.19041.685), use SbieDebug,build SboxDrv error LNK2001、LNK2019 error. Please help me and tell me how to deal with this issue

DavidXanatos commented 3 years ago

Driver never successfully built in debug already since sophos times, build the driver always as release

LakerMoon commented 3 years ago

Driver never successfully built in debug already since sophos times, build the driver always as release

Thanks David!

ansnapx commented 3 years ago
  1. modify the SbieDrv source / project SbieDebug/x64, please add the ntstrsafe.lib (Link input lib) SbieDebug/Win32, add the ntstrsafe.lib (Link input lib), and disable the memcmp (mem.c) , then you can build success . //#ifndef _WIN64 //int __cdecl memcmp( // _In_readsbytes(_Size) void const _Buf1, // _In_readsbytes(_Size) void const _Buf2, // In size_t _Size //) //{ // return (RtlCompareMemory(_Buf1, _Buf2, _Size) == _Size) ? 0 : 1; //} //#endif

  2. sbierelease , you can modify the configuration. a . C++ /od b. Link /Debug then ,you can debug the sbiedrv (sbierelease ) .

DavidXanatos commented 3 years ago

There was a reason for this memcpy function, i think on win 7 32 bit the driver failed to load without it wheb built with a modern WDK version. So for the debug build in 32 bit just disable intrinsic funtions in the optimisation settings than you can leave this funcrion in