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
5dc38059
Commit
5dc38059
authored
Aug 31, 2008
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefix public enum with IPHONE_
parent
8333ca94
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
22 deletions
+22
-22
libiphone.h
include/libiphone/libiphone.h
+13
-13
AFC.c
src/AFC.c
+1
-1
ifuse.c
src/ifuse.c
+5
-5
main.c
src/main.c
+3
-3
No files found.
include/libiphone/libiphone.h
View file @
5dc38059
...
@@ -48,18 +48,18 @@ extern "C" {
...
@@ -48,18 +48,18 @@ extern "C" {
//afc specific error
//afc specific error
#define IPHONE_E_NO_SUCH_FILE -12
#define IPHONE_E_NO_SUCH_FILE -12
typedef
shor
t
iphone_error_t
;
typedef
int16_
t
iphone_error_t
;
enum
{
typedef
enum
{
AFC_FILE_READ
=
0x00000002
,
// seems to be able to read and write files
IPHONE_
AFC_FILE_READ
=
0x00000002
,
// seems to be able to read and write files
AFC_FILE_WRITE
=
0x00000003
,
// writes and creates a file, blanks it out, etc.
IPHONE_
AFC_FILE_WRITE
=
0x00000003
,
// writes and creates a file, blanks it out, etc.
AFC_FILE_RW
=
0x00000005
,
// seems to do the same as 2. Might even create the file.
IPHONE_
AFC_FILE_RW
=
0x00000005
,
// seems to do the same as 2. Might even create the file.
AFC_FILE_OP4
=
0x00000004
,
// no idea -- appears to be "write" -- clears file beforehand like 3
IPHONE_
AFC_FILE_OP4
=
0x00000004
,
// no idea -- appears to be "write" -- clears file beforehand like 3
AFC_FILE_OP6
=
0x00000006
,
// no idea yet -- appears to be the same as 5.
IPHONE_
AFC_FILE_OP6
=
0x00000006
,
// no idea yet -- appears to be the same as 5.
AFC_FILE_OP1
=
0x00000001
,
// no idea juuust yet... probably read.
IPHONE_
AFC_FILE_OP1
=
0x00000001
,
// no idea juuust yet... probably read.
AFC_FILE_OP0
=
0x00000000
,
IPHONE_
AFC_FILE_OP0
=
0x00000000
,
AFC_FILE_OP10
=
0x0000000a
IPHONE_
AFC_FILE_OP10
=
0x0000000a
};
}
iphone_afc_file_mode_t
;
struct
iphone_device_int
;
struct
iphone_device_int
;
typedef
struct
iphone_device_int
*
iphone_device_t
;
typedef
struct
iphone_device_int
*
iphone_device_t
;
...
@@ -106,7 +106,7 @@ iphone_error_t iphone_afc_get_devinfo ( iphone_afc_client_t client, char ***info
...
@@ -106,7 +106,7 @@ iphone_error_t iphone_afc_get_devinfo ( iphone_afc_client_t client, char ***info
iphone_error_t
iphone_afc_get_dir_list
(
iphone_afc_client_t
client
,
const
char
*
dir
,
char
***
list
);
iphone_error_t
iphone_afc_get_dir_list
(
iphone_afc_client_t
client
,
const
char
*
dir
,
char
***
list
);
iphone_error_t
iphone_afc_get_file_attr
(
iphone_afc_client_t
client
,
const
char
*
filename
,
struct
stat
*
stbuf
);
iphone_error_t
iphone_afc_get_file_attr
(
iphone_afc_client_t
client
,
const
char
*
filename
,
struct
stat
*
stbuf
);
iphone_error_t
iphone_afc_open_file
(
iphone_afc_client_t
client
,
const
char
*
filename
,
uint32
_t
file_mode
,
iphone_afc_file_t
*
file
);
iphone_error_t
iphone_afc_open_file
(
iphone_afc_client_t
client
,
const
char
*
filename
,
iphone_afc_file_mode
_t
file_mode
,
iphone_afc_file_t
*
file
);
iphone_error_t
iphone_afc_close_file
(
iphone_afc_client_t
client
,
iphone_afc_file_t
file
);
iphone_error_t
iphone_afc_close_file
(
iphone_afc_client_t
client
,
iphone_afc_file_t
file
);
iphone_error_t
iphone_afc_read_file
(
iphone_afc_client_t
client
,
iphone_afc_file_t
file
,
char
*
data
,
int
length
,
uint32_t
*
bytes
);
iphone_error_t
iphone_afc_read_file
(
iphone_afc_client_t
client
,
iphone_afc_file_t
file
,
char
*
data
,
int
length
,
uint32_t
*
bytes
);
iphone_error_t
iphone_afc_write_file
(
iphone_afc_client_t
client
,
iphone_afc_file_t
file
,
const
char
*
data
,
int
length
,
uint32_t
*
bytes
);
iphone_error_t
iphone_afc_write_file
(
iphone_afc_client_t
client
,
iphone_afc_file_t
file
,
const
char
*
data
,
int
length
,
uint32_t
*
bytes
);
...
...
src/AFC.c
View file @
5dc38059
...
@@ -625,7 +625,7 @@ iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char
...
@@ -625,7 +625,7 @@ iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char
* received by afc_get_file_info) as well as the handle to the file or
* received by afc_get_file_info) as well as the handle to the file or
* NULL in the case of failure.
* NULL in the case of failure.
*/
*/
iphone_error_t
iphone_afc_open_file
(
iphone_afc_client_t
client
,
const
char
*
filename
,
uint32
_t
file_mode
,
iphone_afc_file_t
*
file
)
{
iphone_error_t
iphone_afc_open_file
(
iphone_afc_client_t
client
,
const
char
*
filename
,
iphone_afc_file_mode
_t
file_mode
,
iphone_afc_file_t
*
file
)
{
iphone_afc_file_t
file_loc
=
NULL
;
iphone_afc_file_t
file_loc
=
NULL
;
uint32
ag
=
0
;
uint32
ag
=
0
;
int
bytes
=
0
,
length
=
0
;
int
bytes
=
0
,
length
=
0
;
...
...
src/ifuse.c
View file @
5dc38059
...
@@ -76,7 +76,7 @@ static int ifuse_create(const char *path, mode_t mode, struct fuse_file_info *fi
...
@@ -76,7 +76,7 @@ static int ifuse_create(const char *path, mode_t mode, struct fuse_file_info *fi
iphone_afc_file_t
file
;
iphone_afc_file_t
file
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_open_file
(
afc
,
path
,
AFC_FILE_WRITE
,
&
file
);
iphone_afc_open_file
(
afc
,
path
,
IPHONE_
AFC_FILE_WRITE
,
&
file
);
fh_index
++
;
fh_index
++
;
fi
->
fh
=
fh_index
;
fi
->
fh
=
fh_index
;
g_hash_table_insert
(
file_handles
,
&
fh_index
,
file
);
g_hash_table_insert
(
file_handles
,
&
fh_index
,
file
);
...
@@ -89,11 +89,11 @@ static int ifuse_open(const char *path, struct fuse_file_info *fi) {
...
@@ -89,11 +89,11 @@ static int ifuse_open(const char *path, struct fuse_file_info *fi) {
uint32_t
mode
=
0
;
uint32_t
mode
=
0
;
if
((
fi
->
flags
&
3
)
==
O_RDWR
||
(
fi
->
flags
&
3
)
==
O_WRONLY
)
{
if
((
fi
->
flags
&
3
)
==
O_RDWR
||
(
fi
->
flags
&
3
)
==
O_WRONLY
)
{
mode
=
AFC_FILE_READ
;
mode
=
IPHONE_
AFC_FILE_READ
;
}
else
if
((
fi
->
flags
&
3
)
==
O_RDONLY
)
{
}
else
if
((
fi
->
flags
&
3
)
==
O_RDONLY
)
{
mode
=
AFC_FILE_READ
;
mode
=
IPHONE_
AFC_FILE_READ
;
}
else
{
}
else
{
mode
=
AFC_FILE_READ
;
mode
=
IPHONE_
AFC_FILE_READ
;
}
}
iphone_afc_open_file
(
afc
,
path
,
mode
,
&
file
);
iphone_afc_open_file
(
afc
,
path
,
mode
,
&
file
);
...
@@ -235,7 +235,7 @@ int ifuse_truncate(const char *path, off_t size) {
...
@@ -235,7 +235,7 @@ int ifuse_truncate(const char *path, off_t size) {
int
result
=
0
;
int
result
=
0
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_file_t
tfile
=
NULL
;
iphone_afc_file_t
tfile
=
NULL
;
iphone_afc_open_file
(
afc
,
path
,
AFC_FILE_READ
,
&
tfile
);
iphone_afc_open_file
(
afc
,
path
,
IPHONE_
AFC_FILE_READ
,
&
tfile
);
if
(
!
tfile
)
return
-
1
;
if
(
!
tfile
)
return
-
1
;
result
=
iphone_afc_truncate_file
(
afc
,
tfile
,
size
);
result
=
iphone_afc_truncate_file
(
afc
,
tfile
,
size
);
...
...
src/main.c
View file @
5dc38059
...
@@ -87,7 +87,7 @@ int main(int argc, char *argv[]) {
...
@@ -87,7 +87,7 @@ int main(int argc, char *argv[]) {
iphone_afc_file_t
my_file
=
NULL
;
iphone_afc_file_t
my_file
=
NULL
;
struct
stat
stbuf
;
struct
stat
stbuf
;
iphone_afc_get_file_attr
(
afc
,
"/iTunesOnTheGoPlaylist.plist"
,
&
stbuf
);
iphone_afc_get_file_attr
(
afc
,
"/iTunesOnTheGoPlaylist.plist"
,
&
stbuf
);
if
(
IPHONE_E_SUCCESS
==
iphone_afc_open_file
(
afc
,
"/iTunesOnTheGoPlaylist.plist"
,
AFC_FILE_READ
,
&
my_file
)
&&
my_file
)
{
if
(
IPHONE_E_SUCCESS
==
iphone_afc_open_file
(
afc
,
"/iTunesOnTheGoPlaylist.plist"
,
IPHONE_
AFC_FILE_READ
,
&
my_file
)
&&
my_file
)
{
printf
(
"A file size: %i
\n
"
,
stbuf
.
st_size
);
printf
(
"A file size: %i
\n
"
,
stbuf
.
st_size
);
char
*
file_data
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
stbuf
.
st_size
);
char
*
file_data
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
stbuf
.
st_size
);
iphone_afc_read_file
(
afc
,
my_file
,
file_data
,
stbuf
.
st_size
,
&
bytes
);
iphone_afc_read_file
(
afc
,
my_file
,
file_data
,
stbuf
.
st_size
,
&
bytes
);
...
@@ -100,7 +100,7 @@ int main(int argc, char *argv[]) {
...
@@ -100,7 +100,7 @@ int main(int argc, char *argv[]) {
free
(
file_data
);
free
(
file_data
);
}
else
printf
(
"couldn't open a file
\n
"
);
}
else
printf
(
"couldn't open a file
\n
"
);
iphone_afc_open_file
(
afc
,
"/readme.libiphone.fx"
,
AFC_FILE_WRITE
,
&
my_file
);
iphone_afc_open_file
(
afc
,
"/readme.libiphone.fx"
,
IPHONE_
AFC_FILE_WRITE
,
&
my_file
);
if
(
my_file
)
{
if
(
my_file
)
{
char
*
outdatafile
=
strdup
(
"this is a bitchin text file
\n
"
);
char
*
outdatafile
=
strdup
(
"this is a bitchin text file
\n
"
);
iphone_afc_write_file
(
afc
,
my_file
,
outdatafile
,
strlen
(
outdatafile
),
&
bytes
);
iphone_afc_write_file
(
afc
,
my_file
,
outdatafile
,
strlen
(
outdatafile
),
&
bytes
);
...
@@ -120,7 +120,7 @@ int main(int argc, char *argv[]) {
...
@@ -120,7 +120,7 @@ int main(int argc, char *argv[]) {
else
printf
(
"Failure. (expected unless you have a /renme file on your phone)
\n
"
);
else
printf
(
"Failure. (expected unless you have a /renme file on your phone)
\n
"
);
printf
(
"Seek & read
\n
"
);
printf
(
"Seek & read
\n
"
);
iphone_afc_open_file
(
afc
,
"/readme.libiphone.fx"
,
AFC_FILE_READ
,
&
my_file
);
iphone_afc_open_file
(
afc
,
"/readme.libiphone.fx"
,
IPHONE_
AFC_FILE_READ
,
&
my_file
);
if
(
IPHONE_E_SUCCESS
!=
iphone_afc_seek_file
(
afc
,
my_file
,
5
))
printf
(
"WARN: SEEK DID NOT WORK
\n
"
);
if
(
IPHONE_E_SUCCESS
!=
iphone_afc_seek_file
(
afc
,
my_file
,
5
))
printf
(
"WARN: SEEK DID NOT WORK
\n
"
);
char
*
threeletterword
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
5
);
char
*
threeletterword
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
5
);
iphone_afc_read_file
(
afc
,
my_file
,
threeletterword
,
3
,
&
bytes
);
iphone_afc_read_file
(
afc
,
my_file
,
threeletterword
,
3
,
&
bytes
);
...
...
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