Coder Social home page Coder Social logo

Comments (1)

dandare76 avatar dandare76 commented on May 23, 2024

I have solved it:

  1. In libyara Properties --> General --> Configuration Type select Dynamic Library (.dll)
  2. In libyara Properties --> C/C++ --> Preprocessor add YR_BUILDING_DLL definition
  3. In types.h after the last include add #define YR_DEPRECATED
  4. Modify the yara\windows\vs2017\libyara\libyara.vcxproj to add the needed libs:
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  <ClCompile>
      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;CUCKOO_MODULE;HASH_MODULE;DOTNET_MODULE;HAVE_LIBCRYPTO;USE_WINDOWS_PROC;YR_BUILDING_DLL;BUCKETS_128;CHECKSUM_1B;YR_BUILDING_DLL</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>..\..\..\libyara;..\..\..\libyara\include;..\..\..;..\packages\YARA.Jansson.x86.1.1.0\include;..\packages\YARA.OpenSSL.x86.1.1.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4005;4273;4090</DisableSpecificWarnings>
      <CompileAs>CompileAsC</CompileAs>
      <ObjectFileName>$(IntDir)/%(RelativeDir)</ObjectFileName>
      <OmitFramePointers>false</OmitFramePointers>
      <PrecompiledHeaderFile />
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
    </ClCompile>
    <Lib>
      <AdditionalDependencies>jansson.lib;libcrypto.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
      <AdditionalLibraryDirectories>..\packages\YARA.OpenSSL.x86.1.1.1\lib;..\packages\YARA.Jansson.x86.1.1.0\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalOptions>/IGNORE:4221</AdditionalOptions>
    </Lib>
    <Link>
      <AdditionalDependencies>msvcrt.lib;Ws2_32.lib;crypt32.lib;..\packages\YARA.Jansson.x86.1.1.0\lib\jansson.lib;..\packages\YARA.OpenSSL.x86.1.1.1\lib\libcrypto.lib;..\packages\YARA.OpenSSL.x86.1.1.1\lib\libssl.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
      <GenerateDebugInformation>No</GenerateDebugInformation>
      <ShowProgress>LinkVerboseLib</ShowProgress>
    </Link>
    <ProjectReference>
      <LinkLibraryDependencies>false</LinkLibraryDependencies>
    </ProjectReference>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;CUCKOO_MODULE;HASH_MODULE;DOTNET_MODULE;HAVE_LIBCRYPTO;USE_WINDOWS_PROC;YR_BUILDING_DLL;BUCKETS_128;CHECKSUM_1B;YR_BUILDING_DLL</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>..\..\..\libyara;..\..\..\libyara\include;..\..\..;..\packages\YARA.Jansson.x64.1.1.0\include;..\packages\YARA.OpenSSL.x64.1.1.1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4005;4273;4090</DisableSpecificWarnings>
      <CompileAs>CompileAsC</CompileAs>
      <ObjectFileName>$(IntDir)/%(RelativeDir)</ObjectFileName>
      <OmitFramePointers>false</OmitFramePointers>
      <PrecompiledHeaderFile />
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
    </ClCompile>
    <Lib>
      <AdditionalDependencies>jansson.lib;libcrypto.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <SuppressStartupBanner>true</SuppressStartupBanner>
      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
      <AdditionalLibraryDirectories>..\packages\YARA.OpenSSL.x64.1.1.1\lib;..\packages\YARA.Jansson.x64.1.1.0\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalOptions>/IGNORE:4221</AdditionalOptions>
    </Lib>
    <Link>
      <AdditionalDependencies>msvcrt.lib;Ws2_32.lib;crypt32.lib;..\packages\YARA.Jansson.x64.1.1.0\lib\jansson.lib;..\packages\YARA.OpenSSL.x64.1.1.1\lib\libcrypto.lib;..\packages\YARA.OpenSSL.x64.1.1.1\lib\libssl.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
      <GenerateDebugInformation>No</GenerateDebugInformation>
      <ShowProgress>LinkVerboseLib</ShowProgress>
    </Link>
    <ProjectReference>
      <LinkLibraryDependencies>false</LinkLibraryDependencies>
    </ProjectReference>
  </ItemDefinitionGroup>

from go-yara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.