idb 2.8.5 → 2.9.0
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/Gemfile.lock +12 -2
- data/idb.gemspec +1 -0
- data/lib/gui/app_list_dialog.rb +1 -1
- data/lib/gui/device_status_dialog.rb +2 -9
- data/lib/gui/fs_viewer_tab_widget.rb +2 -2
- data/lib/idb.rb +45 -54
- data/lib/idb/version.rb +1 -1
- data/lib/lib/app.rb +25 -12
- data/lib/lib/device.rb +31 -28
- data/lib/lib/otool_wrapper.rb +29 -14
- data/lib/lib/ssh_operations.rb +13 -3
- data/lib/lib/ssh_port_forwarder.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc3813e5d7a7c00e6f7bea27eaa8458f11079789
|
4
|
+
data.tar.gz: efa1b2b57cc7bc2ea41aefd2d273393e2574b8b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a8dd3eda610331196674b8fdc6401140a5d66a3b610e046e19ecd71de5b995107a3076b11d925f88b356f7bed1a0738be8a0faf596bec5bb39e546b7ad3ae4
|
7
|
+
data.tar.gz: 16b571a0abeb06e6c840723ae0c1479ddb26fbd6a2c35be4208254cce49fc179c9858a3a9778c8c44fe7c69e780184fa8698d51202f2b36561c55cb6878a2f17
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
idb (2.
|
4
|
+
idb (2.9.0)
|
5
5
|
awesome_print
|
6
6
|
coderay
|
7
7
|
ffi
|
@@ -37,18 +37,24 @@ GEM
|
|
37
37
|
libxml4r (0.2.6)
|
38
38
|
libxml-ruby (>= 1.1.3)
|
39
39
|
log4r (1.1.10)
|
40
|
+
method_source (0.8.2)
|
40
41
|
mini_portile2 (2.0.0)
|
41
42
|
net-sftp (2.1.2)
|
42
43
|
net-ssh (>= 2.6.5)
|
43
44
|
net-ssh (3.0.1)
|
44
|
-
nokogiri (1.6.7.
|
45
|
+
nokogiri (1.6.7.2)
|
45
46
|
mini_portile2 (~> 2.0.0.rc2)
|
46
47
|
plist4r (1.2.2)
|
47
48
|
haml
|
48
49
|
libxml-ruby
|
49
50
|
libxml4r
|
51
|
+
pry (0.10.4)
|
52
|
+
coderay (~> 1.1.0)
|
53
|
+
method_source (~> 0.8.1)
|
54
|
+
slop (~> 3.4)
|
50
55
|
qtbindings (4.8.6.2)
|
51
56
|
rake (10.4.2)
|
57
|
+
slop (3.6.0)
|
52
58
|
sqlite3 (1.3.11)
|
53
59
|
tilt (2.0.1)
|
54
60
|
|
@@ -58,4 +64,8 @@ PLATFORMS
|
|
58
64
|
DEPENDENCIES
|
59
65
|
bundler (~> 1.6)
|
60
66
|
idb!
|
67
|
+
pry
|
61
68
|
rake
|
69
|
+
|
70
|
+
BUNDLED WITH
|
71
|
+
1.12.5
|
data/idb.gemspec
CHANGED
data/lib/gui/app_list_dialog.rb
CHANGED
@@ -44,7 +44,7 @@ module Idb
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def refresh_app_list
|
47
|
-
if $device.ios_version
|
47
|
+
if $device.ios_version >= 8
|
48
48
|
box = Qt::MessageBox.new 1, "Refreshing...", "Refreshing uicache to ensure app information is up-to-date. This may take a few seconds."
|
49
49
|
box.setStandardButtons(0)
|
50
50
|
box.show
|
@@ -15,12 +15,6 @@ module Idb
|
|
15
15
|
setFixedHeight(sizeHint().height());
|
16
16
|
end
|
17
17
|
|
18
|
-
def mark_clutch_installed
|
19
|
-
@clutch_label.text = @clutch_label.text + "<br>found: #{$device.clutch_path}"
|
20
|
-
@layout.addWidget installed_check_mark, 8, 1
|
21
|
-
setFixedHeight(sizeHint().height());
|
22
|
-
end
|
23
|
-
|
24
18
|
def mark_keychain_editor_installed
|
25
19
|
@keychain_editor_label.text = @keychain_editor_label.text + "<br>found: #{$device.keychain_editor_path}"
|
26
20
|
@layout.addWidget installed_check_mark, 6, 1
|
@@ -275,7 +269,6 @@ module Idb
|
|
275
269
|
end
|
276
270
|
end
|
277
271
|
|
278
|
-
|
279
272
|
def initialize *args
|
280
273
|
super *args
|
281
274
|
@layout = Qt::GridLayout.new
|
@@ -287,7 +280,7 @@ module Idb
|
|
287
280
|
reject()
|
288
281
|
}
|
289
282
|
#TODO: prevent closing
|
290
|
-
@layout.addWidget @close_button,
|
283
|
+
@layout.addWidget @close_button, 10, 2
|
291
284
|
|
292
285
|
apt_get_section
|
293
286
|
open_section
|
@@ -305,4 +298,4 @@ module Idb
|
|
305
298
|
|
306
299
|
|
307
300
|
end
|
308
|
-
end
|
301
|
+
end
|
@@ -53,7 +53,7 @@ module Idb
|
|
53
53
|
@layout.addWidget @rsync, 0,4
|
54
54
|
@rsync.connect(SIGNAL :released) {
|
55
55
|
@manager.start_new_revision
|
56
|
-
if $device.ios_version
|
56
|
+
if $device.ios_version >= 8
|
57
57
|
@manager.sync_dir $selected_app.app_dir, "app_bundle"
|
58
58
|
@manager.sync_dir $selected_app.data_dir, "data_bundle"
|
59
59
|
else
|
@@ -328,7 +328,7 @@ module Idb
|
|
328
328
|
|
329
329
|
@controls.update_start
|
330
330
|
|
331
|
-
if $device.ios_version
|
331
|
+
if $device.ios_version >= 8
|
332
332
|
start_ios_8
|
333
333
|
else
|
334
334
|
start_ios_pre8
|
data/lib/idb.rb
CHANGED
@@ -24,71 +24,64 @@ module Idb
|
|
24
24
|
$height = 768
|
25
25
|
|
26
26
|
class Idb < Qt::MainWindow
|
27
|
+
def initialize
|
28
|
+
super
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
+
# initialize log
|
31
|
+
$log = Log4r::Logger.new 'idb'
|
32
|
+
outputter = Log4r::Outputter.stdout
|
33
|
+
outputter.formatter = Log4r::PatternFormatter.new(:pattern => "[%l] %d :: %c :: %m")
|
30
34
|
|
35
|
+
$log.outputters = [ outputter ]
|
31
36
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
if RUBY_VERSION.start_with? "2.0"
|
40
|
-
error = Qt::MessageBox.new
|
41
|
-
error.setInformativeText("You are using ruby 2.0 which does not work well with QT bindings: custom signals don't work. It is very likely that idb will not function as intended. Consider using ruby 1.9 or 2.1 instead.")
|
42
|
-
error.setIcon(Qt::MessageBox::Critical)
|
43
|
-
error.exec
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
# enable threading. See https://github.com/ryanmelt/qtbindings/issues/63
|
49
|
-
@thread_fix = QtThreadFix.new
|
50
|
-
settings_path = File.dirname(ENV['HOME'] + "/.idb/config/")
|
51
|
-
$tmp_path = ENV['HOME'] + "/.idb/tmp/"
|
52
|
-
puts $tmp_path
|
53
|
-
unless File.directory?(settings_path)
|
54
|
-
$log.info "Creating settings directory: #{settings_path}"
|
55
|
-
FileUtils.mkdir_p(settings_path)
|
56
|
-
end
|
37
|
+
if RUBY_VERSION.start_with? "2.0"
|
38
|
+
error = Qt::MessageBox.new
|
39
|
+
error.setInformativeText("You are using ruby 2.0 which does not work well with QT bindings: custom signals don't work. It is very likely that idb will not function as intended. Consider using ruby 1.9 or 2.1 instead.")
|
40
|
+
error.setIcon(Qt::MessageBox::Critical)
|
41
|
+
error.exec
|
42
|
+
end
|
57
43
|
|
58
|
-
|
59
|
-
|
44
|
+
# enable threading. See https://github.com/ryanmelt/qtbindings/issues/63
|
45
|
+
@thread_fix = QtThreadFix.new
|
46
|
+
settings_path = File.dirname(ENV['HOME'] + "/.idb/config/")
|
47
|
+
$tmp_path = ENV['HOME'] + "/.idb/tmp/"
|
48
|
+
puts $tmp_path
|
49
|
+
unless File.directory?(settings_path)
|
50
|
+
$log.info "Creating settings directory: #{settings_path}"
|
51
|
+
FileUtils.mkdir_p(settings_path)
|
52
|
+
end
|
60
53
|
|
61
|
-
|
62
|
-
|
63
|
-
setWindowIconText('idb')
|
64
|
-
init_ui
|
54
|
+
settings_filename = "settings.yml"
|
55
|
+
$settings = Settings.new "#{settings_path}/#{settings_filename}"
|
65
56
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
57
|
+
setWindowTitle "idb"
|
58
|
+
Qt::CoreApplication::setApplicationName("idb")
|
59
|
+
setWindowIconText('idb')
|
60
|
+
init_ui
|
70
61
|
|
71
|
-
|
62
|
+
self.showMaximized()
|
63
|
+
self.raise
|
64
|
+
self.activateWindow
|
72
65
|
|
73
|
-
|
74
|
-
self.raise
|
75
|
-
self.activateWindow
|
66
|
+
end
|
76
67
|
|
77
|
-
|
68
|
+
def self.root
|
69
|
+
File.expand_path('../..',__FILE__)
|
70
|
+
end
|
78
71
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
end
|
72
|
+
def self.execute_in_main_thread(blocking = false, sleep_period = 0.001)
|
73
|
+
if Thread.current != Thread.main
|
74
|
+
complete = false
|
75
|
+
QtThreadFix.ruby_thread_queue << lambda {|| yield; complete = true}
|
76
|
+
if blocking
|
77
|
+
until complete
|
78
|
+
sleep(sleep_period)
|
87
79
|
end
|
88
|
-
else
|
89
|
-
yield
|
90
80
|
end
|
81
|
+
else
|
82
|
+
yield
|
91
83
|
end
|
84
|
+
end
|
92
85
|
|
93
86
|
def init_ui
|
94
87
|
# setup central widget and grid layout
|
@@ -290,6 +283,4 @@ module Idb
|
|
290
283
|
|
291
284
|
end
|
292
285
|
end
|
293
|
-
|
294
|
-
|
295
286
|
end
|
data/lib/idb/version.rb
CHANGED
data/lib/lib/app.rb
CHANGED
@@ -16,15 +16,18 @@ module Idb
|
|
16
16
|
@app_dir = "#{$device.apps_dir}/#{@uuid}"
|
17
17
|
parse_info_plist
|
18
18
|
|
19
|
-
if $device.ios_version
|
20
|
-
|
19
|
+
if $device.ios_version >= 8
|
20
|
+
if $device.ios_version == 8
|
21
|
+
mapping_file = "/var/mobile/Library/MobileInstallation/LastLaunchServicesMap.plist"
|
22
|
+
else
|
23
|
+
mapping_file = "/private/var/installd/Library/MobileInstallation/LastLaunchServicesMap.plist"
|
24
|
+
end
|
21
25
|
local_mapping_file = cache_file mapping_file
|
22
26
|
@services_map = IOS8LastLaunchServicesMapWrapper.new local_mapping_file
|
23
|
-
|
24
27
|
@data_dir = @services_map.data_path_by_bundle_id @info_plist.bundle_identifier
|
25
28
|
@keychain_access_groups = @services_map.keychain_access_groups_by_bundle_id @info_plist.bundle_identifier
|
26
29
|
|
27
|
-
|
30
|
+
else
|
28
31
|
@data_dir = @app_dir
|
29
32
|
end
|
30
33
|
|
@@ -48,19 +51,29 @@ module Idb
|
|
48
51
|
end
|
49
52
|
|
50
53
|
def decrypt_binary!
|
54
|
+
$log.info "Running '#{binary_path}'"
|
55
|
+
full_remote_path = binary_path
|
56
|
+
$log.error "Decryption failed. Trying using dumpdecrypted..."
|
57
|
+
|
51
58
|
unless $device.dumpdecrypted_installed?
|
52
59
|
$log.error "dumpdecrypted not installed."
|
53
60
|
return false
|
54
61
|
end
|
55
62
|
|
56
|
-
|
63
|
+
dylib_path = $device.path_for("dumpdecrypted_#{$device.arch}".to_sym)
|
57
64
|
|
58
|
-
|
59
|
-
|
60
|
-
|
65
|
+
# If the ios version is less than 9 then we execute dumpdecrypted as
|
66
|
+
# root. iOS 9 requires dumpdecrypted to be run as the mobile user.
|
67
|
+
if $device.ios_version < 9
|
68
|
+
#TODO: Is this the best way to do this?
|
69
|
+
decrypted_path = "/var/root/#{File.basename full_remote_path}.decrypted"
|
70
|
+
$device.ops.execute "DYLD_INSERT_LIBRARIES=#{dylib_path} \"#{full_remote_path}\""
|
71
|
+
else
|
72
|
+
#TODO: Is this the best way to do this?
|
73
|
+
decrypted_path = "/var/mobile/#{File.basename full_remote_path}.decrypted"
|
74
|
+
$device.ops.execute "DYLD_INSERT_LIBRARIES=#{dylib_path} \"#{full_remote_path}\"", { as_user: "mobile" }
|
75
|
+
end
|
61
76
|
|
62
|
-
$device.ops.execute "cd /var/root/"
|
63
|
-
$device.ops.execute "DYLD_INSERT_LIBRARIES=dumpdecrypted_armv7.dylib \"#{full_remote_path}\""
|
64
77
|
$log.info "Checking if decrypted file #{decrypted_path} was created..."
|
65
78
|
if not $device.ops.file_exists? decrypted_path
|
66
79
|
$log.error "Decryption failed. Trying armv6 build for iOS 6 and earlier..."
|
@@ -164,8 +177,8 @@ module Idb
|
|
164
177
|
end
|
165
178
|
|
166
179
|
def data_directory
|
167
|
-
if $device.ios_version
|
168
|
-
"[iOS 8 specific]"
|
180
|
+
if $device.ios_version < 8
|
181
|
+
"[iOS 8+ specific]"
|
169
182
|
else
|
170
183
|
@data_dir
|
171
184
|
end
|
data/lib/lib/device.rb
CHANGED
@@ -29,9 +29,8 @@ module Idb
|
|
29
29
|
@device_app_paths[:keychaineditor] = [ "/var/root/keychaineditor"]
|
30
30
|
@device_app_paths[:pcviewer] = ["/var/root/protectionclassviewer"]
|
31
31
|
@device_app_paths[:pbwatcher] = ["/var/root/pbwatcher"]
|
32
|
-
@device_app_paths[:dumpdecrypted_armv7] = ["/
|
33
|
-
@device_app_paths[:dumpdecrypted_armv6] = ["/
|
34
|
-
@device_app_paths[:clutch] = ["/usr/bin/Clutch"]
|
32
|
+
@device_app_paths[:dumpdecrypted_armv7] = ["/usr/lib/dumpdecrypted_armv7.dylib"]
|
33
|
+
@device_app_paths[:dumpdecrypted_armv6] = ["/usr/lib/dumpdecrypted_armv6.dylib"]
|
35
34
|
|
36
35
|
if $settings['device_connection_mode'] == "ssh"
|
37
36
|
$log.debug "Connecting via SSH"
|
@@ -66,8 +65,15 @@ module Idb
|
|
66
65
|
@apps_dir_ios_8 = '/private/var/mobile/Containers/Bundle/Application'
|
67
66
|
@data_dir_ios_8 = '/private/var/mobile/Containers/Data/Application'
|
68
67
|
|
68
|
+
@apps_dir_ios_9 = '/private/var/containers/Bundle/Application'
|
69
|
+
@data_dir_ios_9 = @data_dir_ios_8
|
69
70
|
|
70
|
-
if @ops.directory? @
|
71
|
+
if @ops.directory? @apps_dir_ios_9
|
72
|
+
@ios_version = 9
|
73
|
+
@apps_dir = @apps_dir_ios_9
|
74
|
+
@data_dir = @data_dir_ios_9
|
75
|
+
|
76
|
+
elsif @ops.directory? @apps_dir_ios_8
|
71
77
|
@ios_version = 8
|
72
78
|
@apps_dir = @apps_dir_ios_8
|
73
79
|
@data_dir = @data_dir_ios_8
|
@@ -124,10 +130,6 @@ module Idb
|
|
124
130
|
@ops.launch_app(open_path, app.bundle_id)
|
125
131
|
end
|
126
132
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
133
|
def is_installed? tool
|
132
134
|
$log.info "Checking if #{tool} is installed..."
|
133
135
|
if path_for(tool).nil?
|
@@ -151,6 +153,9 @@ module Idb
|
|
151
153
|
|
152
154
|
def install_dumpdecrypted
|
153
155
|
upload_dumpdecrypted
|
156
|
+
# Change permissions as this needs to be run as the mobile user
|
157
|
+
@ops.chmod dumpdecrypted_path, 0755
|
158
|
+
@ops.chmod dumpdecrypted_path_armv6, 0755
|
154
159
|
end
|
155
160
|
|
156
161
|
def install_dumpdecrypted_old
|
@@ -216,8 +221,8 @@ module Idb
|
|
216
221
|
|
217
222
|
def upload_dumpdecrypted
|
218
223
|
$log.info "Uploading dumpdecrypted library..."
|
219
|
-
@ops.upload("#{
|
220
|
-
@ops.upload("#{
|
224
|
+
@ops.upload("#{Idb.root}/lib/utils/dumpdecrypted/dumpdecrypted_armv6.dylib", @device_app_paths[:dumpdecrypted_armv6].first)
|
225
|
+
@ops.upload("#{Idb.root}/lib/utils/dumpdecrypted/dumpdecrypted_armv7.dylib", @device_app_paths[:dumpdecrypted_armv7].first)
|
221
226
|
$log.info "'dumpdecrypted' installed successfully."
|
222
227
|
end
|
223
228
|
|
@@ -274,6 +279,7 @@ module Idb
|
|
274
279
|
end
|
275
280
|
end
|
276
281
|
def upload_pbwatcher
|
282
|
+
# TODO What's happening here?
|
277
283
|
begin
|
278
284
|
$log.info "Uploading pbwatcher..."
|
279
285
|
@ops.upload "#{File.dirname(File.expand_path(__FILE__))}/../utils/pbwatcher/pbwatcher", "/var/root/pbwatcher"
|
@@ -286,16 +292,15 @@ module Idb
|
|
286
292
|
end
|
287
293
|
end
|
288
294
|
|
289
|
-
def setup_clutch_sources
|
290
|
-
@ops.execute("echo “deb http://cydia.iphonecake.com ./“ > /etc/apt/sources.list.d/idb_clutch.list")
|
291
|
-
end
|
292
295
|
|
293
296
|
def install_from_cydia package
|
294
297
|
if apt_get_installed?
|
295
298
|
$log.info "Updating package repo..."
|
296
299
|
@ops.execute("#{apt_get_path} -y update")
|
297
300
|
$log.info "Installing #{package}..."
|
301
|
+
|
298
302
|
@ops.execute("#{apt_get_path} -y install #{package}")
|
303
|
+
|
299
304
|
return true
|
300
305
|
else
|
301
306
|
$log.error "apt-get or aptitude not found on the device"
|
@@ -307,10 +312,6 @@ module Idb
|
|
307
312
|
install_from_cydia "com.conradkramer.open"
|
308
313
|
end
|
309
314
|
|
310
|
-
def install_clutch
|
311
|
-
install_from_cydia "com.iphonecake.clutch"
|
312
|
-
end
|
313
|
-
|
314
315
|
def install_rsync
|
315
316
|
install_from_cydia "rsync"
|
316
317
|
end
|
@@ -350,7 +351,15 @@ module Idb
|
|
350
351
|
end
|
351
352
|
|
352
353
|
def configured?
|
353
|
-
apt_get_installed? and
|
354
|
+
apt_get_installed? and
|
355
|
+
open_installed? and
|
356
|
+
openurl_installed? and
|
357
|
+
dumpdecrypted_installed? and
|
358
|
+
pbwatcher_installed? and
|
359
|
+
pcviewer_installed? and
|
360
|
+
keychain_editor_installed? and
|
361
|
+
rsync_installed? and
|
362
|
+
cycript_installed?
|
354
363
|
end
|
355
364
|
|
356
365
|
|
@@ -391,16 +400,10 @@ module Idb
|
|
391
400
|
is_installed? :aptget
|
392
401
|
end
|
393
402
|
|
394
|
-
def clutch_installed?
|
395
|
-
is_installed? :clutch
|
396
|
-
end
|
397
|
-
|
398
403
|
def keychain_editor_path
|
399
404
|
path_for :keychaineditor
|
400
405
|
end
|
401
406
|
|
402
|
-
|
403
|
-
|
404
407
|
def pcviewer_path
|
405
408
|
path_for :pcviewer
|
406
409
|
end
|
@@ -415,6 +418,10 @@ module Idb
|
|
415
418
|
path_for :dumpdecrypted_armv7
|
416
419
|
end
|
417
420
|
|
421
|
+
def dumpdecrypted_path_armv6
|
422
|
+
path_for :dumpdecrypted_armv6
|
423
|
+
end
|
424
|
+
|
418
425
|
def rsync_path
|
419
426
|
path_for :rsync
|
420
427
|
end
|
@@ -434,10 +441,6 @@ module Idb
|
|
434
441
|
path_for :aptget
|
435
442
|
end
|
436
443
|
|
437
|
-
def clutch_path
|
438
|
-
path_for :clutch
|
439
|
-
end
|
440
|
-
|
441
444
|
def cycript_path
|
442
445
|
path_for :cycript
|
443
446
|
end
|
data/lib/lib/otool_wrapper.rb
CHANGED
@@ -58,6 +58,25 @@ module Idb
|
|
58
58
|
end
|
59
59
|
|
60
60
|
|
61
|
+
def hashify_otool_output(otool_output)
|
62
|
+
# otool output may contain multiple mach headers
|
63
|
+
mach_headers = otool_output.split("Mach header\n").map(&:strip)
|
64
|
+
|
65
|
+
# The newest otool version no longer echos the path of the binary being
|
66
|
+
# inspected. Here we reject that line if it shows up in the output of
|
67
|
+
# otool as well as any blank lines
|
68
|
+
mach_headers.reject!{|line| line == "" or line.include?(@binary)}
|
69
|
+
|
70
|
+
# convert otool output to a hash
|
71
|
+
mach_headers.map do |mach_header|
|
72
|
+
mach_hash = {}
|
73
|
+
headers, values = mach_header.split("\n").map(&:split)
|
74
|
+
headers.each_with_index do |header, index|
|
75
|
+
mach_hash[header] = values[index]
|
76
|
+
end
|
77
|
+
mach_hash
|
78
|
+
end
|
79
|
+
end
|
61
80
|
|
62
81
|
|
63
82
|
def parse_header
|
@@ -68,19 +87,19 @@ module Idb
|
|
68
87
|
pie_flag = 0x00200000
|
69
88
|
@raw_load_output = `#{@otool_path} -h '#{@binary}'`
|
70
89
|
|
71
|
-
# fourth row contains values. then split them up.
|
72
|
-
vals = @raw_load_output.split("\n")[3].split(" ")
|
73
90
|
|
74
|
-
|
75
|
-
|
91
|
+
mach_hashes = hashify_otool_output(@raw_load_output)
|
92
|
+
$log.info "Mach Hashes: #{mach_hashes}"
|
76
93
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
94
|
+
# extract the Position Independent Executable (PIE) flag from the flags
|
95
|
+
# value.
|
96
|
+
mach_hashes.each do |mach_hash|
|
97
|
+
if (mach_hash["flags"].to_i(16) & pie_flag) == pie_flag
|
98
|
+
@pie = true
|
99
|
+
else
|
100
|
+
@pie = false
|
101
|
+
end
|
81
102
|
end
|
82
|
-
|
83
|
-
|
84
103
|
end
|
85
104
|
|
86
105
|
def parse_load_commands
|
@@ -108,9 +127,5 @@ module Idb
|
|
108
127
|
end
|
109
128
|
}
|
110
129
|
end
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
130
|
end
|
116
131
|
end
|
data/lib/lib/ssh_operations.rb
CHANGED
@@ -36,8 +36,18 @@ module Idb
|
|
36
36
|
end
|
37
37
|
|
38
38
|
|
39
|
-
def execute(command)
|
40
|
-
|
39
|
+
def execute(command, opts={})
|
40
|
+
if opts[:as_user]
|
41
|
+
command = "su - #{ opts[:as_user] } -c \"#{command}\""
|
42
|
+
end
|
43
|
+
|
44
|
+
if opts[:non_blocking]
|
45
|
+
$log.debug "Executing non-blocking SSH command: #{command}"
|
46
|
+
@ssh.exec command
|
47
|
+
else
|
48
|
+
$log.debug "Executing blocking SSH command: #{command}"
|
49
|
+
@ssh.exec! command
|
50
|
+
end
|
41
51
|
end
|
42
52
|
|
43
53
|
def chmod file, permissions
|
@@ -133,4 +143,4 @@ module Idb
|
|
133
143
|
end
|
134
144
|
|
135
145
|
end
|
136
|
-
end
|
146
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel A. Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: launchy
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -383,7 +397,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
383
397
|
version: '0'
|
384
398
|
requirements: []
|
385
399
|
rubyforge_project:
|
386
|
-
rubygems_version: 2.
|
400
|
+
rubygems_version: 2.4.8
|
387
401
|
signing_key:
|
388
402
|
specification_version: 4
|
389
403
|
summary: idb is a tool to simplify some common tasks for iOS pentesting and research.
|