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
ad65cefa
Commit
ad65cefa
authored
Aug 19, 2008
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate usbmux.c.
parent
21d5d4ac
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
102 deletions
+105
-102
libiphone.h
include/libiphone/libiphone.h
+9
-8
iphone.c
src/iphone.c
+1
-2
lockdown.c
src/lockdown.c
+3
-3
lockdown.h
src/lockdown.h
+1
-1
usbmux.c
src/usbmux.c
+89
-81
usbmux.h
src/usbmux.h
+2
-7
No files found.
include/libiphone/libiphone.h
View file @
ad65cefa
...
...
@@ -32,18 +32,19 @@ extern "C" {
//general errors
#define IPHONE_E_SUCCESS 0
#define IPHONE_E_INVALID_ARG -1
#define IPHONE_E_NO_DEVICE -2
#define IPHONE_E_TIMEOUT -3
#define IPHONE_E_NOT_ENOUGH_DATA -4
#define IPHONE_E_BAD_HEADER -5
#define IPHONE_E_UNKNOWN_ERROR -2
#define IPHONE_E_NO_DEVICE -3
#define IPHONE_E_TIMEOUT -4
#define IPHONE_E_NOT_ENOUGH_DATA -5
#define IPHONE_E_BAD_HEADER -6
//lockdownd specific error
#define IPHONE_E_INVALID_CONF -
6
#define IPHONE_E_PAIRING_FAILED -
7
#define IPHONE_E_SSL_ERROR -
8
#define IPHONE_E_INVALID_CONF -
7
#define IPHONE_E_PAIRING_FAILED -
8
#define IPHONE_E_SSL_ERROR -
9
//afc specific error
#define IPHONE_E_NO_SUCH_FILE -
9
#define IPHONE_E_NO_SUCH_FILE -
10
struct
iphone_device_int
;
typedef
struct
iphone_device_int
*
iphone_device_t
;
...
...
src/iphone.c
View file @
ad65cefa
...
...
@@ -42,7 +42,6 @@ int iphone_get_device ( iphone_device_t *device ){
struct
usb_bus
*
bus
,
*
busses
;
struct
usb_device
*
dev
;
iphone_device_t
phone
=
(
iphone_device_t
)
malloc
(
sizeof
(
struct
iphone_device_int
));
usbmux_version_header
*
version
=
version_header
();
// Initialize the struct
phone
->
device
=
NULL
;
...
...
@@ -126,7 +125,7 @@ int iphone_get_device ( iphone_device_t *device ){
if
(
debug
)
fprintf
(
stderr
,
"get_iPhone(): Unknown error.
\n
"
);
free_iPhone
(
phone
);
free
(
version
);
return
IPHONE_E_
NO_DEVICE
;
// if it got to this point it's gotta be bad
return
IPHONE_E_
UNKNOWN_ERROR
;
// if it got to this point it's gotta be bad
}
/** Cleans up an iPhone structure, then frees the structure itself.
...
...
src/lockdown.c
View file @
ad65cefa
...
...
@@ -77,8 +77,8 @@ char *lockdownd_generate_hostid() {
iphone_lckd_client_t
new_lockdownd_client
(
iphone_device_t
phone
)
{
if
(
!
phone
)
return
NULL
;
iphone_lckd_client_t
control
=
(
iphone_lckd_client_t
)
malloc
(
sizeof
(
struct
iphone_lckd_client_int
));
control
->
connection
=
mux_connect
(
phone
,
0x0a00
,
0xf27e
);
if
(
!
control
->
connection
)
{
if
(
IPHONE_E_SUCCESS
!=
iphone_mux_new_client
(
phone
,
0x0a00
,
0xf27e
,
&
control
->
connection
)
)
{
free
(
control
);
return
NULL
;
}
...
...
@@ -100,7 +100,7 @@ void iphone_lckd_free_client( iphone_lckd_client_t client ) {
mux_close_connection
(
client
->
connection
);
}
if
(
client
->
ssl_session
)
gnutls_deinit
(
*
c
ontrol
->
ssl_session
);
if
(
client
->
ssl_session
)
gnutls_deinit
(
*
c
lient
->
ssl_session
);
free
(
client
->
ssl_session
);
free
(
client
);
}
...
...
src/lockdown.h
View file @
ad65cefa
...
...
@@ -33,7 +33,7 @@
struct
iphone_lckd_client_int
{
usbmux_connection
*
connection
;
iphone_umux_client_t
connection
;
gnutls_session_t
*
ssl_session
;
int
in_SSL
;
char
*
gtls_buffer_hack
;
...
...
src/usbmux.c
View file @
ad65cefa
This diff is collapsed.
Click to expand it.
src/usbmux.h
View file @
ad65cefa
...
...
@@ -43,12 +43,12 @@ typedef struct {
uint16
window
,
nullnull
,
length16
;
}
usbmux_tcp_header
;
typedef
struc
t
{
struct
iphone_umux_client_in
t
{
usbmux_tcp_header
*
header
;
iphone_device_t
phone
;
char
*
recv_buffer
;
int
r_len
;
}
usbmux_connection
;
};
usbmux_tcp_header
*
new_mux_packet
(
uint16
s_port
,
uint16
d_port
);
...
...
@@ -58,10 +58,5 @@ typedef struct {
usbmux_version_header
*
version_header
();
usbmux_connection
*
mux_connect
(
iphone_device_t
phone
,
uint16
s_port
,
uint16
d_port
);
void
mux_close_connection
(
usbmux_connection
*
connection
);
int
mux_send
(
usbmux_connection
*
connection
,
const
char
*
data
,
uint32
datalen
);
int
mux_recv
(
usbmux_connection
*
connection
,
char
*
data
,
uint32
datalen
);
#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