elftools 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 604d1720fabed07c8bb37185d09e89ec8962d3a34ad85ec58ffe42a29e02857a
4
- data.tar.gz: 5912030d8207a6f46ae3cd3c91e0b6a60b7a2d75f57e79bfd46dc01dfdb3c9d3
3
+ metadata.gz: 70f9ff0d778b851c704b44d8c12d49ee95387ccc4f90a9417741d2ea81ed30d5
4
+ data.tar.gz: 731f4292e74e277e3c34eba6f3380fab44c8ce165074841365128a2a704b2f85
5
5
  SHA512:
6
- metadata.gz: 01466eb4691e615a65a2efda8914e4c7a4ac17f71b2c437e14b088e4962885fd091e0be981ae81deabdf7aa2425b6e9fff8c0e74434aa09fd489a722d7a81c39
7
- data.tar.gz: a551049dedca9a3f69cbd1da213b193c8e1f616bf665113d55832b27543bb3e8b02d0f5e9b87ebf64f50d64fb70c15731f8e504e82cc97fb9d6b1251b2cc8d71
6
+ metadata.gz: 1e02ff06057fdfcad4b234239b2e2a4e0f07062a2b1802e38071e87a67287da5780321f739fd678daaa7495f02a12be6cb0dd7862073d9758daaaadac7c13209
7
+ data.tar.gz: 70d4cd30ef739dfbcdc55c4b7e2645cf07feffebf5761b372e4399131a16f729f9ba64c745795263c4d6a9dc47fcbc5265cdc3b4819f97ea37d0994897524249
@@ -339,21 +339,21 @@ module ELFTools
339
339
  def identify
340
340
  stream.pos = 0
341
341
  magic = stream.read(4)
342
- raise ELFError, "Invalid magic number #{magic.inspect}" unless magic == Constants::ELFMAG
342
+ raise ELFMagicError, "Invalid magic number #{magic.inspect}" unless magic == Constants::ELFMAG
343
343
 
344
344
  ei_class = stream.read(1).ord
345
345
  @elf_class = {
346
346
  1 => 32,
347
347
  2 => 64
348
348
  }[ei_class]
349
- raise ELFError, format('Invalid EI_CLASS "\x%02x"', ei_class) if elf_class.nil?
349
+ raise ELFClassError, format('Invalid EI_CLASS "\x%02x"', ei_class) if elf_class.nil?
350
350
 
351
351
  ei_data = stream.read(1).ord
352
352
  @endian = {
353
353
  1 => :little,
354
354
  2 => :big
355
355
  }[ei_data]
356
- raise ELFError, format('Invalid EI_DATA "\x%02x"', ei_data) if endian.nil?
356
+ raise ELFDataError, format('Invalid EI_DATA "\x%02x"', ei_data) if endian.nil?
357
357
  end
358
358
 
359
359
  def create_section(n)
@@ -3,4 +3,13 @@
3
3
  module ELFTools
4
4
  # Being raised when parsing error.
5
5
  class ELFError < StandardError; end
6
+
7
+ # Raised on invalid ELF magic.
8
+ class ELFMagicError < ELFError; end
9
+
10
+ # Raised on invalid ELF class (EI_CLASS).
11
+ class ELFClassError < ELFError; end
12
+
13
+ # Raised on invalid ELF data encoding (EI_DATA).
14
+ class ELFDataError < ELFError; end
6
15
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ELFTools
4
4
  # Current gem version
5
- VERSION = '1.1.1'
5
+ VERSION = '1.1.2'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elftools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - david942j
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-27 00:00:00.000000000 Z
11
+ date: 2020-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  requirements: []
164
- rubygems_version: 3.0.2
164
+ rubygems_version: 3.0.3
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: ELFTools - Pure ruby library for parsing and patching ELF files