elf-mithril 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 006667100c2ec68be447f345468a69b68b450488
4
+ data.tar.gz: 40c28aef0c8505fe182f18371da24057d81c5d68
5
+ SHA512:
6
+ metadata.gz: bac9ad01b34f4b1a71c70d0a2f73110fd1f81a7d7a460e0450d8bb08cb2d59ba2d3e4f71f29833854a8e18ece9ae20b3844e368fb21cde5683d9da908791a8f5
7
+ data.tar.gz: 977a274054223feb5bf9ab48787ea547bfafa6c4d6571cd5ef3c328a1b0692c7b7f26e60d5d8203f3f4f2e2de26dd2406f1ace1452cf9ff4228798b54a94ae12
@@ -6,7 +6,7 @@ module Elf::Policy::Generator
6
6
  section('.init')
7
7
  section('.fini')
8
8
  section('.text')
9
- section('.plt')
9
+ # section('.plt')
10
10
  section('.data')
11
11
  section('.bss')
12
12
  section('.rodata')
@@ -51,6 +51,7 @@ module Elf::Policy::Generator
51
51
  H::initializer_functions(filename).each {|initializer|
52
52
  call initializer
53
53
  }
54
+ call section_start('.init')
54
55
  call '_fini'
55
56
  end
56
57
  end
@@ -45,11 +45,15 @@ module Elf
45
45
  if t.is_a? Data
46
46
  x= data
47
47
  x[t.from] ||= {}
48
- x[t.from][t.to] ||= {}
49
- x[t.from][t.to][t.tag] ||= t
50
- x[t.from][t.to][t.tag].read ||= t.read
51
- x[t.from][t.to][t.tag].write ||= t.write
52
- x[t.from][t.to][t.tag].exec ||= t.exec
48
+ x[t.from][t.tag] ||= t
49
+ if(x[t.from][t.tag].to != t.to)
50
+ raise ArgumentError "Invalid Policy, different to states on same tag" #TODO: allow
51
+ #different accesses to go to different tags. at the moment, this is moot, because data
52
+ #access is unconditional
53
+ end
54
+ x[t.from][t.tag].read ||= t.read
55
+ x[t.from][t.tag].write ||= t.write
56
+ x[t.from][t.tag].exec ||= t.exec
53
57
  elsif t.is_a? Call
54
58
  calls << t
55
59
  else
@@ -169,7 +173,7 @@ module Elf
169
173
  }
170
174
  out.calls.last.off = resolve_reference(elffile,relocations,out.calls.last.off.offset, call.symbol)
171
175
  end
172
- self.data.values.map(&:values).flatten.map(&:values).flatten.each do |data|
176
+ self.data.values.map(&:values).flatten.each do |data|
173
177
  out.data << factory.elfp_data.new.tap {|x|
174
178
  x.from = state_ids[data.from]
175
179
  x.to = state_ids[data.to]
@@ -179,6 +183,7 @@ module Elf
179
183
  x.type |= ELFP::ELFP_RW_EXEC if data.exec
180
184
  raise RuntimeError.new "Unknown tag #{data.tag}" unless tag_ids.include? data.tag
181
185
  x.tag = tag_ids[data.tag]
186
+ print "#{x.from} to #{x.to} data #{data.tag} = #{x.tag} #{data.read ? "r":" "}#{data.write ? "w":" "}#{data.exec ? "x":" "}\n"
182
187
  }
183
188
  end
184
189
  out = Elf::ProgBits.new(".elfbac",nil,out.to_binary_s)
@@ -1,3 +1,3 @@
1
1
  module Mithril
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
- spec.add_dependency 'bindata', '>=1.5.0'
23
+ spec.add_dependency 'jbangert-bindata', '>=1.5.0'
24
24
  spec.add_dependency 'renum' , '1.4.0'
25
25
  spec.add_dependency 'andand'
26
26
  spec.add_dependency 'segment_tree'
metadata CHANGED
@@ -1,68 +1,60 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elf-mithril
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Julian Bangert
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-11-13 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.3'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.3'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
- name: bindata
42
+ name: jbangert-bindata
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: 1.5.0
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: 1.5.0
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: renum
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - '='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - '='
76
67
  - !ruby/object:Gem::Version
@@ -78,49 +69,43 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: andand
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: segment_tree
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rbtree-pure
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: In Soviet Russia, Mithril forges Elf
@@ -133,7 +118,7 @@ executables:
133
118
  extensions: []
134
119
  extra_rdoc_files: []
135
120
  files:
136
- - .gitignore
121
+ - ".gitignore"
137
122
  - Gemfile
138
123
  - LICENSE.txt
139
124
  - README.md
@@ -171,27 +156,26 @@ files:
171
156
  homepage: https://github.com/jbangert/mithril
172
157
  licenses:
173
158
  - MIT
159
+ metadata: {}
174
160
  post_install_message:
175
161
  rdoc_options: []
176
162
  require_paths:
177
163
  - lib
178
164
  required_ruby_version: !ruby/object:Gem::Requirement
179
- none: false
180
165
  requirements:
181
- - - ! '>='
166
+ - - ">="
182
167
  - !ruby/object:Gem::Version
183
168
  version: '0'
184
169
  required_rubygems_version: !ruby/object:Gem::Requirement
185
- none: false
186
170
  requirements:
187
- - - ! '>='
171
+ - - ">="
188
172
  - !ruby/object:Gem::Version
189
173
  version: '0'
190
174
  requirements: []
191
175
  rubyforge_project:
192
- rubygems_version: 1.8.23
176
+ rubygems_version: 2.4.5
193
177
  signing_key:
194
- specification_version: 3
178
+ specification_version: 4
195
179
  summary: The Mithril toolkit for canonical elf manipulation
196
180
  test_files:
197
181
  - test/hash_test.rb