# Subsystem: include

## include/aes.c
- Doc: tiny-AES-c (https://github.com/kokke/tiny-AES-c)
- Layer: utility
- Language: c
- Symbols:
  - `__attribute__` (function, line 13) `static __attribute__((unused)) uint8_t getSBoxValue(uint8_t num)`
  - `__attribute__` (function, line 35) `static __attribute__((unused)) uint8_t getSBoxInvert(uint8_t num)`
  - `__attribute__` (function, line 57) `static __attribute__((unused)) uint8_t Td0(int x)`
  - `__attribute__` (function, line 58) `static __attribute__((unused)) uint8_t Td1(int x)`
  - `__attribute__` (function, line 59) `static __attribute__((unused)) uint8_t Td2(int x)`
  - `__attribute__` (function, line 60) `static __attribute__((unused)) uint8_t Td3(int x)`
  - `__attribute__` (function, line 61) `static __attribute__((unused)) uint8_t Td4(int x)`
  - `KeyExpansion` (function, line 166) `static void KeyExpansion(uint8_t* RoundKey, const uint8_t* Key)`
  - `AES_init_ctx` (function, line 239) `void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key)`
  - `AES_init_ctx_iv` (function, line 244) `void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, const uint8_t* iv)`
  - `AES_ctx_set_iv` (function, line 249) `void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv)`
  - `AddRoundKey` (function, line 257) `static void AddRoundKey(uint8_t round, state_t* state, const uint8_t* RoundKey)`
  - `SubBytes` (function, line 271) `static void SubBytes(state_t* state)`
  - `ShiftRows` (function, line 286) `static void ShiftRows(state_t* state)`
  - `xtime` (function, line 314) `static uint8_t xtime(uint8_t x)`
  - `MixColumns` (function, line 320) `static void MixColumns(state_t* state)`
  - `Multiply` (function, line 340) `static uint8_t Multiply(uint8_t x, uint8_t y)`
  - `InvMixColumns` (function, line 370) `static void InvMixColumns(state_t* state)`
  - `InvSubBytes` (function, line 391) `static void InvSubBytes(state_t* state)`
  - `InvShiftRows` (function, line 403) `static void InvShiftRows(state_t* state)`
  - `Cipher` (function, line 433) `static void Cipher(state_t* state, const uint8_t* RoundKey)`
  - `InvCipher` (function, line 459) `static void InvCipher(state_t* state, const uint8_t* RoundKey)`
  - `AES_ECB_encrypt` (function, line 490) `void AES_ECB_encrypt(const struct AES_ctx* ctx, uint8_t* buf)`
  - `AES_ECB_decrypt` (function, line 496) `void AES_ECB_decrypt(const struct AES_ctx* ctx, uint8_t* buf)`
  - `XorWithIv` (function, line 512) `static void XorWithIv(uint8_t* buf, const uint8_t* Iv)`
  - `AES_CBC_encrypt_buffer` (function, line 521) `void AES_CBC_encrypt_buffer(struct AES_ctx *ctx, uint8_t* buf, size_t length)`
  - `AES_CBC_decrypt_buffer` (function, line 536) `void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length)`
  - `AES_CTR_xcrypt_buffer` (function, line 558) `void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length)`
  - `Nb` (macro, line 5) `#define Nb`
  - `KEYLEN_256` (macro, line 9) `#define KEYLEN_256`
  - `RKLENGTH` (macro, line 10) `#define RKLENGTH`
  - `BLOCKLEN` (macro, line 11) `#define BLOCKLEN`
  - `Nb` (macro, line 67) `#define Nb`
  - `Nk` (macro, line 70) `#define Nk`
  - `Nr` (macro, line 71) `#define Nr`
  - `Nk` (macro, line 73) `#define Nk`
  - `Nr` (macro, line 74) `#define Nr`
  - `Nk` (macro, line 76) `#define Nk`
  - `Nr` (macro, line 77) `#define Nr`
  - `MULTIPLY_AS_A_FUNCTION` (macro, line 84) `#define MULTIPLY_AS_A_FUNCTION`
  - `getSBoxValue` (macro, line 163) `#define getSBoxValue(num)`
  - `Multiply` (macro, line 349) `#define Multiply(x, y)`
  - `getSBoxInvert` (macro, line 365) `#define getSBoxInvert(num)`
- Depends on: `include/aes.h`

## include/aes.h
- Doc: #define the macros below to 1/0 to enable/disable the mode of operation.
- Layer: utility
- Language: h
- Symbols:
  - `AES_ctx` (struct, line 33)
  - `AES_init_ctx` (function, line 41) `void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key);`
  - `AES_init_ctx_iv` (function, line 43) `void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, const uint8_t* iv);`
  - `AES_ctx_set_iv` (function, line 44) `void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv);`
  - `AES_ECB_encrypt` (function, line 48) `void AES_ECB_encrypt(const struct AES_ctx* ctx, uint8_t* buf);`
  - `AES_ECB_decrypt` (function, line 49) `void AES_ECB_decrypt(const struct AES_ctx* ctx, uint8_t* buf);`
  - `AES_CBC_encrypt_buffer` (function, line 53) `void AES_CBC_encrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length);`
  - `AES_CBC_decrypt_buffer` (function, line 54) `void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length);`
  - `AES_CTR_xcrypt_buffer` (function, line 58) `void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length);`
  - `_AES_H_` (macro, line 2) `#define _AES_H_`
  - `CBC` (macro, line 9) `#define CBC`
  - `ECB` (macro, line 12) `#define ECB`
  - `CTR` (macro, line 15) `#define CTR`
  - `AES256` (macro, line 18) `#define AES256`
  - `AES_BLOCKLEN` (macro, line 20) `#define AES_BLOCKLEN`
  - `AES_KEYLEN` (macro, line 23) `#define AES_KEYLEN`
  - `AES_keyExpSize` (macro, line 24) `#define AES_keyExpSize`
  - `AES_KEYLEN` (macro, line 26) `#define AES_KEYLEN`
  - `AES_keyExpSize` (macro, line 27) `#define AES_keyExpSize`
  - `AES_KEYLEN` (macro, line 29) `#define AES_KEYLEN`
  - `AES_keyExpSize` (macro, line 30) `#define AES_keyExpSize`
- Imported by: `include/aes.c`, `include/aes_cfb.c`, `include/beacon_common.c`

## include/aes_cfb.c
- Layer: utility
- Language: c
- Symbols:
  - `aes256_cfb_encrypt` (function, line 20) `unsigned char* aes256_cfb_encrypt(const unsigned char* key, const unsigned char* iv,
            ...`
  - `aes256_cfb_decrypt` (function, line 48) `unsigned char* aes256_cfb_decrypt(const unsigned char* key, const unsigned char* iv,
            ...`
- Depends on: `include/aes.h`

## include/aes_cfb.h
- Layer: utility
- Language: h
- Symbols:
  - `aes256_cfb_encrypt` (function, line 9) `unsigned char* aes256_cfb_encrypt(const unsigned char* key, const unsigned char* iv, const unsigned char* plaintext...`
  - `aes256_cfb_decrypt` (function, line 11) `unsigned char* aes256_cfb_decrypt(const unsigned char* key, const unsigned char* iv, const unsigned char*...`
  - `BSB_AES_CFB_H` (macro, line 5) `#define BSB_AES_CFB_H`
- Imported by: `tests/crypto_harness.c`

## include/beacon.h
- Doc: Tipos de callback  Estructura para parsing de datos (opcional, para comandos complejos)
- Layer: utility
- Language: h
- Symbols:
  - `datap` (struct, line 14)
  - `BeaconDataParse` (function, line 21) `void BeaconDataParse(datap *parser, char *buffer, int size);`
  - `BeaconDataPtr` (function, line 22) `char *BeaconDataPtr(datap *parser, int size);`
  - `BeaconDataInt` (function, line 23) `int BeaconDataInt(datap *parser);`
  - `BeaconDataShort` (function, line 24) `short BeaconDataShort(datap *parser);`
  - `BeaconDataLength` (function, line 25) `int BeaconDataLength(datap *parser);`
  - `BeaconDataExtract` (function, line 26) `char *BeaconDataExtract(datap *parser, int *size);`
  - `BeaconPrintf` (function, line 27) `void BeaconPrintf(int type, const char *fmt, ...);`
  - `BeaconOutput` (function, line 28) `void BeaconOutput(int type, const char *data, int len);`
  - `BEACON_API_H` (macro, line 3) `#define BEACON_API_H`
  - `CALLBACK_OUTPUT` (macro, line 9) `#define CALLBACK_OUTPUT`
  - `CALLBACK_ERROR` (macro, line 10) `#define CALLBACK_ERROR`
  - `CALLBACK_OUTPUT_OEM` (macro, line 11) `#define CALLBACK_OUTPUT_OEM`

## include/beacon_common.c
- Doc: MemoryStruct: if (g_cache_count >= g_cache_capacity) { size_t new_cap = g_cache_capacity ?...
- Layer: utility
- Language: c
- Symbols:
  - `MemoryStruct` (struct, line 220)
  - `bsb_output_init` (function, line 100) `int bsb_output_init(size_t capacity)`
  - `bsb_output_cleanup` (function, line 110) `void bsb_output_cleanup(void)`
  - `bsb_output_reset` (function, line 117) `void bsb_output_reset(void)`
  - `BeaconPrintf` (function, line 125) `void BeaconPrintf(int type, const char *fmt, ...)`
  - `BeaconOutput` (function, line 138) `void BeaconOutput(int type, const char *data, int len)`
  - `create_trampoline` (function, line 151) `void *create_trampoline(void *target)`
  - `cleanup_trampolines` (function, line 181) `void cleanup_trampolines(void)`
  - `get_or_create_trampoline` (function, line 196) `void *get_or_create_trampoline(void *target)`
  - `WriteMemoryCallback` (function, line 225) `static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)`
  - `https_request` (function, line 237) `http_response_t https_request(const bsb_config_t *cfg, const char *url,
                         ...`
  - `base64_encode` (function, line 291) `char *base64_encode(const unsigned char *input, int len)`
  - `base64_decode` (function, line 307) `unsigned char *base64_decode(const char *input, int *len)`
  - `_is_unreserved` (function, line 329) `static int _is_unreserved(unsigned char c)`
  - `url_encode` (function, line 335) `char *url_encode(const char *in, size_t in_len, size_t *out_len)`
  - `exec_cmd` (function, line 358) `char *exec_cmd(const char *cmd, int *out_len)`
  - `bsb_backoff_init` (function, line 385) `void bsb_backoff_init(bsb_backoff_t *bo, int base, int max)`
  - `bsb_backoff_next` (function, line 391) `int bsb_backoff_next(bsb_backoff_t *bo)`
  - `bsb_backoff_reset` (function, line 400) `void bsb_backoff_reset(bsb_backoff_t *bo)`
  - `get_local_ips` (function, line 405) `char *get_local_ips(void)`
  - `download_bof` (function, line 434) `unsigned char *download_bof(const bsb_config_t *cfg, const char *url, size_t *out_size)`
  - `init_function_pointers` (function, line 446) `static void init_function_pointers(void)`
  - `page_align` (function, line 472) `static size_t page_align(size_t size)`
  - `__attribute__` (function, line 478) `static void __attribute__((noinline)) call_bof_isolated(bof_func_t func, char *args, uintptr_t ar...`
  - `RunELF` (function, line 507) `int RunELF(const char *functionname, unsigned char *elf_data, uint32_t filesize,
           unsig...`
  - `run_bof_and_capture` (function, line 711) `char *run_bof_and_capture(unsigned char *elf_data, uint32_t filesize,
                           ...`
  - `_GNU_SOURCE` (macro, line 9) `#define _GNU_SOURCE`
- Depends on: `include/aes.h`, `include/beacon_common.h`, `include/cJSON.h`

## include/beacon_common.h
- Doc: http_response_t: -- HTTP response wrapper --- https_request now returns a proper struct instead...
- Layer: utility
- Language: h
- Symbols:
  - `http_response_t` (struct, line 32)
  - `Trampoline` (struct, line 39)
  - `SymbolResolver` (struct, line 48)
  - `TrampolineCache` (struct, line 54)
  - `bsb_backoff_t` (struct, line 173)
  - `bsb_output_init` (function, line 93) `int bsb_output_init(size_t capacity);`
  - `bsb_output_cleanup` (function, line 96) `void bsb_output_cleanup(void);`
  - `bsb_output_reset` (function, line 99) `void bsb_output_reset(void);`
  - `BeaconPrintf` (function, line 102) `void BeaconPrintf(int type, const char *fmt, ...);`
  - `BeaconOutput` (function, line 105) `void BeaconOutput(int type, const char *data, int len);`
  - `create_trampoline` (function, line 108) `void *create_trampoline(void *target);`
  - `cleanup_trampolines` (function, line 109) `void cleanup_trampolines(void);`
  - `get_or_create_trampoline` (function, line 110) `void *get_or_create_trampoline(void *target);`
  - `https_request` (function, line 116) `http_response_t https_request(const bsb_config_t *cfg, const char *url, const char *method, const char *post_data);`
  - `base64_encode` (function, line 122) `char *base64_encode(const unsigned char *input, int len);`
  - `base64_decode` (function, line 123) `unsigned char *base64_decode(const char *input, int *len);`
  - `url_encode` (function, line 126) `char *url_encode(const char *in, size_t in_len, size_t *out_len);`
  - `aes256_cfb_encrypt` (function, line 129) `unsigned char *aes256_cfb_encrypt(const unsigned char *key, const unsigned char *iv, const unsigned char *plaintext...`
  - `aes256_cfb_decrypt` (function, line 133) `unsigned char *aes256_cfb_decrypt(const unsigned char *key, const unsigned char *iv, const unsigned char...`
  - `buffer` (function, line 139) `* buffer (caller frees). On error, returns NULL. */ char *exec_cmd(const char *cmd, int *out_len);`
  - `RunELF` (function, line 147) `int RunELF(const char *functionname, unsigned char *elf_data, uint32_t filesize, unsigned char *argumentdata, int...`
  - `download_bof` (function, line 155) `unsigned char *download_bof(const bsb_config_t *cfg, const char *url, size_t *out_size);`
  - `run_bof_and_capture` (function, line 161) `char *run_bof_and_capture(unsigned char *elf_data, uint32_t filesize, char *args, int arglen, int *out_len);`
  - `get_local_ips` (function, line 169) `char *get_local_ips(void);`
  - `bsb_backoff_init` (function, line 179) `void bsb_backoff_init(bsb_backoff_t *bo, int base, int max);`
  - `bsb_backoff_next` (function, line 180) `int bsb_backoff_next(bsb_backoff_t *bo);`
  - `bsb_backoff_reset` (function, line 181) `void bsb_backoff_reset(bsb_backoff_t *bo);`
  - `g_beacon_output` (variable, line 60) `extern char *g_beacon_output;`
  - `g_output_len` (variable, line 61) `extern size_t g_output_len;`
  - `g_output_capacity` (variable, line 62) `extern size_t g_output_capacity;`
  - `g_printf_ptr` (variable, line 65) `extern void *g_printf_ptr;`
  - `g_strlen_ptr` (variable, line 66) `extern void *g_strlen_ptr;`
  - `g_memcpy_ptr` (variable, line 67) `extern void *g_memcpy_ptr;`
  - `g_memset_ptr` (variable, line 68) `extern void *g_memset_ptr;`
  - `g_exit_ptr` (variable, line 69) `extern void *g_exit_ptr;`
  - `g_dlsym_ptr` (variable, line 70) `extern void *g_dlsym_ptr;`
  - `g_dlerror_ptr` (variable, line 71) `extern void *g_dlerror_ptr;`
  - `g_dlopen_ptr` (variable, line 72) `extern void *g_dlopen_ptr;`
  - `g_dlclose_ptr` (variable, line 73) `extern void *g_dlclose_ptr;`
  - `g_write_ptr` (variable, line 74) `extern void *g_write_ptr;`
  - `g_mmap_ptr` (variable, line 75) `extern void *g_mmap_ptr;`
  - `g_munmap_ptr` (variable, line 76) `extern void *g_munmap_ptr;`
  - `g_BeaconPrintf_ptr` (variable, line 77) `extern void *g_BeaconPrintf_ptr;`
  - `g_BeaconOutput_ptr` (variable, line 78) `extern void *g_BeaconOutput_ptr;`
  - `g_socket_ptr` (variable, line 79) `extern void *g_socket_ptr;`
  - `g_connect_ptr` (variable, line 80) `extern void *g_connect_ptr;`
  - `g_inet_addr_ptr` (variable, line 81) `extern void *g_inet_addr_ptr;`
  - `g_htons_ptr` (variable, line 82) `extern void *g_htons_ptr;`
  - `g_send_ptr` (variable, line 83) `extern void *g_send_ptr;`
  - `g_recv_ptr` (variable, line 84) `extern void *g_recv_ptr;`
  - `g_close_ptr` (variable, line 85) `extern void *g_close_ptr;`
  - `g_getaddrinfo_ptr` (variable, line 86) `extern void *g_getaddrinfo_ptr;`
  - `g_freeaddrinfo_ptr` (variable, line 87) `extern void *g_freeaddrinfo_ptr;`
  - `BEACON_COMMON_H` (macro, line 13) `#define BEACON_COMMON_H`
  - `_GNU_SOURCE` (macro, line 15) `#define _GNU_SOURCE`
  - `BSB_OUTPUT_BUFFER_DEFAULT` (macro, line 26) `#define BSB_OUTPUT_BUFFER_DEFAULT`
  - `BSB_OUTPUT_TRUNCATION_MARKER` (macro, line 27) `#define BSB_OUTPUT_TRUNCATION_MARKER`
- Depends on: `include/config.h`
- Imported by: `beacons/v1/beacon.c`, `beacons/v2/beacon.c`, `beacons/v3/beacon.c`, `include/beacon_common.c`

## include/cJSON.c
- Doc: case_insensitive_strcmp: /* This is a safeguard to prevent copy-pasters from using incompatible...
- Layer: utility
- Language: c
- Symbols:
  - `internal_hooks` (struct, line 157)
  - `error` (struct, line 88)
  - `parse_buffer` (struct, line 291)
  - `printbuffer` (struct, line 482)
  - `CJSON_PUBLIC` (function, line 95) `CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void)`
  - `CJSON_PUBLIC` (function, line 100) `CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 110) `CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 125) `CJSON_PUBLIC(const char*) cJSON_Version(void)`
  - `case_insensitive_strcmp` (function, line 134) `static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2)`
  - `internal_malloc` (function, line 166) `static void * CJSON_CDECL internal_malloc(size_t size)`
  - `internal_free` (function, line 170) `static void CJSON_CDECL internal_free(void *pointer)`
  - `internal_realloc` (function, line 174) `static void * CJSON_CDECL internal_realloc(void *pointer, size_t size)`
  - `cJSON_strdup` (function, line 189) `static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks)`
  - `CJSON_PUBLIC` (function, line 210) `CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks)`
  - `cJSON_New_Item` (function, line 242) `static cJSON *cJSON_New_Item(const internal_hooks * const hooks)`
  - `get_decimal_point` (function, line 281) `static unsigned char get_decimal_point(void)`
  - `parse_number` (function, line 309) `static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer)`
  - `ensure` (function, line 494) `static unsigned char* ensure(printbuffer * const p, size_t needed)`
  - `update_offset` (function, line 579) `static void update_offset(printbuffer * const buffer)`
  - `compare_double` (function, line 592) `static cJSON_bool compare_double(double a, double b)`
  - `print_number` (function, line 599) `static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)`
  - `parse_hex4` (function, line 669) `static unsigned parse_hex4(const unsigned char * const input)`
  - `utf16_literal_to_utf8` (function, line 706) `static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsig...`
  - `parse_string` (function, line 827) `static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer)`
  - `print_string_ptr` (function, line 957) `static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_...`
  - `print_string` (function, line 1079) `static cJSON_bool print_string(const cJSON * const item, printbuffer * const p)`
  - `buffer_skip_whitespace` (function, line 1093) `static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer)`
  - `skip_utf8_bom` (function, line 1119) `static parse_buffer *skip_utf8_bom(parse_buffer * const buffer)`
  - `CJSON_PUBLIC` (function, line 1134) `CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON...`
  - `CJSON_PUBLIC` (function, line 1236) `CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length)`
  - `print` (function, line 1243) `static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * c...`
  - `CJSON_PUBLIC` (function, line 1316) `CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item)`
  - `CJSON_PUBLIC` (function, line 1321) `CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt)`
  - `CJSON_PUBLIC` (function, line 1352) `CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, con...`
  - `parse_value` (function, line 1372) `static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer)`
  - `print_value` (function, line 1427) `static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer)`
  - `parse_array` (function, line 1501) `static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer)`
  - `print_array` (function, line 1599) `static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer)`
  - `parse_object` (function, line 1661) `static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer)`
  - `print_object` (function, line 1780) `static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer)`
  - `get_array_item` (function, line 1916) `static cJSON* get_array_item(const cJSON *array, size_t index)`
  - `CJSON_PUBLIC` (function, line 1935) `CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index)`
  - `get_object_item` (function, line 1945) `static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bo...`
  - `CJSON_PUBLIC` (function, line 1977) `CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string)`
  - `CJSON_PUBLIC` (function, line 1982) `CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * c...`
  - `CJSON_PUBLIC` (function, line 1987) `CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string)`
  - `suffix_object` (function, line 1993) `static void suffix_object(cJSON *prev, cJSON *item)`
  - `create_reference` (function, line 2000) `static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks)`
  - `add_item_to_array` (function, line 2021) `static cJSON_bool add_item_to_array(cJSON *array, cJSON *item)`
  - `cast_away_const` (function, line 2066) `static void* cast_away_const(const void* string)`
  - `add_item_to_object` (function, line 2075) `static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * con...`
  - `CJSON_PUBLIC` (function, line 2112) `CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item)`
  - `CJSON_PUBLIC` (function, line 2123) `CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item)`
  - `CJSON_PUBLIC` (function, line 2133) `CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON ...`
  - `CJSON_PUBLIC` (function, line 2143) `CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name)`
  - `CJSON_PUBLIC` (function, line 2155) `CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name)`
  - `CJSON_PUBLIC` (function, line 2167) `CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name)`
  - `CJSON_PUBLIC` (function, line 2179) `CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const c...`
  - `CJSON_PUBLIC` (function, line 2191) `CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const...`
  - `CJSON_PUBLIC` (function, line 2203) `CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const...`
  - `CJSON_PUBLIC` (function, line 2215) `CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const ch...`
  - `CJSON_PUBLIC` (function, line 2227) `CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name)`
  - `CJSON_PUBLIC` (function, line 2239) `CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name)`
  - `CJSON_PUBLIC` (function, line 2251) `CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 2287) `CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which)`
  - `CJSON_PUBLIC` (function, line 2297) `CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which)`
  - `CJSON_PUBLIC` (function, line 2302) `CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string)`
  - `CJSON_PUBLIC` (function, line 2309) `CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string)`
  - `CJSON_PUBLIC` (function, line 2316) `CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string)`
  - `CJSON_PUBLIC` (function, line 2321) `CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string)`
  - `CJSON_PUBLIC` (function, line 2363) `CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJ...`
  - `CJSON_PUBLIC` (function, line 2413) `CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem)`
  - `replace_item_in_object` (function, line 2423) `static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, c...`
  - `CJSON_PUBLIC` (function, line 2446) `CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newi...`
  - `CJSON_PUBLIC` (function, line 2451) `CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string...`
  - `CJSON_PUBLIC` (function, line 2468) `CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void)`
  - `CJSON_PUBLIC` (function, line 2479) `CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void)`
  - `CJSON_PUBLIC` (function, line 2490) `CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean)`
  - `CJSON_PUBLIC` (function, line 2501) `CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num)`
  - `CJSON_PUBLIC` (function, line 2526) `CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)`
  - `CJSON_PUBLIC` (function, line 2543) `CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)`
  - `CJSON_PUBLIC` (function, line 2555) `CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child)`
  - `CJSON_PUBLIC` (function, line 2567) `CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child)`
  - `CJSON_PUBLIC` (function, line 2579) `CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw)`
  - `CJSON_PUBLIC` (function, line 2596) `CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void)`
  - `CJSON_PUBLIC` (function, line 2607) `CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void)`
  - `CJSON_PUBLIC` (function, line 2659) `CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count)`
  - `CJSON_PUBLIC` (function, line 2699) `CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count)`
  - `CJSON_PUBLIC` (function, line 2739) `CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count)`
  - `cJSON_Duplicate_rec` (function, line 2786) `cJSON * cJSON_Duplicate_rec(const cJSON *item, size_t depth, cJSON_bool recurse)`
  - `skip_oneline_comment` (function, line 2873) `static void skip_oneline_comment(char **input)`
  - `skip_multiline_comment` (function, line 2886) `static void skip_multiline_comment(char **input)`
  - `minify_string` (function, line 2900) `static void minify_string(char **input, char **output)`
  - `CJSON_PUBLIC` (function, line 2922) `CJSON_PUBLIC(void) cJSON_Minify(char *json)`
  - `CJSON_PUBLIC` (function, line 2972) `CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 2982) `CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 2992) `CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3002) `CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3012) `CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3022) `CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3032) `CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3042) `CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3052) `CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3062) `CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item)`
  - `CJSON_PUBLIC` (function, line 3072) `CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_...`
  - `cJSON_ArrayForEach` (function, line 3157) `cJSON_ArrayForEach(a_element, a)`
  - `cJSON_ArrayForEach` (function, line 3173) `cJSON_ArrayForEach(b_element, b)`
  - `CJSON_PUBLIC` (function, line 3194) `CJSON_PUBLIC(void *) cJSON_malloc(size_t size)`
  - `CJSON_PUBLIC` (function, line 3199) `CJSON_PUBLIC(void) cJSON_free(void *object)`
  - `_CRT_SECURE_NO_DEPRECATE` (macro, line 28) `#define _CRT_SECURE_NO_DEPRECATE`
  - `true` (macro, line 65) `#define true`
  - `false` (macro, line 70) `#define false`
  - `isinf` (macro, line 74) `#define isinf(d)`
  - `isnan` (macro, line 77) `#define isnan(d)`
  - `NAN` (macro, line 82) `#define NAN`
  - `NAN` (macro, line 84) `#define NAN`
  - `internal_malloc` (macro, line 179) `#define internal_malloc`
  - `internal_free` (macro, line 180) `#define internal_free`
  - `internal_realloc` (macro, line 181) `#define internal_realloc`
  - `static_strlen` (macro, line 185) `#define static_strlen(string_literal)`
  - `can_read` (macro, line 301) `#define can_read(buffer, size)`
  - `can_access_at_index` (macro, line 303) `#define can_access_at_index(buffer, index)`
  - `cannot_access_at_index` (macro, line 304) `#define cannot_access_at_index(buffer, index)`
  - `buffer_at_offset` (macro, line 306) `#define buffer_at_offset(buffer)`
  - `cjson_min` (macro, line 1241) `#define cjson_min(a, b)`
- Depends on: `include/cJSON.h`

## include/cJSON.h
- Doc: cJSON: #define cJSON_Invalid (0) #define cJSON_False  (1 << 0) #define cJSON_True   (1 << 1)...
- Layer: utility
- Language: h
- Symbols:
  - `cJSON` (struct, line 92)
  - `cJSON_Hooks` (struct, line 114)
  - `cJSON_bool` (type_alias, line 120) `typedef int cJSON_bool;`
  - `sensitive` (function, line 249) `* case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */...`
  - `next` (variable, line 27) `extern "C" { #endif #if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) ||...`
  - `cJSON__h` (macro, line 24) `#define cJSON__h`
  - `__WINDOWS__` (macro, line 32) `#define __WINDOWS__`
  - `CJSON_CDECL` (macro, line 44) `#define CJSON_CDECL`
  - `CJSON_STDCALL` (macro, line 45) `#define CJSON_STDCALL`
  - `CJSON_EXPORT_SYMBOLS` (macro, line 49) `#define CJSON_EXPORT_SYMBOLS`
  - `CJSON_PUBLIC` (macro, line 53) `#define CJSON_PUBLIC(type)`
  - `CJSON_PUBLIC` (macro, line 55) `#define CJSON_PUBLIC(type)`
  - `CJSON_PUBLIC` (macro, line 57) `#define CJSON_PUBLIC(type)`
  - `CJSON_CDECL` (macro, line 60) `#define CJSON_CDECL`
  - `CJSON_STDCALL` (macro, line 61) `#define CJSON_STDCALL`
  - `CJSON_PUBLIC` (macro, line 64) `#define CJSON_PUBLIC(type)`
  - `CJSON_PUBLIC` (macro, line 66) `#define CJSON_PUBLIC(type)`
  - `CJSON_VERSION_MAJOR` (macro, line 71) `#define CJSON_VERSION_MAJOR`
  - `CJSON_VERSION_MINOR` (macro, line 72) `#define CJSON_VERSION_MINOR`
  - `CJSON_VERSION_PATCH` (macro, line 73) `#define CJSON_VERSION_PATCH`
  - `cJSON_Invalid` (macro, line 78) `#define cJSON_Invalid`
  - `cJSON_False` (macro, line 79) `#define cJSON_False`
  - `cJSON_True` (macro, line 80) `#define cJSON_True`
  - `cJSON_NULL` (macro, line 81) `#define cJSON_NULL`
  - `cJSON_Number` (macro, line 82) `#define cJSON_Number`
  - `cJSON_String` (macro, line 83) `#define cJSON_String`
  - `cJSON_Array` (macro, line 84) `#define cJSON_Array`
  - `cJSON_Object` (macro, line 85) `#define cJSON_Object`
  - `cJSON_Raw` (macro, line 86) `#define cJSON_Raw`
  - `cJSON_IsReference` (macro, line 88) `#define cJSON_IsReference`
  - `cJSON_StringIsConst` (macro, line 89) `#define cJSON_StringIsConst`
  - `CJSON_NESTING_LIMIT` (macro, line 126) `#define CJSON_NESTING_LIMIT`
  - `CJSON_CIRCULAR_LIMIT` (macro, line 132) `#define CJSON_CIRCULAR_LIMIT`
  - `cJSON_SetIntValue` (macro, line 270) `#define cJSON_SetIntValue(object, number)`
  - `cJSON_SetNumberValue` (macro, line 273) `#define cJSON_SetNumberValue(object, number)`
  - `cJSON_SetBoolValue` (macro, line 278) `#define cJSON_SetBoolValue(object, boolValue)`
  - `cJSON_ArrayForEach` (macro, line 285) `#define cJSON_ArrayForEach(element, array)`
- Imported by: `include/beacon_common.c`, `include/cJSON.c`

## include/config.c
- Doc: slurp: declared in the schema.
- Layer: infrastructure
- Language: c
- Symbols:
  - `slurp` (function, line 24) `static char *slurp(const char *path, size_t *out_len)`
  - `skip_ws` (function, line 41) `static const char *skip_ws(const char *p, const char *end)`
  - `read_string` (function, line 49) `static int read_string(const char **pp, const char *end, char *out, size_t outsz)`
  - `read_int` (function, line 76) `static int read_int(const char **pp, const char *end, int *out)`
  - `read_bool` (function, line 92) `static int read_bool(const char **pp, const char *end, int *out)`
  - `expect` (function, line 100) `static int expect(const char **pp, const char *end, char c)`
  - `find_matching_brace` (function, line 109) `static const char *find_matching_brace(const char *p, const char *end)`
  - `skip_value` (function, line 132) `static const char *skip_value(const char *p, const char *end)`
  - `hex_to_bytes` (function, line 174) `static int hex_to_bytes(const char *hex, uint8_t *out, size_t outlen)`
  - `parse_c2` (function, line 186) `static void parse_c2(const char *p, const char *end, bsb_config_t *cfg)`
  - `parse_crypto` (function, line 209) `static void parse_crypto(const char *p, const char *end, bsb_config_t *cfg)`
  - `parse_timing` (function, line 230) `static void parse_timing(const char *p, const char *end, bsb_config_t *cfg)`
  - `parse_network` (function, line 253) `static void parse_network(const char *p, const char *end, bsb_config_t *cfg)`
  - `parse_bof` (function, line 289) `static void parse_bof(const char *p, const char *end, bsb_config_t *cfg)`
  - `parse_backoff` (function, line 308) `static void parse_backoff(const char *p, const char *end, bsb_config_t *cfg)`
  - `bsb_config_load` (function, line 328) `int bsb_config_load(const char *path, bsb_config_t *cfg, char *err, size_t errlen)`
  - `binary_dir` (function, line 420) `static const char *binary_dir(char *out, size_t outsz)`
  - `bsb_config_load_default` (function, line 438) `int bsb_config_load_default(bsb_config_t *cfg, char *err, size_t errlen)`
  - `bsb_config_sleep_seconds` (function, line 466) `int bsb_config_sleep_seconds(const bsb_config_t *cfg)`
  - `_POSIX_C_SOURCE` (macro, line 13) `#define _POSIX_C_SOURCE`
- Depends on: `include/config.h`

## include/config.h
- Doc: bsb_config_load: Load config from path.
- Layer: infrastructure
- Language: h
- Symbols:
  - `bsb_c2_t` (struct, line 30)
  - `bsb_crypto_t` (struct, line 37)
  - `bsb_timing_t` (struct, line 42)
  - `bsb_network_t` (struct, line 49)
  - `bsb_bof_t` (struct, line 55)
  - `bsb_backoff_config_t` (struct, line 60)
  - `bsb_config_t` (struct, line 65)
  - `bsb_config_load` (function, line 77) `int bsb_config_load(const char *path, bsb_config_t *cfg, char *err, size_t errlen);`
  - `bsb_config_load_default` (function, line 80) `int bsb_config_load_default(bsb_config_t *cfg, char *err, size_t errlen);`
  - `bsb_config_sleep_seconds` (function, line 83) `int bsb_config_sleep_seconds(const bsb_config_t *cfg);`
  - `BSB_CONFIG_H` (macro, line 14) `#define BSB_CONFIG_H`
  - `BSB_CONFIG_PATH_DEFAULT` (macro, line 19) `#define BSB_CONFIG_PATH_DEFAULT`
  - `BSB_CONFIG_PATH_ENV` (macro, line 20) `#define BSB_CONFIG_PATH_ENV`
  - `BSB_MAX_URL` (macro, line 21) `#define BSB_MAX_URL`
  - `BSB_MAX_URI` (macro, line 22) `#define BSB_MAX_URI`
  - `BSB_MAX_CLIENT_ID` (macro, line 23) `#define BSB_MAX_CLIENT_ID`
  - `BSB_AES_KEY_HEX_LEN` (macro, line 24) `#define BSB_AES_KEY_HEX_LEN`
  - `BSB_AES_KEY_BYTES` (macro, line 25) `#define BSB_AES_KEY_BYTES`
  - `BSB_MAX_USER_AGENTS` (macro, line 26) `#define BSB_MAX_USER_AGENTS`
  - `BSB_USER_AGENT_LEN` (macro, line 27) `#define BSB_USER_AGENT_LEN`
  - `BSB_REPORT_URI_DEFAULT` (macro, line 28) `#define BSB_REPORT_URI_DEFAULT`
- Imported by: `include/beacon_common.h`, `include/config.c`, `tests/config_harness.c`

## include/config_py.py
- Doc: Python loader for BSB JSON config files.
- Layer: infrastructure
- Language: py
- Symbols:
  - `_deep_merge` (function, line 55) `def _deep_merge(base, overlay)`
  - `load_config` (function, line 65) `def load_config(path)`
- Imported by: `c2/server.py`
