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 +4 -4
- data/lib/elftools/elf_file.rb +3 -3
- data/lib/elftools/exceptions.rb +9 -0
- data/lib/elftools/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70f9ff0d778b851c704b44d8c12d49ee95387ccc4f90a9417741d2ea81ed30d5
|
4
|
+
data.tar.gz: 731f4292e74e277e3c34eba6f3380fab44c8ce165074841365128a2a704b2f85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e02ff06057fdfcad4b234239b2e2a4e0f07062a2b1802e38071e87a67287da5780321f739fd678daaa7495f02a12be6cb0dd7862073d9758daaaadac7c13209
|
7
|
+
data.tar.gz: 70d4cd30ef739dfbcdc55c4b7e2645cf07feffebf5761b372e4399131a16f729f9ba64c745795263c4d6a9dc47fcbc5265cdc3b4819f97ea37d0994897524249
|
data/lib/elftools/elf_file.rb
CHANGED
@@ -339,21 +339,21 @@ module ELFTools
|
|
339
339
|
def identify
|
340
340
|
stream.pos = 0
|
341
341
|
magic = stream.read(4)
|
342
|
-
raise
|
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
|
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
|
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)
|
data/lib/elftools/exceptions.rb
CHANGED
@@ -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
|
data/lib/elftools/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|