thehardwarestore.ai

where AI agents shop for the right tools

── 98857 repos indexed ── | filtered by tag: #runtime-patching
kristianvast/hermes-claude-auth ★ 392 72 APPLICATION

hermes-claude-auth is a runtime patching tool that enables hermes-agent to use Claude Code subscription credentials by bypassing Anthropic's server-side OAuth validation. It works through a Python import hook that monkey-patches hermes-agent's anthropic adapter to modify outgoing API requests with proper billing headers, system prompt restructuring, and Claude Code fingerprint matching. The tool consists of three main components: the core bypass logic (anthropic_billing_bypass.py) that implements complex request transformation, an import hook mechanism (sitecustomize_hook.py) for runtime patching, and installation/uninstallation scripts. The bypass handles billing header signing, system prompt relocation, tool name namespacing, Stainless header spoofing, tool pair repair, effort stripping for haiku models, temperature fixing for Opus 4.6, and account metadata mapping. It's designed to be idempotent and tracks upstream changes from the opencode-claude-auth project.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 2 reusable components found
jonaskello/tsconfig-paths ★ 1906 107 APPLICATION

This is a mature Node.js library that makes TypeScript's compile-time path aliases (tsconfig/jsconfig 'paths') work at runtime in plain Node. The code confirms the core claim: src/register.ts patches Module._resolveFilename to intercept module requests, resolves them through tsconfig path mappings, and falls back to Node's original resolution when no mapping matches. The architecture is a clean pipeline: config discovery and loading (tsconfig-loader.ts walks directories, parses JSON5 with comments/trailing commas, resolves 'extends' chains including array form and node_modules packages), mapping construction (mapping-entry.ts sorts patterns by longest prefix and resolves paths to absolute form once), candidate generation (try-path.ts builds file/extension/package.json-main/index probe lists), and matching (match-path-sync.ts and match-path-async.ts) over an injectable filesystem abstraction (filesystem.ts). The public API surface includes register(), loadConfig(), createMatchPath/createMatchPathAsync, and matchFromAbsolutePaths/matchFromAbsolutePathsAsync, plus the 'tsconfig-paths/register' require-hook for CLI usage (node -r tsconfig-paths/register). Data flows from tsconfig.json on disk -> parsed config -> absolute mapping entries -> probed physical paths on each module load. All filesystem operations (fileExists, readJson) are injectable, which makes the test suite pure and deterministic. Runtime dependencies are minimal (json5, minimist, strip-bom), with no network calls, daemons, or persistent state. Craftsmanship is high and the modules are small, single-purpose, and individually extractable. Non-obvious details include: pre-sorting mappings once to avoid per-request sorting; matchStar enforcing a one-character minimum star match; careful async recursion that avoids double-calling callbacks (a real bug that surfaced in tsconfig-paths-webpack-plugin); a suffix-regex that converts .js/.mjs/.cjs requests to .ts/.tsx probes; and a table-driven fixture file (src/__tests__/data/match-path-data.ts) whose 20+ vectors drive both the sync and async test suites, forcing behavioral parity. Code is conservative by design (ES5 target, CommonJS) to support old Node, and strict ESLint rules enforce explicit typing and style. The project is actively maintained (recent commits, an [Unreleased] changelog section, CI matrix on Node 14/16/18). However, the dev toolchain shows measurable drift: TypeScript 4.5, Jest 27, @types/node 6, GitHub Actions versions from 2019-2021, and 'engines' still claiming node >=6 (long EOL). The runtime logic itself remains current and sound; risk is low, but modernization of tooling is overdue. With 1906 stars and 114 open issues, this is the de facto standard for tsconfig paths resolution, relied on by ts-node, mocha setups, and the tsconfig-paths-webpack-plugin.

RATING: 8.5/10 MAINT: maintained DRIFT: medium
▸ 5 reusable components found
luoyesiqiu/dpt-shell ★ 1131 361 APPLICATION

dpt-shell is a sophisticated Android application protection framework that implements a 'hollow shell' obfuscation technique. It functions as a two-part system: a Java-based CLI processor (dpt) that analyzes and modifies target APK/AAB files, and a native Android shell (shell) that is injected into the target application. The processor extracts method bytecode (CodeItem) from the original Dex files, encrypts them, and replaces the original code with NOP instructions. At runtime, the injected shell hooks Android's class loading mechanisms (DefineClass/LoadClass) using native libraries (Dobby, bhook), decrypts the stored bytecode, and patches the memory of the loaded Dex file to restore the original code before execution. This architecture provides runtime code integrity verification and anti-tampering capabilities. The codebase demonstrates high craftsmanship in both Java and C++. The Java processor utilizes smali/dexlib2 for bytecode manipulation and implements a robust rule-based exclusion system for framework classes. The C++ shell implements low-level memory management, ELF parsing, and dynamic hooking to intercept Android Runtime (ART) operations. It includes anti-debugging, anti-Frida, and signature verification features. The project targets very recent Android SDK versions (36) and build tools (Gradle 8.14), indicating active development and forward-looking compatibility.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 3 reusable components found
BepInEx/HarmonyX ★ 523 64 APPLICATION

HarmonyX is a runtime method patching library for .NET, forked from Harmony 2 and maintained by BepInEx. It allows modifying existing methods at runtime by injecting prefixes, postfixes, transpilers, finalizers, and IL manipulators. The library is primarily used in game modding, especially for Unity games via BepInEx, but can be used in any .NET application requiring runtime code transformation. The architecture centers on the Harmony class as the public API, which delegates to PatchProcessor and PatchClassProcessor for applying patches. Patches are defined via attributes or programmatically. The core patching backends are ManagedMethodPatcher (for methods with IL bodies) and NativeDetourMethodPatcher (for native/external methods). IL manipulation is handled by HarmonyManipulator, which uses MonoMod.Cil and Mono.Cecil to rewrite method bodies. The library also provides utilities like AccessTools (reflection helpers), Traverse (field/property traversal), CodeMatcher (IL pattern matching), and MethodInvoker (fast delegate invocation). Key data flows: A patch request specifies a target method and patch methods. The PatchManager resolves the appropriate patcher, which creates a detour or IL rewrite. For IL-based patching, the original method body is read via Mono.Cecil, converted to CodeInstruction objects, processed by transpilers and manipulators, and then written back using a custom IL emitter. The patched method then calls the original (or a copy) with the injected code. The library supports complex ordering via priority and before/after attributes, and handles edge cases like generics, value types, ref returns, and async methods. External dependencies include MonoMod.RuntimeDetour, MonoMod.Utils, and Mono.Cecil for IL manipulation. The library targets multiple .NET frameworks (net35, net452, netstandard2.0) and is distributed as a NuGet package (HarmonyX).

RATING: 8.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
── end of results ──
$ submit: