mirror of
https://github.com/aydencharles/onionHEN.git
synced 2026-10-22 11:53:07 -05:00
Bring back DOWNLOAD_CHEATS as a background git clone/fetch of cheat catalogs, then reuse flatten to install flat files. Catalog identity and GitHub/cnb.cool mirrors stay in separate modules so a new source does not rewrite the download pipeline. auto mirror uses cnb.cool for zh-Hans and GitHub otherwise; explicit github/cnb skips fallback. libgit2 is an optional submodule (v1.8.4); without it the client stays a stub.
92 lines
3.1 KiB
C++
92 lines
3.1 KiB
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <sys/mman.h>
|
|
#include <string>
|
|
#include <sys/param.h>
|
|
#include <onion/system_tmp.h>
|
|
|
|
#define INVAIL -1
|
|
#define CRIT_IPC_SOC ONION_SYSTEM_TMP_CRIT_SOCKET
|
|
#define UTIL_IPC_SOC ONION_SYSTEM_TMP_UTIL_SOCKET
|
|
#define DAEMON_BUFF_MAX 0x1000
|
|
|
|
|
|
enum class IPC_Ret : int {
|
|
NO_ERROR = 0,
|
|
INVALID = -1,
|
|
// Distinct from INVALID so callers can tell "wrong daemon" from "op failed".
|
|
OPERATION_FAILED = -2,
|
|
DEFAULT_RET = -1337
|
|
};
|
|
|
|
/* Underlying type is unsigned: several stable opcodes use the high bit set. */
|
|
enum DaemonCommands : unsigned int {
|
|
BREW_TEST_CONNECTION = 0x9000000u,
|
|
BREW_RETURN_VALUE = 0x9000002u,
|
|
BREW_REMOUNT_FOLDER,
|
|
// Original 0x9000004. Keep the slot so released Itemzflow clients retain
|
|
// the numeric ABI even though OnionHEN does not bundle the legacy dumper.
|
|
BREW_UNUSED_ACTIVATE_DUMPER,
|
|
BREW_STAT_CMD,
|
|
BREW_CALC_DIR_SIZE,
|
|
BREW_COPY_FILE,
|
|
BREW_COPY_DIR,
|
|
BREW_DELETE_DIR,
|
|
BREW_UNUSED_1,// not used anymore but kept fopr backwards compatibility for now
|
|
BREW_TEST_SB_FILE,
|
|
BREW_DAEMON_PID,
|
|
BREW_UNUSED_STORE_INSTALLER,
|
|
BREW_UNUSED_DECRYPT_DIR, // was BREW_DECRYPT_DIR (SELF directory decrypt removed)
|
|
BREW_LAST_RET,
|
|
BREW_UNUSED_TESTKIT_CHECK, // was BREW_TESTKIT_CHECK (local probe used instead)
|
|
BREW_ENABLE_TOOLBOX,
|
|
BREW_CHMOD_DIR,
|
|
BREW_ADJUST_FAN_SPEED,
|
|
|
|
BREW_UTIL_TEST_CONNECTION = 0x8000000u,
|
|
BREW_UTIL_RETURN_VALUE = 0x8000002u,
|
|
BREW_UTIL_DAEMON_PID,
|
|
BREW_UTIL_UNUSED_FTP, // was BREW_UTIL_TOGGLE_FTP (service removed)
|
|
BREW_UTIL_UNUSED_KLOG, // was BREW_UTIL_TOGGLE_KLOG (service removed)
|
|
BREW_UTIL_UNUSED_DPI, // was TOGGLE_DPI (DirectPKGInstaller removed)
|
|
BREW_UTIL_LAUNCH_PAYLOAD,
|
|
BREW_UTIL_SHELLUI_ON_STANDBY,
|
|
BREW_UTIL_GET_GAME_VER,
|
|
BREW_UTIL_GET_GAME_CHEAT,
|
|
BREW_UTIL_TOGGLE_CHEAT,
|
|
BREW_UTIL_DOWNLOAD_CHEATS, // git catalog sync (was UNUSED after zip download removal)
|
|
BREW_UTIL_UNUSED_RELOAD_CHEATS, // was RELOAD_CHEATS (index cache removed; file-sig hot-reload)
|
|
BREW_UTIL_UNUSED_DOWNLOAD_KSTUFF, // was DOWNLOAD_KSTUFF (online kstuff download removed)
|
|
BREW_UTIL_UNUSED_LEGACY_CMD_SERVER, // was TOGGLE_LEGACY_CMD_SERVER (TCP 9028 removed)
|
|
BREW_UTIL_CHEAT_SYNC_STATUS, // last git cheat-sync snapshot
|
|
BREW_UTIL_UNUSED_3,
|
|
|
|
// Legacy: manual elfldr launch removed (embedded 9020 is bootstrapper-managed)
|
|
BREW_UTIL_LAUNCH_ELFLDR = 0xE1F1D8u,
|
|
BREW_RELOAD_SETTINGS = 0xC0FFEEu,
|
|
|
|
// BREW_TOGGLE_PS5DEBUG removed (ps5debug no longer embedded)
|
|
|
|
//KILL MAIN DAEMOM
|
|
BREW_KILL_DAEMON = 0xDEAD0001u,
|
|
/** Crit: kill onion_util.elf → SceShellUI → exit daemon (PC TCP :9048 also). */
|
|
BREW_SHUTDOWN_STACK = 0xDEAD0002u,
|
|
BREW_FORCE_KILL_PID = 0xDEADCAFEu,
|
|
};
|
|
|
|
/** TCP control port on crit daemon (LAN). Same wire as scripts/shutdown_onion.py. */
|
|
#define ONION_CTRL_TCP_PORT 9048
|
|
/** TCP control frame magic: ASCII 'ONIO' as BE u32. */
|
|
#define ONION_CTRL_TCP_MAGIC 0x4F4E494Fu
|
|
/** TCP cmd: full stack shutdown (util + ShellUI + daemon). */
|
|
#define ONION_CTRL_TCP_CMD_SHUTDOWN 1u
|
|
|
|
struct IPCMessage {
|
|
int magic = 0xDEADBABE;
|
|
enum DaemonCommands cmd;
|
|
int error = 0;
|
|
char msg[DAEMON_BUFF_MAX];
|
|
};
|