elftools 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: a9ca4e5e90a3710cbc74557520cfd6efcb442e3b
4
- data.tar.gz: 9f745e3609cdaa67103ccf718db973ee8c4b3c74
3
+ metadata.gz: 19ea6d2a816767e47ee17390784085a33e1fe331
4
+ data.tar.gz: f4af2d0e5552c02ee43d4de74afecd077926532d
5
5
  SHA512:
6
- metadata.gz: 9edec0296929aa3c6dbc90475d8c0281d6f9a559d681945b4badc1778ad293f340a9c49a0526c4c92cfd03aa546774f3a411d98d66a04390233a29c2780a4151
7
- data.tar.gz: cc1df33b85fdaebd9dadf64250fdd1f633fe29f9501e2c68fc41cb711e736564a42c307f4c61a06ce1db24348998b2d6652bb72e15c1ae7375ab9d9e22a40bc2
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 parser library in ruby. More features remain a work in progress.
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, .symtab, .shstrtab
179
- .dynamic sections and INTERP, DYNAMIC segments, etc.
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.git
183
+ git clone https://github.com/david942j/rbelftools
184
184
  cd rbelftools
185
185
  bundle
186
186
  bundle exec rake
@@ -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] == 'ge' ? :big : :little
48
+ bindata_name[-2..-1] == 'be' ? :big : :little
48
49
  end
49
50
 
50
51
  # Pack integer into string.
@@ -1,4 +1,4 @@
1
1
  module ELFTools
2
2
  # Current gem version
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  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.0.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-02 00:00:00.000000000 Z
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.0'
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.0'
68
+ version: '12.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement