Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
p0sixspwn_limd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Projects in Disarray
Apple
p0sixspwn_limd
Commits
122f0fcc
Verified
Commit
122f0fcc
authored
3 years ago
by
Spotlight Deveaux
Browse files
Options
Downloads
Patches
Plain Diff
Fix compilation
parent
71ccd4ed
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.clang-format
+2
-0
2 additions, 0 deletions
.clang-format
Makefile
+2
-2
2 additions, 2 deletions
Makefile
mobile_inject.c
+13
-7
13 additions, 7 deletions
mobile_inject.c
with
17 additions
and
9 deletions
.clang-format
0 → 100644
+
2
−
0
View file @
122f0fcc
BasedOnStyle: LLVM
IndentWidth: 2
This diff is collapsed.
Click to expand it.
Makefile
+
2
−
2
View file @
122f0fcc
CFILES
=
mobile_inject.c
mobile_inject
:
mobile_inject.c
$(
CC
)
-o
mobile_inject
mobile_inject.c
-Wall
-limobiledevice
-lplist
mobile_inject
:
$(CFILES)
$(
CC
)
$(
CFILES
)
-o
mobile_inject
-Wall
`
pkg-config libimobiledevice-1.0
--libs
`
clean
:
rm
mobile_inject
This diff is collapsed.
Click to expand it.
mobile_inject.c
+
13
−
7
View file @
122f0fcc
...
...
@@ -16,7 +16,7 @@ static char *real_dmg, *real_dmg_signature, *root_dmg;
int
timesl
;
// Taken from
// https://github.com/libimobiledevice/libimobiledevice/blob/
00f8e5733f716da8032606566eac7a9e2e49514d
/tools/ideviceimagemounter.c#L1
28
-L1
3
5
// https://github.com/libimobiledevice/libimobiledevice/blob/
b3d35fbcf7a1ac669c2e80fbd58920941a5d4c0c
/tools/ideviceimagemounter.c#L1
46
-L15
3
static
void
print_xml
(
plist_t
node
)
{
char
*
xml
=
NULL
;
uint32_t
len
=
0
;
...
...
@@ -60,7 +60,7 @@ static void cb(const idevice_event_t *given_event, void *ignored_user_data) {
exit
(
2
);
}
Retry:
{}
Retry
:
{}
printf
(
"Starting AFC service...
\n
"
);
lockdownd_service_descriptor_t
afc_descriptor
=
0
;
assert
(
!
lockdownd_start_service
(
lockdown_client
,
"com.apple.afc"
,
...
...
@@ -88,6 +88,7 @@ static void cb(const idevice_event_t *given_event, void *ignored_user_data) {
"com.apple.mobile.mobile_image_mounter"
,
&
mim_descriptor
));
assert
(
!
property_list_service_client_new
(
dev
,
mim_descriptor
,
&
mim_client
));
// Get real DMG signature
int
fd
=
open
(
real_dmg_signature
,
O_RDONLY
);
assert
(
fd
!=
-
1
);
...
...
@@ -139,7 +140,8 @@ static void cb(const idevice_event_t *given_event, void *ignored_user_data) {
if
(
node
)
{
plist_get_string_val
(
node
,
&
status
);
if
(
!
status
)
{
printf
(
"Error: Seems like the status given wasn't a string:
\n
"
);
printf
(
"Error: Seems like the status given wasn't a "
"string:
\n
"
);
print_xml
(
mount_result_dict
);
exit
(
2
);
}
...
...
@@ -149,11 +151,13 @@ static void cb(const idevice_event_t *given_event, void *ignored_user_data) {
char
*
error_returned
=
NULL
;
plist_get_string_val
(
node
,
&
error_returned
);
if
(
!
error_returned
||
!
strcmp
(
error_returned
,
"ImageMountFailed"
))
{
printf
(
"Error: We somehow've already mounted our image. Reboot your device and run again.
\n
"
);
printf
(
"Error: We somehow've already mounted our "
"image. Reboot your device and run again.
\n
"
);
exit
(
3
);
}
}
printf
(
"Error: Doesn't seem there was any status given.. check for an error. Returned:
\n
"
);
printf
(
"Error: Doesn't seem there was any status given.. check "
"for an error. Returned:
\n
"
);
print_xml
(
mount_result_dict
);
status
=
""
;
}
...
...
@@ -172,7 +176,8 @@ static void cb(const idevice_event_t *given_event, void *ignored_user_data) {
printf
(
"Failed to start helper service: %d
\n
"
,
err
);
exit
(
4
);
}
assert
(
!
fcntl
(
helper_socket
,
F_SETFL
,
O_NONBLOCK
));
// We're all set!
exit
(
0
);
}
else
{
printf
(
"Failed to inject image, trying again... (if it fails, try a "
...
...
@@ -200,8 +205,9 @@ int main(int argc, char **argv) {
root_dmg
=
argv
[
3
];
// Loop while performing
assert
(
!
idevice_event_subscribe
(
cb
,
NULL
));
assert
(
idevice_event_subscribe
(
cb
,
NULL
)
==
IDEVICE_E_SUCCESS
);
while
(
1
)
{
// Loop as we wait for our callback to be called.
}
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment