bincookie v0.1.7
A library to parse Apple's binarycookies format.
|
A parser for Apple's proprietary binary cookie storage format. More...
Go to the source code of this file.
Data Structures | |
struct | bincookie_iter_state_t |
Keeps track of iteration state when iterating cookie file pages. More... | |
struct | bincookie_cookie_t |
Cookie data structure. More... | |
struct | bincookie_page_t |
Cookie page structure. A page can consist of 1 or more cookies. More... | |
struct | bincookie_t |
bincookie file structure. More... | |
Macros | |
#define | bincookie_is_secure(cookie_ptr) |
#define | bincookie_domain_access_full(cookie_ptr) |
Check if a cookie can be used on all subdomains of its original domain. | |
#define | bincookie_iter_state_init(s) |
Initialise a bincookie_iter_state_t structure. | |
#define | bincookie_domain(c) |
Get the domain of a cookie. | |
#define | bincookie_path(c) |
Get the path of a cookie. | |
#define | bincookie_name(c) |
Get the name of a cookie. | |
#define | bincookie_value(c) |
Get the value of a cookie. | |
#define | APPLE_EPOCH_OFFSET 978307200 |
Difference between Apple's epoch (2001-01-01) and UNIX. | |
#define | bincookie_expiration_time(c) |
Get the expiration time of a cookie. | |
#define | bincookie_creation_time(c) |
Get the creation time of a cookie. | |
Enumerations | |
enum | bincookie_flag { secure , http_only } |
Security enabled for a cookie. More... | |
Functions | |
static bincookie_t *const | bincookie_init_file (FILE *fin) |
Read a binarycookies file. | |
static bincookie_t *const | bincookie_init_path (const char *file_path) |
Read a binarycookies file. | |
static bincookie_page_t *const | bincookie_iter_pages (const bincookie_t *bc, bincookie_iter_state_t *const state) |
Iterate pages of a binarycookies file. | |
static bincookie_cookie_t *const | bincookie_iter_cookies (const bincookie_page_t *page, unsigned int *i) |
Iterate cookies of a page. | |
A parser for Apple's proprietary binary cookie storage format.
Based on the Python script by Satishb3 satis.nosp@m.hb3@.nosp@m.secur.nosp@m.ityl.nosp@m.earn..nosp@m.net
Definition in file bincookie.h.
struct bincookie_iter_state_t |
Keeps track of iteration state when iterating cookie file pages.
Definition at line 102 of file bincookie.h.
Data Fields | ||
---|---|---|
uint32_t | page_index |
Current page. |
uint32_t | page_offset |
Current offset into the buffer. |
struct bincookie_cookie_t |
Cookie data structure.
Definition at line 108 of file bincookie.h.
Data Fields | ||
---|---|---|
double | create_date_epoch |
Creation date in Apple epoch format. |
uint32_t | domain_offset |
Offset of the domain name. |
double | expiry_date_epoch |
Expiry date in Apple epoch format. |
bincookie_flag | flags |
Flags used with the cookie. |
uint32_t | name_offset |
Offset of the name of the cookie. |
uint32_t | path_offset |
Offset of the path. |
uint32_t | size |
Size of the cookie data. |
uint32_t | value_offset |
Offset of the value. |
struct bincookie_page_t |
Cookie page structure. A page can consist of 1 or more cookies.
Definition at line 126 of file bincookie.h.
Data Fields | ||
---|---|---|
uint32_t | cookie_offsets[] |
Cookie offset values. |
uint32_t | num_cookies |
Number of cookies contained in this page. |
struct bincookie_t |
bincookie file structure.
Definition at line 134 of file bincookie.h.
Data Fields | ||
---|---|---|
unsigned char | magic[4] |
Magic: "cook" |
uint32_t | num_pages |
Number of pages in this file |
uint32_t | page_sizes[] |
Page sizes (same length as number of pages) |
#define bincookie_creation_time | ( | c | ) |
Get the creation time of a cookie.
c | Pointer to a bincookie_cookie_t structure. |
Definition at line 90 of file bincookie.h.
#define bincookie_domain | ( | c | ) |
Get the domain of a cookie.
c | Pointer to a bincookie_cookie_t structure. |
Definition at line 58 of file bincookie.h.
#define bincookie_domain_access_full | ( | cookie_ptr | ) |
Check if a cookie can be used on all subdomains of its original domain.
cookie_ptr | Pointer to a bincookie_cookie_t structure. |
Definition at line 45 of file bincookie.h.
#define bincookie_expiration_time | ( | c | ) |
Get the expiration time of a cookie.
c | Pointer to a bincookie_cookie_t structure. |
Definition at line 84 of file bincookie.h.
#define bincookie_is_secure | ( | cookie_ptr | ) |
Check if a cookie has the secure bit enabled (only to be accessed over HTTPS).
cookie_ptr | Pointer to a bincookie_cookie_t data structure. |
Definition at line 40 of file bincookie.h.
#define bincookie_iter_state_init | ( | s | ) |
Initialise a bincookie_iter_state_t structure.
s | bincookie_iter_state_t structure. |
Definition at line 51 of file bincookie.h.
#define bincookie_name | ( | c | ) |
Get the name of a cookie.
c | Pointer to a bincookie_cookie_t structure. \ |
Definition at line 70 of file bincookie.h.
#define bincookie_path | ( | c | ) |
Get the path of a cookie.
c | Pointer to a bincookie_cookie_t structure. \ |
Definition at line 63 of file bincookie.h.
#define bincookie_value | ( | c | ) |
Get the value of a cookie.
c | Pointer to a bincookie_cookie_t structure. |
Definition at line 77 of file bincookie.h.
enum bincookie_flag |
Security enabled for a cookie.
A cookie can be either or these values or 2 or more values OR'd together.
Enumerator | |
---|---|
secure | Cookie can only be used with HTTPS |
http_only | Cookie cannot be accessed by JavaScript |
Definition at line 96 of file bincookie.h.
|
inlinestatic |
Read a binarycookies file.
fin | Opened file handle. |
NULL
. Definition at line 145 of file bincookie.h.
|
inlinestatic |
Read a binarycookies file.
file_path | File path string. |
NULL
. Definition at line 186 of file bincookie.h.
|
inlinestatic |
Iterate cookies of a page.
page | Pointer to bincookie_page_t structure. |
i | Pointer to an integer to keep track of index. |
NULL
. Definition at line 220 of file bincookie.h.
|
inlinestatic |
Iterate pages of a binarycookies file.
bc | Pointer to bincookie_t structure. |
state | Pointer to bincookie_iter_state_t object. |
NULL
. Definition at line 201 of file bincookie.h.