Comments (5)
@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.
@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.
@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.
@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.
Alright, then the commit is going into master. Thank you @Greatnest!
from go-yara.
Related Issues (20)
- There's no way to return an error from MemoryBlockIterator HOT 5
- yr_scanner_scan_file Using mmap is a dangerous operation HOT 9
- Unable to cross compile yara for windows on ubuntu HOT 5
- Is the new tag version expected ? HOT 1
- Issues while installing HOT 7
- Unable to use ScanProc HOT 23
- Unable to define variable on AIX HOT 4
- Scan a file in a streaming maner HOT 2
- Encrypted rules? HOT 4
- unstable rules HOT 5
- Wrong release version? HOT 1
- Building static binary HOT 3
- cannot find -lyara HOT 1
- linux编译yara出现错误 HOT 2
- generate a dynamic-link library (.so file) HOT 1
- v3.x no release tag HOT 1
- Failing to compile with go-yara HOT 9
- yararule.ScanFile, can not scan filepath which contains chinese, may be other language has the same HOT 2
- Attempt to add a new YARA rule files during runtime causes panic HOT 1
- Question: Adding multiple Compiled YARA files to a single yara.Scanner or *yara.Rules HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-yara.