LinkAgainstFinder 0.1.1 → 0.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: c71d62c0650b379e0b4125f35ef67042ece04132cd9cb32a058f471f652c99c6
4
- data.tar.gz: 3c59c5e5c3243da079a144021abea26d0808faeb67f98f40afedfb2065091c59
3
+ metadata.gz: d80a272684bfb95f16642a777ebd81e2671a10eee9be0d95dbcf3b1ac60007ca
4
+ data.tar.gz: 3efda80eaad8bb439cf5b31fd24cedef59744b24f4a52dd73ad40acd7ab2a299
5
5
  SHA512:
6
- metadata.gz: eb5729689553f096975853ede7593a9e30ddadab016c2b9ca812abd4bac67eb5e2542c7c25e09204b4ae33a4335e6d139adcda61fd4bb03f89ebe8abb895bcff
7
- data.tar.gz: e1b072bec22d31cd28fbe269544a9c4acbb8145dbdb0cd56872c2a63e9f9a963079d67d5c4443aa61c8354eac43e8e36dc868426618301d3f3ce49f2c5008453
6
+ metadata.gz: 1e6532f21c17e8b002a146e91409ec4467ff5341d0f5d3475ec0307dd5974e478e045d215935d1a374bd541261f66ad3ca3017a225cbdd0891e1976bb8de908c
7
+ data.tar.gz: fad102361fcc6a6f4d54e20a27d1fe8e6bb662962645dcb57a426f410d3aa86eb12a74c77a96862291e9e80bb9acb5c2e02d45cd1f4cb67cc28eacd6dec4ad2a
data/.idea/workspace.xml CHANGED
@@ -3,8 +3,6 @@
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="efc6ee81-c3ff-495b-b1aa-0b001b799fa0" name="Default Changelist" comment="">
5
5
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/exe/linkAgainstFinder" beforeDir="false" afterPath="$PROJECT_DIR$/exe/linkAgainstFinder" afterDir="false" />
7
- <change beforePath="$PROJECT_DIR$/lib/LinkAgainstFinder.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/LinkAgainstFinder.rb" afterDir="false" />
8
6
  <change beforePath="$PROJECT_DIR$/lib/LinkAgainstFinder/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/LinkAgainstFinder/version.rb" afterDir="false" />
9
7
  </list>
10
8
  <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -82,7 +80,8 @@
82
80
  <option name="presentableId" value="Default" />
83
81
  <updated>1572519494008</updated>
84
82
  <workItem from="1572519495052" duration="8944000" />
85
- <workItem from="1572754070238" duration="229000" />
83
+ <workItem from="1572754070238" duration="302000" />
84
+ <workItem from="1572768234441" duration="5000" />
86
85
  </task>
87
86
  <servers />
88
87
  </component>
@@ -13,12 +13,33 @@ module LinkAgainstFinder
13
13
 
14
14
  def getSymbolTable
15
15
  output = `objdump -arch=arm64 -syms #{binary_path}`
16
- parts = output.split("\n\n")
17
- parts = parts.reject{|p| p.include?('file format')}
18
- lines = parts.map{ |p| p.split("\n")[1..-1] }.flatten
16
+ lines = output.split("\n")
17
+ lines.reject{ |l| l.strip.empty? }
19
18
 
20
- externals = lines.select{|l|l.include?('*UND*')}
21
- internals = lines.select{|l| !l.include?('*UND*')}
19
+ parts = []
20
+ current = []
21
+ on = false
22
+ (0...lines.length).each do |index|
23
+ line = lines[index]
24
+ if line == 'SYMBOL TABLE:'
25
+ # finish last
26
+ current = current[0...-1]
27
+ parts << current unless current.empty?
28
+
29
+ # set new
30
+ on = true
31
+ current = []
32
+ next
33
+ end
34
+ if on
35
+ current << lines[index]
36
+ end
37
+ end
38
+ parts << current unless current.empty?
39
+ all_symbol_lines = parts.flatten
40
+
41
+ externals = all_symbol_lines.select{|l|l.include?('*UND*')}
42
+ internals = all_symbol_lines.select{|l| !l.include?('*UND*')}
22
43
 
23
44
  table = SymbolTable.new
24
45
  table.internalSymbols = Set.new(internals.map do |l|
@@ -1,3 +1,3 @@
1
1
  module LinkAgainstFinder
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: LinkAgainstFinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gao