Giter Club home page Giter Club logo

Comments (5)

hillu avatar hillu commented on May 22, 2024

@Greatnest The error message "The storage control block address is invalid" is produced by a Windows API, most likely when opening the rule file.
Can you provide a minimal reproducer (including instructions on how to compile your test program)?
Does everything work if you read the rules file into a buffer and pass that to (*Compiler).AddString?

from go-yara.

Greatnest avatar Greatnest commented on May 22, 2024

@hillu I followed mcastilho's Issue #7 instructions for compiling for Windows x64. I then installed TDM-GCC and copied the built libyara.a as the library to be used under C:\TDM-GCC-64\x86_64-w64-mingw32\lib. I then use your simple-yara.go example as the starting script.

The command I ran was go run simple-yara.go -rule yara.yar test.go. test.go is the file I want to run the yara rules on. I would get the same error when I ran go build simple-yara.go and running the binary using the same arguments. I am able to os.Open the file and read in contents of the file normally, it is during the c.AddFile(f, "namespace") that it errors.

(*Compiler).AddString works for me when I add the individual rule that is read from the file. If (*Compiler).AddString only reads a single rule at time, it would mean that I have to parse and extract each individual rule from the a file containing multiple rules correct?

from go-yara.

hillu avatar hillu commented on May 22, 2024

@Greatnest Please check if commit 2dbfae3 on branch compiler_addfile_split fixes the problem for you. (You need to use YARA 3.6 or newer for the changes in this commit to have any effect.)

from go-yara.

Greatnest avatar Greatnest commented on May 22, 2024

@hillu okay, based on my testings, the commit seems to be working fine for both AddString and AddFile and your example script works as intended.

Thanks for the help!

from go-yara.

hillu avatar hillu commented on May 22, 2024

Alright, then the commit is going into master. Thank you @Greatnest!

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.