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
96ced4ea
Commit
96ced4ea
authored
Jan 28, 2017
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bplist: Improve writing of offset table
parent
369d72bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
12 deletions
+3
-12
bplist.c
src/bplist.c
+3
-12
No files found.
src/bplist.c
View file @
96ced4ea
...
...
@@ -1163,18 +1163,9 @@ PLIST_API void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
buff_len
=
bplist_buff
->
len
;
offset_size
=
get_needed_bytes
(
buff_len
);
offset_table_index
=
bplist_buff
->
len
;
for
(
i
=
0
;
i
<
num_objects
;
i
++
)
{
uint8_t
*
offsetbuff
=
(
uint8_t
*
)
malloc
(
offset_size
);
#ifdef __BIG_ENDIAN__
offsets
[
i
]
=
offsets
[
i
]
<<
((
sizeof
(
uint64_t
)
-
offset_size
)
*
8
);
#endif
memcpy
(
offsetbuff
,
&
offsets
[
i
],
offset_size
);
byte_convert
(
offsetbuff
,
offset_size
);
byte_array_append
(
bplist_buff
,
offsetbuff
,
offset_size
);
free
(
offsetbuff
);
for
(
i
=
0
;
i
<
num_objects
;
i
++
)
{
uint64_t
offset
=
be64toh
(
offsets
[
i
]);
byte_array_append
(
bplist_buff
,
(
uint8_t
*
)
&
offset
+
(
sizeof
(
uint64_t
)
-
offset_size
),
offset_size
);
}
//setup trailer
...
...
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