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
296a3850
Commit
296a3850
authored
Jan 29, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean some old stuff.
parent
8c2751f8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2 additions
and
127 deletions
+2
-127
plutil.c
plutil/plutil.c
+0
-2
Makefile.am
src/Makefile.am
+1
-1
bplist.c
src/bplist.c
+0
-11
plist.c
src/plist.c
+1
-1
plist.h
src/plist.h
+0
-3
utils.c
src/utils.c
+0
-77
utils.h
src/utils.h
+0
-30
xplist.c
src/xplist.c
+0
-2
No files found.
plutil/plutil.c
View file @
296a3850
...
...
@@ -38,8 +38,6 @@ int main(int argc, char *argv[])
return
0
;
}
iphone_set_debug
(
options
->
debug
);
//read input file
FILE
*
iplist
=
fopen
(
options
->
in_file
,
"r"
);
if
(
!
iplist
)
...
...
src/Makefile.am
View file @
296a3850
...
...
@@ -4,4 +4,4 @@ AM_CFLAGS = $(GLOBAL_CFLAGS) $(libxml2_CFLAGS) $(libglib2_CFLAGS)
AM_LDFLAGS
=
$(libxml2_LIBS)
$(libglib2_LIBS)
lib_LTLIBRARIES
=
libplist.la
libplist_la_SOURCES
=
plist.c bplist.c xplist.c
utils.c
libplist_la_SOURCES
=
plist.c bplist.c xplist.c
src/bplist.c
View file @
296a3850
...
...
@@ -380,12 +380,6 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
uint64_t
root_object
=
be64dec
(
trailer
+
BPLIST_TRL_ROOTOBJ_IDX
);
uint64_t
offset_table_index
=
be64dec
(
trailer
+
BPLIST_TRL_OFFTAB_IDX
);
log_debug_msg
(
"Offset size: %i
\n
"
,
offset_size
);
log_debug_msg
(
"Ref size: %i
\n
"
,
dict_param_size
);
log_debug_msg
(
"Number of objects: %lli
\n
"
,
num_objects
);
log_debug_msg
(
"Root object index: %lli
\n
"
,
root_object
);
log_debug_msg
(
"Offset table index: %lli
\n
"
,
offset_table_index
);
if
(
num_objects
==
0
)
return
;
...
...
@@ -403,10 +397,8 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
for
(
i
=
0
;
i
<
num_objects
;
i
++
)
{
current_offset
=
UINT_TO_HOST
(
offset_table
+
i
*
offset_size
,
offset_size
);
log_debug_msg
(
"parse_nodes: current_offset = %i
\n
"
,
current_offset
);
char
*
obj
=
plist_bin
+
current_offset
;
nodeslist
[
i
]
=
parse_bin_node
(
obj
,
dict_param_size
,
&
obj
);
log_debug_msg
(
"parse_nodes: parse_raw_node done
\n
"
);
}
//setup children for structured types
...
...
@@ -415,12 +407,10 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
for
(
i
=
0
;
i
<
num_objects
;
i
++
)
{
log_debug_msg
(
"parse_nodes: on node %i
\n
"
,
i
);
plist_data_t
data
=
plist_get_data
(
nodeslist
[
i
]);
switch
(
data
->
type
)
{
case
PLIST_DICT
:
log_debug_msg
(
"parse_nodes: dictionary found
\n
"
);
for
(
j
=
0
;
j
<
data
->
length
;
j
++
)
{
str_i
=
j
*
dict_param_size
;
str_j
=
(
j
+
data
->
length
)
*
dict_param_size
;
...
...
@@ -450,7 +440,6 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
break
;
case
PLIST_ARRAY
:
log_debug_msg
(
"parse_nodes: array found
\n
"
);
for
(
j
=
0
;
j
<
data
->
length
;
j
++
)
{
str_j
=
j
*
dict_param_size
;
index1
=
UINT_TO_HOST
(
data
->
buff
+
str_j
,
dict_param_size
);
...
...
src/plist.c
View file @
296a3850
...
...
@@ -22,7 +22,6 @@
#include <string.h>
#include <assert.h>
#include "utils.h"
#include "plist.h"
#include <stdlib.h>
#include <stdio.h>
...
...
@@ -118,6 +117,7 @@ static plist_t plist_add_sub_element(plist_t node, plist_type type, const void *
}
else
return
NULL
;
}
return
NULL
;
}
void
plist_free
(
plist_t
plist
)
...
...
src/plist.h
View file @
296a3850
...
...
@@ -30,9 +30,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include <glib.h>
#include "utils.h"
struct
plist_data_s
{
...
...
src/utils.c
deleted
100644 → 0
View file @
8c2751f8
/*
* utils.c
* contains utilitary methos for logging and debugging
*
* Copyright (c) 2008 Jonathan Beck All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdarg.h>
#include <stdio.h>
#include "utils.h"
int
toto_debug
=
0
;
/**
* Sets the level of debugging. Currently the only acceptable values are 0 and
* 1.
*
* @param level Set to 0 for no debugging or 1 for debugging.
*/
void
iphone_set_debug
(
int
level
)
{
toto_debug
=
level
;
}
void
log_debug_msg
(
const
char
*
format
,
...)
{
#ifndef STRIP_DEBUG_CODE
va_list
args
;
/* run the real fprintf */
va_start
(
args
,
format
);
if
(
toto_debug
)
vfprintf
(
stderr
,
format
,
args
);
va_end
(
args
);
#endif
}
inline
void
log_debug_buffer
(
const
char
*
data
,
const
int
length
)
{
#ifndef STRIP_DEBUG_CODE
/* run the real fprintf */
if
(
toto_debug
)
fwrite
(
data
,
1
,
length
,
stderr
);
#endif
}
inline
void
dump_debug_buffer
(
const
char
*
file
,
const
char
*
data
,
const
int
length
)
{
#ifndef STRIP_DEBUG_CODE
/* run the real fprintf */
if
(
toto_debug
)
{
FILE
*
my_ssl_packet
=
fopen
(
file
,
"w+"
);
fwrite
(
data
,
1
,
length
,
my_ssl_packet
);
fflush
(
my_ssl_packet
);
fprintf
(
stderr
,
"Wrote SSL packet to drive, too.
\n
"
);
fclose
(
my_ssl_packet
);
}
#endif
}
src/utils.h
deleted
100644 → 0
View file @
8c2751f8
/*
* utils.h
* contains utilitary methos for logging and debugging
*
* Copyright (c) 2008 Jonathan Beck All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef UTILS_H
#define UTILS_H
#include "libiphone/libiphone.h"
inline
void
log_debug_msg
(
const
char
*
format
,
...);
inline
void
log_debug_buffer
(
const
char
*
data
,
const
int
length
);
inline
void
dump_debug_buffer
(
const
char
*
file
,
const
char
*
data
,
const
int
length
);
#endif
src/xplist.c
View file @
296a3850
...
...
@@ -29,8 +29,6 @@
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <plist/plist.h>
#include "utils.h"
#include "plist.h"
#define XPLIST_TEXT BAD_CAST("text")
...
...
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