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
cd95e9bc
Commit
cd95e9bc
authored
Dec 10, 2008
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix minor programming erro plus enhance plutil to convert bin to xml and xml to bin.
parent
62563320
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
20 deletions
+17
-20
plutil.c
dev/plutil.c
+13
-16
plist.c
src/plist.c
+4
-4
No files found.
dev/plutil.c
View file @
cd95e9bc
...
...
@@ -18,8 +18,6 @@ int main(int argc, char *argv[])
Options
*
options
=
parse_arguments
(
argc
,
argv
);
int
argh
=
0
;
printf
(
"plistutil version 0.2 written by FxChiP
\n
"
);
if
(
!
options
)
{
print_usage
();
return
0
;
...
...
@@ -31,26 +29,25 @@ int main(int argc, char *argv[])
stat
(
options
->
in_file
,
filestats
);
printf
(
"here?
\n
"
);
char
*
bplist_entire
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
filestats
->
st_size
+
1
));
//argh = fgets(bplist_entire, filestats->st_size, bplist);
argh
=
fread
(
bplist_entire
,
sizeof
(
char
),
filestats
->
st_size
,
bplist
);
printf
(
"read %i bytes
\n
"
,
argh
);
fclose
(
bplist
);
printf
(
"or here?
\n
"
);
// bplist_entire contains our stuff
plist_t
root_node
=
NULL
;
bin_to_plist
(
bplist_entire
,
filestats
->
st_size
,
&
root_node
);
printf
(
"plutil debug mode
\n\n
"
);
printf
(
"file size %i
\n\n
"
,
(
int
)
filestats
->
st_size
);
if
(
!
root_node
)
{
printf
(
"Invalid binary plist (or some other error occurred.)
\n
"
);
return
0
;
}
char
*
plist_xml
=
NULL
;
char
*
plist_out
=
NULL
;
int
size
=
0
;
plist_to_xml
(
root_node
,
&
plist_xml
,
&
size
);
printf
(
"%s
\n
"
,
plist_xml
);
if
(
memcmp
(
bplist_entire
,
"bplist00"
,
8
)
==
0
)
{
bin_to_plist
(
bplist_entire
,
filestats
->
st_size
,
&
root_node
);
plist_to_xml
(
root_node
,
&
plist_out
,
&
size
);
}
else
{
xml_to_plist
(
bplist_entire
,
filestats
->
st_size
,
&
root_node
);
plist_to_bin
(
root_node
,
&
plist_out
,
&
size
);
}
printf
(
"%s
\n
"
,
plist_out
);
return
0
;
}
...
...
src/plist.c
View file @
cd95e9bc
...
...
@@ -1014,16 +1014,16 @@ guint plist_data_hash(gconstpointer key)
case
PLIST_REAL
:
buff
=
(
char
*
)
&
data
->
intval
;
size
=
8
;
break
;
case
PLIST_KEY
:
case
PLIST_STRING
:
buff
=
data
->
strval
;
size
=
strlen
(
buff
);
break
;
case
PLIST_UNICODE
:
buff
=
data
->
unicodeval
;
size
=
strlen
(
buff
)
*
sizeof
(
wchar_t
);
break
;
case
PLIST_DATA
:
case
PLIST_ARRAY
:
case
PLIST_DICT
:
...
...
@@ -1267,7 +1267,7 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
uint8_t
*
buff
=
NULL
;
uint8_t
size
=
0
;
uint64_t
offsets
[
num_objects
];
for
(
i
=
0
;
i
<
=
num_objects
;
i
++
)
{
for
(
i
=
0
;
i
<
num_objects
;
i
++
)
{
offsets
[
i
]
=
bplist_buff
->
len
;
struct
plist_data
*
data
=
(
struct
plist_data
*
)
((
GNode
*
)
g_ptr_array_index
(
objects
,
i
))
->
data
;
...
...
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