yara 1.4.4 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +3 -0
- data/README.rdoc +6 -2
- data/VERSION +1 -1
- data/ext/yara_native/Match.c +4 -4
- data/ext/yara_native/Match.h +1 -1
- data/ext/yara_native/Rules.c +2 -2
- metadata +5 -5
data/History.txt
CHANGED
data/README.rdoc
CHANGED
|
@@ -34,15 +34,19 @@ http://code.google.com/p/yara-project/
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
== Versioning
|
|
37
|
-
The current version of libyara at the time of writing is 1.
|
|
37
|
+
The current version of libyara at the time of writing is 1.5.0. Bindings
|
|
38
38
|
have been written against this API and may not work with earlier versions
|
|
39
39
|
of the libyara library.
|
|
40
40
|
|
|
41
41
|
The major and minor version numbers of the ruby library are intended
|
|
42
42
|
to be in step with the C api version.
|
|
43
43
|
|
|
44
|
+
Note that yara-ruby began existence as of yara 1.4 so binding versions
|
|
45
|
+
go back this far. The yara 1.4 binding in ruby to use is the most recent
|
|
46
|
+
1.4.X gem, and so on.
|
|
47
|
+
|
|
44
48
|
== Requirements
|
|
45
|
-
* libyara 1.
|
|
49
|
+
* libyara 1.5 must be installed - http://code.google.com/p/yara-project/
|
|
46
50
|
|
|
47
51
|
== Installation
|
|
48
52
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.5.0
|
data/ext/yara_native/Match.c
CHANGED
|
@@ -95,7 +95,7 @@ MatchString_NEW(int offset, char *ident, char *buf, size_t buflen) {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
int
|
|
98
|
-
Match_NEW_from_rule(RULE *rule,
|
|
98
|
+
Match_NEW_from_rule(RULE *rule, VALUE *match) {
|
|
99
99
|
match_info *mi;
|
|
100
100
|
VALUE rb_mi = Qnil;
|
|
101
101
|
|
|
@@ -114,7 +114,7 @@ Match_NEW_from_rule(RULE *rule, unsigned char *buffer, VALUE *match) {
|
|
|
114
114
|
rb_mi = Data_Wrap_Struct(class_Match, 0, free, mi);
|
|
115
115
|
|
|
116
116
|
mi->rule = rb_iv_set(rb_mi, "@rule", rb_obj_freeze(rb_str_new2(rule->identifier)));
|
|
117
|
-
mi->namespace = rb_iv_set(rb_mi, "@namespace", rb_obj_freeze(rb_str_new2(rule->
|
|
117
|
+
mi->namespace = rb_iv_set(rb_mi, "@namespace", rb_obj_freeze(rb_str_new2(rule->ns->name)));
|
|
118
118
|
mi->tags = rb_iv_set(rb_mi, "@tags", rb_ary_new());
|
|
119
119
|
mi->strings = rb_iv_set(rb_mi, "@strings", rb_ary_new());
|
|
120
120
|
mi->meta = rb_iv_set(rb_mi, "@meta", rb_hash_new());
|
|
@@ -130,12 +130,12 @@ Match_NEW_from_rule(RULE *rule, unsigned char *buffer, VALUE *match) {
|
|
|
130
130
|
string = rule->string_list_head;
|
|
131
131
|
while(string) {
|
|
132
132
|
if (string->flags & STRING_FLAGS_FOUND) {
|
|
133
|
-
m = string->
|
|
133
|
+
m = string->matches_head;
|
|
134
134
|
while (m) {
|
|
135
135
|
rb_ary_push(mi->strings,
|
|
136
136
|
MatchString_NEW(m->offset,
|
|
137
137
|
string->identifier,
|
|
138
|
-
|
|
138
|
+
m->data,
|
|
139
139
|
m->length));
|
|
140
140
|
m = m->next;
|
|
141
141
|
}
|
data/ext/yara_native/Match.h
CHANGED
data/ext/yara_native/Rules.c
CHANGED
|
@@ -260,14 +260,14 @@ VALUE rules_set_namespace(VALUE self, VALUE rb_namespace) {
|
|
|
260
260
|
|
|
261
261
|
/* an internal callback function used with scan_file and scan_string */
|
|
262
262
|
static int
|
|
263
|
-
scan_callback(RULE *rule,
|
|
263
|
+
scan_callback(RULE *rule, void *data) {
|
|
264
264
|
int match_ret;
|
|
265
265
|
VALUE match = Qnil;
|
|
266
266
|
VALUE results = *((VALUE *) data);
|
|
267
267
|
|
|
268
268
|
Check_Type(results, T_ARRAY);
|
|
269
269
|
|
|
270
|
-
match_ret = Match_NEW_from_rule(rule,
|
|
270
|
+
match_ret = Match_NEW_from_rule(rule, &match);
|
|
271
271
|
if(match_ret == 0 && !NIL_P(match))
|
|
272
272
|
rb_ary_push(results,match);
|
|
273
273
|
|
metadata
CHANGED
|
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
|
4
4
|
prerelease: false
|
|
5
5
|
segments:
|
|
6
6
|
- 1
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
version: 1.
|
|
7
|
+
- 5
|
|
8
|
+
- 0
|
|
9
|
+
version: 1.5.0
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Eric Monti
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date: 2011-04-
|
|
17
|
+
date: 2011-04-18 00:00:00 -05:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
@@ -155,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
155
155
|
requirements:
|
|
156
156
|
- - ">="
|
|
157
157
|
- !ruby/object:Gem::Version
|
|
158
|
-
hash: -
|
|
158
|
+
hash: -9224945978915744
|
|
159
159
|
segments:
|
|
160
160
|
- 0
|
|
161
161
|
version: "0"
|