mirror of
https://github.com/aydencharles/onionHEN.git
synced 2026-10-22 20:02:59 -05:00
34 lines
959 B
C
34 lines
959 B
C
/* Copyright (C) 2026 OnionHEN / LightningMods
|
|
*
|
|
* The unpacker's "give me the bootstrapper ELF" use case.
|
|
*
|
|
* Prefers the verified on-disk cache, falls back to the embedded LZMA blob,
|
|
* and refreshes the cache whenever it had to decompress. Every failure either
|
|
* falls back or notifies the user, so callers only decide whether to continue.
|
|
*
|
|
* Kept out of the composition root so main.c stays wiring only.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Return the bootstrapper ELF to hand to the external elfldr (caller free()),
|
|
* or NULL when neither the cache nor the embedded blob is usable. *@out_size
|
|
* receives the length on success and is left untouched on failure.
|
|
*
|
|
* A cache hit only replaces the LZMA decompression; both paths yield the same
|
|
* raw ELF. User-visible failures are notified here.
|
|
*/
|
|
uint8_t *bootstrap_acquire(size_t *out_size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|