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
a716448d
Commit
a716448d
authored
Feb 09, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for 3 bytes offsets.
parent
4278fced
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
bplist.c
src/bplist.c
+12
-2
No files found.
src/bplist.c
View file @
a716448d
...
@@ -75,19 +75,29 @@ static void byte_convert(uint8_t * address, size_t size)
...
@@ -75,19 +75,29 @@ static void byte_convert(uint8_t * address, size_t size)
#endif
#endif
}
}
static
uint32_t
uint24_from_be
(
char
*
buff
)
{
uint32_t
ret
=
0
;
char
*
tmp
=
(
char
*
)
&
ret
;
memcpy
(
tmp
+
1
,
buff
,
3
*
sizeof
(
char
));
byte_convert
(
tmp
,
sizeof
(
uint32_t
));
return
ret
;
}
#define UINT_TO_HOST(x, n) \
#define UINT_TO_HOST(x, n) \
(n == 8 ? GUINT64_FROM_BE( *(uint64_t *)(x) ) : \
(n == 8 ? GUINT64_FROM_BE( *(uint64_t *)(x) ) : \
(n == 4 ? GUINT32_FROM_BE( *(uint32_t *)(x) ) : \
(n == 4 ? GUINT32_FROM_BE( *(uint32_t *)(x) ) : \
(n == 3 ? uint24_from_be( x ) : \
(n == 2 ? GUINT16_FROM_BE( *(uint16_t *)(x) ) : \
(n == 2 ? GUINT16_FROM_BE( *(uint16_t *)(x) ) : \
*(uint8_t *)(x) )))
*(uint8_t *)(x) )))
)
#define be64dec(x) GUINT64_FROM_BE( *(uint64_t*)(x) )
#define be64dec(x) GUINT64_FROM_BE( *(uint64_t*)(x) )
#define get_needed_bytes(x) \
#define get_needed_bytes(x) \
( ((uint64_t)x) < (1ULL << 8) ? 1 : \
( ((uint64_t)x) < (1ULL << 8) ? 1 : \
( ((uint64_t)x) < (1ULL << 16) ? 2 : \
( ((uint64_t)x) < (1ULL << 16) ? 2 : \
( ((uint64_t)x) < (1ULL << 32) ? 4 : 8)))
( ((uint64_t)x) < (1ULL << 24) ? 3 : \
( ((uint64_t)x) < (1ULL << 32) ? 4 : 8))))
#define get_real_bytes(x) (x >> 32 ? 4 : 8)
#define get_real_bytes(x) (x >> 32 ? 4 : 8)
...
...
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