Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version available on nuget fails with NullReferenceException (but not master) #6

Open
ancailliau opened this issue Mar 11, 2021 · 1 comment

Comments

@ancailliau
Copy link

The version available on nuget fails on OsX with 4.0.5 with the rule vul_drivecrypt.yar (among other) available on https://github.com/Neo23x0/signature-base/tree/master/yara. Compiling from source code leads to no error.

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Runtime.InteropServices.Marshal.PtrToStructureHelper(IntPtr ptr, Object structure, Boolean allowValueClasses)
   at System.Runtime.InteropServices.Marshal.PtrToStructureHelper(IntPtr ptr, Type structureType)
   at System.Runtime.InteropServices.Marshal.PtrToStructure(IntPtr ptr, Type structureType)
   at dnYara.Interop.ObjRefHelper.MarshalAndValidate[T](IntPtr struct_ptr, Func`2 validityChecker, T& destination_ptr)
   at dnYara.Interop.ObjRefHelper.EachStructOfTInObjRef[T](IntPtr ref_obj, Func`2 validityChecker)+MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at dnYara.CompiledRules.ExtractRules()
   at dnYara.CompiledRules..ctor(IntPtr rulesPtr)
   at dnYara.Compiler.Compile()
@sbruyere
Copy link
Contributor

sbruyere commented Jan 5, 2022

Hello,

We just updated the NuGets to be compatible with Yara v4.0.0 to v4.1.1 (not yet latest version of Yara since there is some structure changes to be handled).

The latest NuGet version is 2.1.1.

For OSX compatibility you will need to find a way to compile libyara with cmake under OSX (and I would be interested to know how you compile the lib under OSX to update the readme instructions).

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants