Files
onionHEN/source/util/tests
Hexwell 7ea2ba30c5 feat(cheats): sync cheat catalogs over HTTPS zip download
Replace the git clone/fetch pipeline with a curl + miniz HTTPS
ZIP download. The engine streams one archive, extracts only the
catalog roots, and reuses flatten to install flat files, so the
libgit2 submodule and its build integration are gone.

Drop the pre-download reachability probe and the commit-SHA
parser; reachability is implied by the download itself and the
SHA only fed the old git flow. Mirror selection stays in
CheatMirrorFactory (auto: cnb.cool for zh-Hans, GitHub otherwise;
explicit github/cnb skips fallback).

curl verifies peer+host against the embedded CA bundle and now
distinguishes certificate time-skew from other verification
failures, surfacing a dedicated clock notification. Revert the
util CMake target back to "util" now that libgit2 no longer
claims that name.
2026-08-18 15:41:08 +08:00
..

OnionHEN host unit tests

Host-side unit tests for shared libraries and util cheat file parsing (no PS5 SDK). Modeled after kylin-core/tests.

Run

cd source/util/tests
make test

Requirements:

  • Host clang / c++ (or set HOST_CC / HOST_CXX)
  • Keystone: /opt/homebrew by default (KEYSTONE_PREFIX=... if elsewhere)

Optional:

ONION_TEST_VERBOSE=1 make test   # extra klog-style noise on stderr
make clean && make test

Binary: source/util/build/host-tests/onion-host-tests

Coverage

Suite What it locks
test_cheat_utils hex decode, JSON extract, braces, replace_all, load buffer, ABI layout
test_cheat_parsers JSON / SHN / MC4 / ShnExt via factory + real fixtures
test_cheat_flatten extension match, TITLE/VERSION/PROCESS/HASH parse, flat install names, version sanitize
test_cheat_repository resolve TITLE_VERSION[_PROCESS][_HASH], process vs generic, hash match
test_git_mirror_factory archive URL factory; zh-Hans → cnb
test_cheat_catalog registry + catalog layout/slug (no host URLs)
test_cheat_sync mocked HTTPS ZIP download, miniz extraction, fallback, install and cleanup
test_payload libonion_payload ELF magic, package header, pid path/file, read_file
test_base64 encode / decode / round-trip (MC4 codec)
test_aes_cbc AES-256-CBC encrypt/decrypt with MC4 key/IV
test_hde64 x86_64 length decode (nop/ret/mov/jmp)
test_hotpatch aligned atomic entry-patch image, absolute jump encoding, preserved tail bytes, invalid input rejection
test_trampoline_arena same-code-page allocations are unique, non-overlapping, and owned by one near arena
test_hook_lifecycle Installing/Ready/Failed callback barrier state
test_x64_relocator relocation-aware trampolines: RIP-relative memory/call, rel8/rel32 call/jmp/jcc, internal targets, safe rejection
test_reg_entity registry entity-id formula (account slots)
test_toolbox_helpers UI path rewrite + payload .elf basename filter
test_settings semantic schema serialize/round-trip, partial INI defaults
test_ready ready markers, PID-bound process instances, path builder, name rejection, fps_overlay / util_booted flags, toolbox runtime-root marker
test_toolbox_injection same-PID skip, new-PID reinject, failure cleanup, concurrent request serialization
test_platform_fs if_exists / touch_file / rmtree (libonion_platform)
test_platform_log onion_log_configure + file sink
test_platform_notify onion_notify_format prefix/truncate + send stub
test_msg_protocol IPC paths, magic, command ordinals, IPC_Ret, message POD, reply JSON body
test_app_jailbreak_policy configurable app-jailbreak exact/prefix Title ID allowlist, including legacy Itemzflow ITEM00001
test_ps5_settings_ui fluent XML builder + escaping
test_toolbox_route resource → page routing + cheat map helpers
test_onpress_policy page-scoped OnPress ownership, stock-page pass-through, unrelated-resource stability

Intentionally not host-tested

Area Why
CheatApplier / memory backends needs target process / mdbg
libonion_proc allproc / ucred kernel_copyout
ShellUI Mono invocation / OnPress handlers SceShellUI; page ownership policy is host-tested
Full IPC server accept loop device sockets + daemon world
libNineS inject ptrace

Fixtures

fixtures/cheats/ — small subset of cheat samples (json / shn / mc4 / ShnExt).