idb 2.9.0 → 2.9.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +30 -0
  3. data/Gemfile.lock +5 -0
  4. data/idb.gemspec +1 -0
  5. data/lib/gui/app_binary_tab_widget.rb +7 -14
  6. data/lib/gui/app_details_group_box.rb +63 -88
  7. data/lib/gui/app_list_dialog.rb +29 -35
  8. data/lib/gui/app_list_widget_item.rb +1 -5
  9. data/lib/gui/app_tab_widget.rb +17 -22
  10. data/lib/gui/binary_strings_widget.rb +7 -15
  11. data/lib/gui/ca_manager_dialog.rb +32 -54
  12. data/lib/gui/cache_db_widget.rb +21 -26
  13. data/lib/gui/certificate_item.rb +2 -2
  14. data/lib/gui/default_protection_class_group_widget.rb +7 -12
  15. data/lib/gui/device_info_group_box.rb +26 -23
  16. data/lib/gui/main_tab_widget.rb +2 -21
  17. data/lib/gui/shared_libraries_widget.rb +1 -1
  18. data/lib/gui/sqlite_widget.rb +1 -3
  19. data/lib/gui/weak_class_dump_widget.rb +1 -1
  20. data/lib/idb.rb +3 -3
  21. data/lib/idb/version.rb +1 -1
  22. data/lib/lib/abstract_device.rb +7 -11
  23. data/lib/lib/app.rb +49 -59
  24. data/lib/lib/app_binary.rb +18 -29
  25. data/lib/lib/ca_interface.rb +46 -59
  26. data/lib/lib/device.rb +68 -155
  27. data/lib/lib/device_ca_interface.rb +7 -13
  28. data/lib/lib/host_file_wrapper.rb +6 -8
  29. data/lib/lib/ios8_last_launch_services_map_wrapper.rb +11 -18
  30. data/lib/lib/local_operations.rb +24 -32
  31. data/lib/lib/otool_wrapper.rb +30 -33
  32. data/lib/lib/rsync_git_manager.rb +26 -22
  33. data/lib/lib/screen_shot_util.rb +20 -28
  34. data/lib/lib/settings.rb +14 -17
  35. data/lib/lib/simulator.rb +11 -16
  36. data/lib/lib/simulator_ca_interface.rb +1 -3
  37. data/lib/lib/ssh_operations.rb +49 -65
  38. data/lib/lib/ssh_port_forwarder.rb +9 -13
  39. data/lib/lib/tools.rb +3 -3
  40. data/lib/lib/url_scheme_fuzzer.rb +41 -49
  41. data/lib/lib/usb_muxd_wrapper.rb +6 -8
  42. data/lib/lib/weak_class_dump_wrapper.rb +15 -16
  43. metadata +19 -9
  44. data/lib/gui/console_widget.rb +0 -163
  45. data/lib/gui/cycript_console_widget.rb +0 -68
  46. data/lib/gui/cycript_thread.rb +0 -81
  47. data/lib/lib/console_launcher.rb +0 -24
  48. data/lib/lib/i_device_diagnostics_wrapper.rb +0 -90
  49. data/lib/lib/snoop_it_wrapper.rb +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc3813e5d7a7c00e6f7bea27eaa8458f11079789
4
- data.tar.gz: efa1b2b57cc7bc2ea41aefd2d273393e2574b8b9
3
+ metadata.gz: 95f5f0bcf72a5dc60b88680e93893fad9ac3462d
4
+ data.tar.gz: dc0aa7f5ac66e48093f4588af9de2ff2cc9f7fa9
5
5
  SHA512:
6
- metadata.gz: e7a8dd3eda610331196674b8fdc6401140a5d66a3b610e046e19ecd71de5b995107a3076b11d925f88b356f7bed1a0738be8a0faf596bec5bb39e546b7ad3ae4
7
- data.tar.gz: 16b571a0abeb06e6c840723ae0c1479ddb26fbd6a2c35be4208254cce49fc179c9858a3a9778c8c44fe7c69e780184fa8698d51202f2b36561c55cb6878a2f17
6
+ metadata.gz: 65f43e89c9cdf98bbb6a4869461c92e5778424b1e022a52e5b3243d376b5507f51823168569537fde98e73fbc5a4a37f01653811ca038c1243dec8f39e862caa
7
+ data.tar.gz: 71e1750db5dafcf8e156d62a85ce228db542c53edcf8f877b3c0a58588dc046e02df75924f65a353afab4c55607aba00e2258da884bd214354eac275b5c88365
@@ -0,0 +1,30 @@
1
+ ###########################
2
+ # Configuration for rubocop
3
+ # in .rubocop.yml
4
+ # Most of these are disabling existing cops, primarily
5
+ # due to a smattering of different styles and loose
6
+ # guidlines for contributions.
7
+ #
8
+ # Any of these may be changed.
9
+
10
+ StringLiterals:
11
+ Enabled: false
12
+
13
+ Style/GlobalVars:
14
+ Enabled: false
15
+
16
+ Style/NumericLiteralPrefix:
17
+ Enabled: false
18
+
19
+ Style/Documentation:
20
+ Enabled: false
21
+
22
+ MethodLength:
23
+ Enabled: false
24
+
25
+ Metrics/LineLength:
26
+ Max: 99
27
+
28
+ Metrics/AbcSize:
29
+ Exclude:
30
+ - 'lib/gui/*'
@@ -23,6 +23,7 @@ GEM
23
23
  specs:
24
24
  addressable (2.4.0)
25
25
  awesome_print (1.6.1)
26
+ byebug (9.0.6)
26
27
  coderay (1.1.0)
27
28
  ffi (1.9.10)
28
29
  git (1.2.9.1)
@@ -52,6 +53,9 @@ GEM
52
53
  coderay (~> 1.1.0)
53
54
  method_source (~> 0.8.1)
54
55
  slop (~> 3.4)
56
+ pry-byebug (3.4.0)
57
+ byebug (~> 9.0)
58
+ pry (~> 0.10)
55
59
  qtbindings (4.8.6.2)
56
60
  rake (10.4.2)
57
61
  slop (3.6.0)
@@ -65,6 +69,7 @@ DEPENDENCIES
65
69
  bundler (~> 1.6)
66
70
  idb!
67
71
  pry
72
+ pry-byebug
68
73
  rake
69
74
 
70
75
  BUNDLED WITH
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.6"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "pry"
24
+ spec.add_development_dependency "pry-byebug"
24
25
 
25
26
  spec.add_runtime_dependency 'launchy'
26
27
  spec.add_runtime_dependency 'plist4r'
@@ -3,14 +3,11 @@ require_relative 'binary_strings_widget'
3
3
  require_relative 'weak_class_dump_widget'
4
4
 
5
5
  module Idb
6
-
7
6
  class AppBinaryTabWidget < Qt::TabWidget
7
+ def initialize(*args)
8
+ super(*args)
8
9
 
9
-
10
- def initialize *args
11
- super *args
12
-
13
- @tabs = Hash.new
10
+ @tabs = {}
14
11
 
15
12
  @shared_libs = SharedLibrariesWidget.new self
16
13
  @tabs[:@shared_libs] = addTab(@shared_libs, "Shared Libraries")
@@ -20,14 +17,10 @@ module Idb
20
17
 
21
18
  @weak_class_dump = WeakClassDumpWidget.new self
22
19
  @tabs[:weak_class_dump] = addTab(@weak_class_dump, "Weak Class Dump")
23
-
24
-
25
20
  end
26
21
 
27
22
  def clear
28
- @tabs.each { |tab|
29
- tab.clear
30
- }
23
+ @tabs.each(&:clear)
31
24
  end
32
25
 
33
26
  def refresh_current_tab
@@ -37,9 +30,9 @@ module Idb
37
30
  def refresh
38
31
  end
39
32
 
40
- def enableTabs
33
+ def enable_tabs
41
34
  @shared_libs.setEnabled(true)
42
- setTabEnabled(@tabs[:@shared_libs],true)
35
+ setTabEnabled(@tabs[:@shared_libs], true)
43
36
  end
44
37
  end
45
- end
38
+ end
@@ -1,64 +1,61 @@
1
1
  require_relative '../lib/app'
2
2
 
3
3
  module Idb
4
-
5
4
  class AppDetailsGroupBox < Qt::GroupBox
6
5
  attr_accessor :uuid, :bundle_id, :vals, :icon
7
6
  signals "app_changed()"
8
7
  signals "show_device_status()"
9
8
 
10
- def initialize args
11
- super *args
9
+ def initialize(args)
10
+ super(*args)
12
11
 
13
12
  # details on selected app
14
13
  @layout = Qt::GridLayout.new
15
14
  setLayout(@layout)
16
15
  setTitle "App Details"
17
16
 
18
-
19
- @labels = Hash.new
20
- @vals = Hash.new
17
+ @labels = {}
18
+ @vals = {}
21
19
  @cur_row = 1
22
20
 
23
- addDetail 'bundle_id', 'Bundle ID'
24
- addDetail 'bundle_name', 'Bundle Name'
25
- addDetail 'uuid', 'UUID'
26
- addDetail 'url_handlers', 'URL Handlers'
27
- addDetail 'platform_version', 'Platform Version'
28
- addDetail 'sdk_version', 'SDK Version'
29
- addDetail 'minimum_os_version', 'Minimum OS'
30
- addDetail 'data_dir', 'Data Directory'
21
+ add_detail 'bundle_id', 'Bundle ID'
22
+ add_detail 'bundle_name', 'Bundle Name'
23
+ add_detail 'uuid', 'UUID'
24
+ add_detail 'url_handlers', 'URL Handlers'
25
+ add_detail 'platform_version', 'Platform Version'
26
+ add_detail 'sdk_version', 'SDK Version'
27
+ add_detail 'minimum_os_version', 'Minimum OS'
28
+ add_detail 'data_dir', 'Data Directory'
31
29
 
32
30
  @launch_app = Qt::PushButton.new "Launch App"
33
31
  @launch_app.setEnabled(false)
34
- @launch_app.connect(SIGNAL(:released)) {
32
+ @launch_app.connect(SIGNAL(:released)) do
35
33
  if $device.open_installed?
36
34
  $selected_app.launch
37
35
  else
36
+ msg = "'open' not found on the device. Please visit the status dialog and install it."
38
37
  error = Qt::MessageBox.new self
39
- error.setInformativeText("'open' not found on the device. Please visit the status dialog and install it.")
38
+ error.setInformativeText(msg)
40
39
  error.setIcon(Qt::MessageBox::Critical)
41
40
  error.setMinimumWidth(500)
42
41
  error.exec
43
- emit show_device_status()
42
+ emit show_device_status
44
43
  end
45
- }
44
+ end
46
45
 
47
46
  @layout.addWidget @launch_app, @cur_row, 0, 1, 2
48
47
 
49
- @cur_row+=1
48
+ @cur_row += 1
50
49
 
51
50
  @open_folder = Qt::PushButton.new "Open Local Temp Folder"
52
51
  @open_folder.setEnabled(false)
53
52
  @layout.addWidget @open_folder, @cur_row, 0, 1, 2
54
53
 
55
- @open_folder.connect(SIGNAL :released) {
54
+ @open_folder.connect(SIGNAL(:released)) do
56
55
  Launchy.open $selected_app.cache_dir
57
-
58
- }
56
+ end
59
57
 
60
58
  clear
61
-
62
59
  end
63
60
 
64
61
  def app_changed
@@ -69,12 +66,9 @@ module Idb
69
66
  @vals['platform_version'].setText($selected_app.platform_version)
70
67
  @vals['sdk_version'].setText($selected_app.sdk_version)
71
68
  @vals['minimum_os_version'].setText($selected_app.minimum_os_version)
72
- @vals['data_dir'].setText($selected_app.data_directory.sub("/private/var/mobile/Containers/Data/Application",""))
69
+ @vals['data_dir'].setText($selected_app.data_directory.sub($device.data_dir,''))
73
70
  @launch_app.setEnabled(true)
74
71
  @open_folder.setEnabled(true)
75
-
76
-
77
-
78
72
  end
79
73
 
80
74
  def clear
@@ -89,27 +83,20 @@ module Idb
89
83
  @vals['data_dir'].setText("[No Application Selected]")
90
84
  @launch_app.setEnabled(false)
91
85
  @open_folder.setEnabled(false)
92
-
93
86
  end
94
87
 
95
-
96
-
97
-
98
-
99
- def addDetail id, label
100
- @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
101
- @vals[id] = Qt::Label.new "", self, 0
88
+ def add_detail(id, label)
89
+ @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
90
+ @vals[id] = Qt::Label.new "", self, 0
102
91
  @layout.addWidget @labels[id], @cur_row, 0
103
92
  @layout.addWidget @vals[id], @cur_row, 1
104
93
  @cur_row += 1
105
94
  end
106
-
107
95
  end
108
96
 
109
-
110
97
  class AppEntitlementsGroupBox < Qt::GroupBox
111
- def initialize args
112
- super *args
98
+ def initialize(args)
99
+ super(*args)
113
100
 
114
101
  # details on selected app
115
102
 
@@ -117,104 +104,94 @@ module Idb
117
104
  setLayout(@layout)
118
105
  setTitle "App Entitlements"
119
106
 
120
- @labels = Hash.new
121
- @vals = Hash.new
107
+ @labels = {}
108
+ @vals = {}
122
109
  clear
123
110
 
124
- addDetail 'application-identifier', 'Application Identifier'
111
+ add_detail 'application-identifier', 'Application Identifier'
125
112
  @vals['application-identifier'].setText("[No Application Selected]")
126
113
  end
127
114
 
128
115
  def clear
129
- @labels.each { |x|
116
+ @labels.each do |x|
130
117
  @layout.removeWidget x[1]
131
118
  x[1].destroy
132
119
  x[1].dispose
133
- }
120
+ end
134
121
 
135
- @vals.each { |x|
122
+ @vals.each do |x|
136
123
  @layout.removeWidget x[1]
137
124
  x[1].destroy
138
125
  x[1].dispose
139
- }
126
+ end
140
127
 
141
- @labels = Hash.new
142
- @vals = Hash.new
128
+ @labels = {}
129
+ @vals = {}
143
130
  @cur_row = 1
144
-
145
-
146
-
147
131
  end
148
132
 
149
133
  def app_changed
150
134
  if $device.ios_version < 8
151
- addDetail 'application-identifier', 'Only available for iOS 8+'
135
+ add_detail 'application-identifier', 'Only available for iOS 8+'
152
136
  else
153
- $selected_app.services_map.entitlements_by_bundle_id($selected_app.bundle_id).each { |x|
154
- addDetail x[0].to_s, x[0].to_s
137
+ $selected_app.services_map.entitlements_by_bundle_id($selected_app.bundle_id).each do |x|
138
+ add_detail x[0].to_s, x[0].to_s
155
139
  @vals[x[0].to_s].setText(x[1].to_s)
156
- }
140
+ end
157
141
  end
158
-
159
142
  end
160
143
 
161
-
162
- def addDetail id, label
163
- @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
164
- @vals[id] = Qt::Label.new "", self, 0
144
+ def add_detail(id, label)
145
+ @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
146
+ @vals[id] = Qt::Label.new "", self, 0
165
147
  @layout.addWidget @labels[id], @cur_row, 0
166
148
  @layout.addWidget @vals[id], @cur_row, 1
167
149
  @cur_row += 1
168
150
  end
169
151
  end
170
152
 
171
-
172
-
173
153
  class AppBinaryGroupBox < Qt::GroupBox
174
154
  signals "binary_analyzed()"
175
155
 
176
- def initialize args
177
- super *args
156
+ def initialize(args)
157
+ super(*args)
178
158
 
179
159
  # details on selected app
180
160
  @layout = Qt::GridLayout.new
181
161
  setLayout(@layout)
182
162
  setTitle "App Binary"
183
163
 
184
-
185
164
  # analyze binary
186
165
  @analyze_binary_button = Qt::PushButton.new "Analyze Binary..."
187
166
  @analyze_binary_button.setEnabled(false)
188
- @analyze_binary_button.connect(SIGNAL(:released)) { |x|
189
- #TODO progress bar
167
+ @analyze_binary_button.connect(SIGNAL(:released)) do |_x|
168
+ # TODO: progress bar
190
169
  $selected_app.analyze
191
- @vals['encryption_enabled'].setText($selected_app.binary.is_encrypted?.to_s)
192
- @vals['cryptid'].setText($selected_app.binary.get_cryptid.to_s)
193
- @vals['pie'].setText($selected_app.binary.is_pie?.to_s)
194
- @vals['canaries'].setText($selected_app.binary.is_stack_protected?.to_s)
195
- @vals['arc'].setText($selected_app.binary.uses_arc?.to_s)
196
- emit binary_analyzed()
197
- }
170
+ @vals['encryption_enabled'].setText($selected_app.binary.encrypted?.to_s)
171
+ @vals['cryptid'].setText($selected_app.binary.cryptid.to_s)
172
+ @vals['pie'].setText($selected_app.binary.pie?.to_s)
173
+ @vals['canaries'].setText($selected_app.binary.stack_protected?.to_s)
174
+ @vals['arc'].setText($selected_app.binary.arc?.to_s)
175
+ emit binary_analyzed
176
+ end
198
177
  @layout.addWidget @analyze_binary_button, 0, 0, 1, 2
199
178
 
200
- @labels = Hash.new
201
- @vals = Hash.new
179
+ @labels = {}
180
+ @vals = {}
202
181
  @cur_row = 1
203
182
 
204
- addDetail 'encryption_enabled', 'Encryption?'
205
- addDetail 'cryptid', 'Cryptid'
206
- addDetail 'pie', 'PIE'
207
- addDetail 'canaries', 'Stack Canaries'
208
- addDetail 'arc', 'ARC'
183
+ add_detail 'encryption_enabled', 'Encryption?'
184
+ add_detail 'cryptid', 'Cryptid'
185
+ add_detail 'pie', 'PIE'
186
+ add_detail 'canaries', 'Stack Canaries'
187
+ add_detail 'arc', 'ARC'
209
188
 
210
189
  clear
211
-
212
190
  end
213
191
 
214
-
215
- def addDetail id, label
216
- @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
217
- @vals[id] = Qt::Label.new "", self, 0
192
+ def add_detail(id, label)
193
+ @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
194
+ @vals[id] = Qt::Label.new "", self, 0
218
195
  @layout.addWidget @labels[id], @cur_row, 0
219
196
  @layout.addWidget @vals[id], @cur_row, 1
220
197
  @cur_row += 1
@@ -236,7 +213,5 @@ module Idb
236
213
  def disable_analyze_binary
237
214
  @analyze_binary_button.setEnabled(false)
238
215
  end
239
-
240
-
241
216
  end
242
217
  end
@@ -3,63 +3,62 @@ module Idb
3
3
  class AppListDialog < Qt::Dialog
4
4
  attr_accessor :app_list
5
5
 
6
- def initialize *args
7
- super *args
6
+ def initialize(*args)
7
+ super(*args)
8
8
 
9
9
  setWindowTitle("App Selection")
10
10
  @layout = Qt::GridLayout.new
11
11
  setLayout(@layout)
12
12
 
13
13
  @app_list = Qt::ListWidget.new self
14
- @app_list.setSortingEnabled(true);
15
- @app_list.connect(SIGNAL('itemDoubleClicked(QListWidgetItem*)')) { |item|
14
+ @app_list.setSortingEnabled(true)
15
+ @app_list.connect(SIGNAL('itemDoubleClicked(QListWidgetItem*)')) do |_item|
16
16
  emit accept
17
- }
17
+ end
18
18
  @layout.addWidget @app_list, 0, 0, 1, 2
19
19
 
20
-
21
-
22
20
  @save_button = Qt::PushButton.new "Select"
23
21
  @save_button.setDefault true
24
22
 
25
- @save_button.connect(SIGNAL(:released)) {|x|
26
- accept()
27
- }
23
+ @save_button.connect(SIGNAL(:released)) do |_x|
24
+ accept
25
+ end
28
26
  @cancel_button = Qt::PushButton.new "Cancel"
29
- @cancel_button.connect(SIGNAL(:released)) {|x|
30
- reject()
31
- }
32
-
33
- unless refresh_app_list
34
- @save_button.setEnabled(false)
27
+ @cancel_button.connect(SIGNAL(:released)) do |_x|
28
+ reject
35
29
  end
36
30
 
31
+ @save_button.setEnabled(false) unless refresh_app_list
32
+
37
33
  @layout.addWidget @save_button, 1, 1
38
34
  @layout.addWidget @cancel_button, 1, 0
39
35
 
40
- setFixedHeight(500);
41
- setFixedWidth(400);
42
-
43
-
36
+ setFixedHeight(500)
37
+ setFixedWidth(400)
44
38
  end
45
39
 
46
40
  def refresh_app_list
47
41
  if $device.ios_version >= 8
48
- box = Qt::MessageBox.new 1, "Refreshing...", "Refreshing uicache to ensure app information is up-to-date. This may take a few seconds."
42
+ refresh_msg = "Refreshing uicache to ensure app information is" \
43
+ "up-to-date. This may take a few seconds."
44
+ box = Qt::MessageBox.new 1, "Refreshing...", refresh_msg
49
45
  box.setStandardButtons(0)
50
46
  box.show
51
47
  box.raise
52
48
  # need to refresh iOS uicache in case app was installed after last reboot.
53
- # Otherwise the /var/mobile/Library/MobileInstallation/LastLaunchServicesMap.plist will be out of date
49
+ # Otherwise /var/mobile/Library/MobileInstallation/LastLaunchServicesMap.plist
50
+ # will be out of date
54
51
  $device.ops.execute "/bin/su mobile -c /usr/bin/uicache"
55
52
  box.hide
56
53
  end
57
54
 
58
55
  begin
59
- app_uuids = $device.get_app_uuids
60
- rescue Exception => e
56
+ app_uuids = $device.app_uuids
57
+ rescue StandardError
61
58
  error = Qt::MessageBox.new
62
- error.setInformativeText("Unable to get list of applications. Ensure that you have at least one non-system app installed.")
59
+ msg = "Unable to get list of applications. Ensure that " \
60
+ "you have at least one non-system app installed."
61
+ error.setInformativeText(msg)
63
62
  error.setIcon(Qt::MessageBox::Critical)
64
63
  error.exec
65
64
  return false
@@ -67,24 +66,19 @@ module Idb
67
66
 
68
67
  progress = Qt::ProgressDialog.new "Reading App list...", nil, 1, app_uuids.size, self
69
68
  progress.setAutoClose true
70
- progress.setWindowModality(Qt::WindowModal);
69
+ progress.setWindowModality(Qt::WindowModal)
71
70
  progress.show
72
71
  progress.raise
73
72
 
74
-
75
- app_uuids.each { |uuid|
73
+ app_uuids.each do |uuid|
76
74
  a = App.new uuid
77
75
 
78
76
  i = AppListWidgetItem.new @app_list, 0
79
- i.setText (a.bundle_id.to_s + " => " + a.bundle_name.to_s)
77
+ i.setText(a.bundle_id.to_s + " => " + a.bundle_name.to_s)
80
78
  i.app = a
81
79
  @app_list.add_item i
82
- progress.setValue(progress.value+1);
83
-
84
-
85
- }
80
+ progress.setValue(progress.value + 1)
81
+ end
86
82
  end
87
-
88
-
89
83
  end
90
84
  end