Giter Site home page Giter Site logo

go-yara's Introduction

go-yara

GoDoc

Go bindings for YARA, staying as close as sensible to the library's C-API while taking inspiration from the yara-python implementation.

A recent Git checkout of YARA after 3.3.0, with stream support (merged on 2015-02-12) is required.

Installation

Unix

On a Unix system with libyara properly installed, this should work, provided that GOPATH is set:

$ go get github.com/hillu/go-yara
$ go install github.com/hillu/go-yara

Depending on what location libyara and its headers have been installed, proper CFLAGS and LDFLAGS may have to be added to cgo.go or be specified via environment variables (CGO_CFLAGS and CGO_LDFLAGS)

Windows

I have not yet built go-yara on Windows, only used the MinGW-w64 provided on Debian. The YARA library was built like this:

$ ./configure --host=i686-w64-mingw32 --disable-magic --disable-cuckoo --without-crypto CFLAGS=-D__MINGW_USE_VC2005_COMPAT
[...]
$ make
$ make install prefix=/path/to/i686-w64-mingw32

I found that the CFLAGS parameter was necessary to avoid problems due to a missing time32 symbol when linking 32bit Windows executables.

Compiling and linking go-yara against this library was achieved like this:

$ CC=i686-w64-mingw32-gcc \
  CGO_ENABLED=1 \
  GOOS=windows GOARCH=386 \
  CGO_CFLAGS=-I/path/to/i686-w64-mingw32/include \
  CGO_LDFLAGS=-L/path/to/i686-w64-mingw32/lib \
  go install --ldflags '-extldflags "-static"' github.com/hillu/go-yara

License

BSD 2-clause, see LICENSE file in the source distribution.

Author

Hilko Bengen [email protected]

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.