elftools 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/elftools/structs.rb +2 -1
- data/lib/elftools/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19ea6d2a816767e47ee17390784085a33e1fe331
|
4
|
+
data.tar.gz: f4af2d0e5552c02ee43d4de74afecd077926532d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a368bc9ee554c9ca775d8e2d51b121965d242f64d2b2a838d249a3914d0d91ece6a3469c36519fa9fdd5d1347f2ff291917adf43e39f488509f29faac5348eda
|
7
|
+
data.tar.gz: 8d777854fc6d4f931452aa0e738202496dd9dd7ce01b22e25da1cf40e1e4839f944cdd95de99e5a88cea85fab2eb611859379b5dc78180a4d0ff42ea835c1f13
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ ELF parser in pure ruby implementation. This work is inspired by [pyelftools](ht
|
|
15
15
|
|
16
16
|
The motivation to create this repository is want to be a dependency of [pwntools-ruby](https://github.com/peter50216/pwntools-ruby). Since ELF parser is a big work, it should not be implemented directly in pwntools.
|
17
17
|
|
18
|
-
**rbelftools**'s target is to create a nice ELF
|
18
|
+
**rbelftools**'s target is to create a nice ELF parsing library in ruby. More features remain a work in progress.
|
19
19
|
|
20
20
|
# Install
|
21
21
|
|
@@ -175,12 +175,12 @@ elf.save('elf.patched')
|
|
175
175
|
For example, to check if NX disabled, you can use
|
176
176
|
`!elf.segment_by_type(:gnu_stack).executable?` but not `elf.nx?`
|
177
177
|
5. Section and segment parser
|
178
|
-
Providing common sections and segments parser. For example,
|
179
|
-
|
178
|
+
Providing common sections and segments parser. For example, `.symtab`, `.shstrtab`
|
179
|
+
`.dynamic` sections and `INTERP`, `DYNAMIC` segments, etc.
|
180
180
|
|
181
181
|
# Development
|
182
182
|
```bash
|
183
|
-
git clone https://github.com/david942j/rbelftools
|
183
|
+
git clone https://github.com/david942j/rbelftools
|
184
184
|
cd rbelftools
|
185
185
|
bundle
|
186
186
|
bundle exec rake
|
data/lib/elftools/structs.rb
CHANGED
@@ -32,6 +32,7 @@ module ELFTools
|
|
32
32
|
obj.field_names.each do |f|
|
33
33
|
m = "#{f}=".to_sym
|
34
34
|
old_method = obj.singleton_method(m)
|
35
|
+
obj.singleton_class.send(:undef_method, m)
|
35
36
|
obj.define_singleton_method(m) do |val|
|
36
37
|
org = obj.send(f)
|
37
38
|
obj.patches[org.abs_offset] = ELFStruct.pack(val, org.num_bytes)
|
@@ -44,7 +45,7 @@ module ELFTools
|
|
44
45
|
# Hacking to get endian of current class
|
45
46
|
# @return [Symbol, nil] +:little+ or +:big+.
|
46
47
|
def self_endian
|
47
|
-
bindata_name[-2..-1] == '
|
48
|
+
bindata_name[-2..-1] == 'be' ? :big : :little
|
48
49
|
end
|
49
50
|
|
50
51
|
# Pack integer into string.
|
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.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- david942j
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '12.
|
61
|
+
version: '12.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '12.
|
68
|
+
version: '12.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|