Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
18d1ee3b
Commit
18d1ee3b
authored
Dec 11, 2008
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move stuff around to make code more organized.
parent
cd95e9bc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
1143 deletions
+53
-1143
Makefile.am
src/Makefile.am
+2
-2
initconf.c
src/initconf.c
+29
-1
lockdown.c
src/lockdown.c
+0
-27
lockdown.h
src/lockdown.h
+0
-2
plist.c
src/plist.c
+7
-1111
plist.h
src/plist.h
+15
-0
No files found.
src/Makefile.am
View file @
18d1ee3b
...
...
@@ -6,10 +6,10 @@ AM_LDFLAGS = $(libxml2_LIBS) $(libusb_LIBS) $(libglib2_LIBS) $(libgnutls_LIBS) $
bin_PROGRAMS
=
libiphone-initconf
libiphone_initconf_SOURCES
=
initconf.c userpref.c
lockdown.c plist.c usbmux.c iphone.c
utils.c
libiphone_initconf_SOURCES
=
initconf.c userpref.c utils.c
libiphone_initconf_CFLAGS
=
$(libgthread2_CFLAGS)
$(AM_CFLAGS)
libiphone_initconf_LDFLAGS
=
$(libgthread2_LIBS)
$(AM_LDFLAGS)
lib_LTLIBRARIES
=
libiphone.la
libiphone_la_SOURCES
=
usbmux.c iphone.c plist.c lockdown.c AFC.c userpref.c utils.c
libiphone_la_SOURCES
=
usbmux.c iphone.c plist.c
bplist.c xplist.c
lockdown.c AFC.c userpref.c utils.c
src/initconf.c
View file @
18d1ee3b
...
...
@@ -28,7 +28,6 @@
#include "libiphone/libiphone.h"
#include "userpref.h"
#include "lockdown.h"
#include "utils.h"
/** Generates a 2048 byte key, split into a function so that it can be run in a
...
...
@@ -60,6 +59,35 @@ void progress_bar(gpointer mutex)
g_thread_exit
(
0
);
}
int
get_rand
(
int
min
,
int
max
)
{
int
retval
=
(
rand
()
%
(
max
-
min
))
+
min
;
return
retval
;
}
/** Generates a valid HostID (which is actually a UUID).
*
* @param A null terminated string containing a valid HostID.
*/
char
*
lockdownd_generate_hostid
()
{
char
*
hostid
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
37
);
// HostID's are just UUID's, and UUID's are 36 characters long
const
char
*
chars
=
"ABCDEF0123456789"
;
srand
(
time
(
NULL
));
int
i
=
0
;
for
(
i
=
0
;
i
<
36
;
i
++
)
{
if
(
i
==
8
||
i
==
13
||
i
==
18
||
i
==
23
)
{
hostid
[
i
]
=
'-'
;
continue
;
}
else
{
hostid
[
i
]
=
chars
[
get_rand
(
0
,
16
)];
}
}
hostid
[
36
]
=
'\0'
;
// make it a real string
return
hostid
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
GThread
*
progress_thread
,
*
key_thread
;
...
...
src/lockdown.c
View file @
18d1ee3b
...
...
@@ -39,34 +39,7 @@ const ASN1_ARRAY_TYPE pkcs1_asn1_tab[] = {
{
0
,
0
,
0
}
};
int
get_rand
(
int
min
,
int
max
)
{
int
retval
=
(
rand
()
%
(
max
-
min
))
+
min
;
return
retval
;
}
/** Generates a valid HostID (which is actually a UUID).
*
* @param A null terminated string containing a valid HostID.
*/
char
*
lockdownd_generate_hostid
()
{
char
*
hostid
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
37
);
// HostID's are just UUID's, and UUID's are 36 characters long
const
char
*
chars
=
"ABCDEF0123456789"
;
srand
(
time
(
NULL
));
int
i
=
0
;
for
(
i
=
0
;
i
<
36
;
i
++
)
{
if
(
i
==
8
||
i
==
13
||
i
==
18
||
i
==
23
)
{
hostid
[
i
]
=
'-'
;
continue
;
}
else
{
hostid
[
i
]
=
chars
[
get_rand
(
0
,
16
)];
}
}
hostid
[
36
]
=
'\0'
;
// make it a real string
return
hostid
;
}
/** Creates a lockdownd client for the give iPhone.
*
...
...
src/lockdown.h
View file @
18d1ee3b
...
...
@@ -40,8 +40,6 @@ struct iphone_lckd_client_int {
int
gtls_buffer_hack_len
;
};
char
*
lockdownd_generate_hostid
();
iphone_lckd_client_t
new_lockdownd_client
(
iphone_device_t
phone
);
iphone_error_t
lockdownd_hello
(
iphone_lckd_client_t
control
);
iphone_error_t
lockdownd_generic_get_value
(
iphone_lckd_client_t
control
,
char
*
req_key
,
char
*
req_string
,
char
**
value
);
...
...
src/plist.c
View file @
18d1ee3b
This diff is collapsed.
Click to expand it.
src/plist.h
View file @
18d1ee3b
...
...
@@ -47,6 +47,20 @@ typedef enum {
}
plist_type
;
struct
plist_data
{
union
{
char
boolval
;
uint64_t
intval
;
double
realval
;
char
*
strval
;
wchar_t
*
unicodeval
;
char
*
buff
;
};
uint64_t
length
;
plist_type
type
;
};
typedef
GNode
*
plist_t
;
typedef
GNode
*
dict_t
;
...
...
@@ -67,4 +81,5 @@ void bin_to_plist(const char *plist_bin, uint32_t length, plist_t * plist);
GNode
*
find_query_node
(
plist_t
plist
,
char
*
key
,
char
*
request
);
GNode
*
find_node
(
plist_t
plist
,
plist_type
type
,
void
*
value
);
void
get_type_and_value
(
GNode
*
node
,
plist_type
*
type
,
void
*
value
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment