pedump 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/lib/pedump.rb +4 -1
  3. data/lib/pedump/cli.rb +6 -7
  4. data/pedump.gemspec +1 -1
  5. metadata +14 -14
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
data/lib/pedump.rb CHANGED
@@ -351,7 +351,7 @@ class PEdump
351
351
  if dos_stub_offset <= 0
352
352
  logger.warn "[?] invalid DOS stub offset #{dos_stub_offset}"
353
353
  nil
354
- elsif dos_stub_offset > f.size
354
+ elsif f && dos_stub_offset > f.size
355
355
  logger.warn "[?] DOS stub offset beyond EOF: #{dos_stub_offset}"
356
356
  nil
357
357
  elsif dos_stub_size < 0
@@ -360,6 +360,9 @@ class PEdump
360
360
  elsif dos_stub_size == 0
361
361
  # no DOS stub, it's ok
362
362
  nil
363
+ elsif !f
364
+ # no open file, it's ok
365
+ nil
363
366
  else
364
367
  if dos_stub_size > 0x1000
365
368
  logger.warn "[?] DOS stub size too big (#{dos_stub_size}), limiting to 0x1000"
data/lib/pedump/cli.rb CHANGED
@@ -325,18 +325,17 @@ class PEdump::CLI
325
325
  def dump_exports data
326
326
  printf "# module %s\n# flags=0x%x ts=%s version=%d.%d ord_base=%d\n",
327
327
  data.name.inspect,
328
- data.Characteristics,
328
+ data.Characteristics.to_i,
329
329
  Time.at(data.TimeDateStamp.to_i).strftime('"%Y-%m-%d %H:%M:%S"'),
330
330
  data.MajorVersion, data.MinorVersion,
331
331
  data.Base
332
332
 
333
333
  if @options[:verbose]
334
- printf "# Names rva=0x%08x file_offset=%8d\n",
335
- data.AddressOfNames, @pedump.va2file(data.AddressOfNames)
336
- printf "# EntryPoints rva=0x%08x file_offset=%8d\n",
337
- data.AddressOfFunctions, @pedump.va2file(data.AddressOfFunctions)
338
- printf "# Ordinals rva=0x%08x file_offset=%8d\n",
339
- data.AddressOfNameOrdinals, @pedump.va2file(data.AddressOfNameOrdinals)
334
+ [%w'Names', %w'EntryPoints Functions', %w'Ordinals NameOrdinals'].each do |x|
335
+ va = data["AddressOf"+x.last]
336
+ ofs = @pedump.va2file(va) || '?'
337
+ printf "# %-12s rva=0x%08x file_offset=%8s\n", x.first, va, ofs
338
+ end
340
339
  end
341
340
 
342
341
  printf "# nFuncs=%d nNames=%d\n",
data/pedump.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pedump"
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrey \"Zed\" Zaikin"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pedump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-12-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multipart-post
16
- requirement: &70170796571980 !ruby/object:Gem::Requirement
16
+ requirement: &70099128727380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70170796571980
24
+ version_requirements: *70099128727380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: progressbar
27
- requirement: &70170796565140 !ruby/object:Gem::Requirement
27
+ requirement: &70099128726580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70170796565140
35
+ version_requirements: *70099128726580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70170796564100 !ruby/object:Gem::Requirement
38
+ requirement: &70099128724780 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70170796564100
46
+ version_requirements: *70099128724780
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &70170796562840 !ruby/object:Gem::Requirement
49
+ requirement: &70099128713520 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70170796562840
57
+ version_requirements: *70099128713520
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &70170796562220 !ruby/object:Gem::Requirement
60
+ requirement: &70099128712420 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.6.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70170796562220
68
+ version_requirements: *70099128712420
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rcov
71
- requirement: &70170796561460 !ruby/object:Gem::Requirement
71
+ requirement: &70099128711520 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70170796561460
79
+ version_requirements: *70099128711520
80
80
  description: dump headers, sections, extract resources of win32 PE exe,dll,etc
81
81
  email: zed.0xff@gmail.com
82
82
  executables:
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: 1927825518031609740
118
+ hash: 3702742729748465882
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements: