LinkAgainstFinder 0.1.1 → 0.1.2
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/.idea/workspace.xml +2 -3
- data/lib/LinkAgainstFinder/objdump.rb +26 -5
- data/lib/LinkAgainstFinder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d80a272684bfb95f16642a777ebd81e2671a10eee9be0d95dbcf3b1ac60007ca
|
4
|
+
data.tar.gz: 3efda80eaad8bb439cf5b31fd24cedef59744b24f4a52dd73ad40acd7ab2a299
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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="
|
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
|
-
|
17
|
-
|
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
|
-
|
21
|
-
|
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|
|