Add Free Story shield hooks (S.1 send_use_key + S.2 co-hooks)#2
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
Add Free Story shield hooks (S.1 send_use_key + S.2 co-hooks)#2devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Hooks GameLogic.send_use_key so Free Story plays never reach the network and the local Key counter stays in lockstep with the server (S.1). Two optional co-hooks (LocalSave.Modify_Key, LocalSave.UserInfo.SetKey) add defense-in-depth resync blocking when enabled. All hooks resolve through IL2CPP metadata at runtime; v7.9.1 RVAs are kept as anchors. Adds field-offset resolution for LocalSave.UserInfo's <Key>k__BackingField, status-file telemetry (toggles + four hit counters + resolved offset), three config keys, and an updated archero_mod_config.low-risk.txt profile. See docs/free-story-shield.md for the full strategy writeup.
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Tier S.1 + Tier S.2 hooks from the v7.9.1 Free Story
reverse-engineering report as native LSPosed hooks in
mod.cpp.Strategy: stop patching
GameLogic.GetModeLevelKey(which only flips thedisplayed cost) and intercept the actual choke point —
GameLogic.send_use_key— so Free Story plays never reach the network. Because the in-game predictive
Modify_Key(-cost)lives insidesend_use_keyitself, blocking the methodalso leaves the displayed Key count untouched. The result has no on-the-wire
fingerprint relative to a no-op, so there is no client/server drift for
Vip.IsFreeStoryNumValid/IsCanFreeStoryTodayto resync.Two optional defense-in-depth co-hooks are wired but OFF by default:
GameLogic.send_use_key()0x58CB67CLocalSave.Modify_Key(long, bool)0x5A494C4LocalSave.UserInfo.SetKey(int)0x5B1E9E8All three are resolved at runtime through IL2CPP metadata (class name +
method name + arg count + optional first-param type), so a future game patch
that shifts RVAs but keeps the class/method names will keep working without
recompilation. The v7.9.1 RVAs are kept in
namespace rvaonly as dumpanchors.
LocalSave.UserInfo.<Key>k__BackingField(offset0xB0in v7.9.1)is similarly resolved through metadata, and the SetKey hook falls back to
passthrough if the offset failed to resolve so a metadata regression cannot
accidentally permanent-freeze keys.
Status file now reports the three new toggles, the resolved Key field
offset, and four hit counters
(
hits.free_story_send_blocked / modify_blocked / set_key_blocked / passthrough).Verified locally:
APK (
libil2cpp.so146 MB,global-metadata.dat31 MB).cmake -G Ninjaagainst the NDK r27c toolchain builds cleanly../gradlew assembleDebugproduces a 152 KBlibarchero_mod.sothatcontains all three hook handlers and config key strings (
send_use_key,LocalSave.UserInfo,Modify_Key,free_story,hk_send_use_key,hk_localsave_modify_key,hk_userinfo_set_key).docs/free-story-shield.mdfor the full strategy + verificationrecipe.
Review & Testing Checklist for Human
archero_mod_status.txtcontainsfield_offsets.localsave_userinfo_key=0xb0after a clean launch onv7.9.1. A
0x0here means the SetKey co-hook will passthrough — themodule behaves correctly but the freeze toggle becomes a no-op.
hits.free_story_send_blockedincrements by 1 per attempt, thedisplayed Key value does not change, and no
useKeyrequest is sent(verifiable via mitmproxy or
tcpdump).free_story=0in/storage/emulated/0/Android/data/com.habby.archero/files/archero_mod_config.txt,restart Archero, and verify the Key decrements normally and the
packet goes out — i.e. only the hook is changing behavior.
purchases still credit the player when
free_story_freeze_key=1(positive writes must still pass through).
Notes
legitimate Key adjustments (ad refills, shop grants, login bootstrap) are
not blocked.
GetModeLevelKey=8patch is deliberately notported — it doesn't suppress the network request and only delays drift.
Link to Devin session: https://app.devin.ai/sessions/806c3f1d11434626866025e3cbc35260
Requested by: @Jordan231111