I'm having troubles wrapping libyara using BridJ (0.7.0), for parameters passed back using callbacks I always get "Unaligned pointer access". I am on Mac OS X and the binding code was generated with JNAerator.
This the code I'm having troubles with:
This is the Java code:
@OverRide
public int apply(int message, Pointer rulePtr, Pointer dataPtr) {
if (message != YaraLibrary.CALLBACK_MSG_RULE_MATCHING) {
return YaraLibrary.CALLBACK_CONTINUE;
}
Pointer<YR_RULE> rule = rulePtr.as(YR_RULE.class);
int g = rule.get().g_flags(); <-- Unaligned pointer access
And this is the YR_RULE definition:
@Library("yara")
public class YR_RULE extends StructObject {
static {
BridJ.register();
}
/** Global flags */
@field(0)
public int g_flags() {
return this.io.getIntField(this, 0);
}
Any ideas how to fix this ?
Thanks
I'm having troubles wrapping libyara using BridJ (0.7.0), for parameters passed back using callbacks I always get "Unaligned pointer access". I am on Mac OS X and the binding code was generated with JNAerator.
This the code I'm having troubles with:
This is the Java code:
@OverRide
public int apply(int message, Pointer rulePtr, Pointer dataPtr) {
if (message != YaraLibrary.CALLBACK_MSG_RULE_MATCHING) {
return YaraLibrary.CALLBACK_CONTINUE;
}
And this is the YR_RULE definition:
@Library("yara")
public class YR_RULE extends StructObject {
static {
BridJ.register();
}
/** Global flags */
@field(0)
public int g_flags() {
return this.io.getIntField(this, 0);
}
Any ideas how to fix this ?
Thanks