aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


docs/research-notes/reference-research/mode.md (7042B)


InfoSystem shop mode and player reference boundary

Original14.9.1 DDR SHA256 3c937161de8f690351c3c08e158431417cee9ced77a41b677e7123b61a8c9883. Reused render-ddr.snapshot.json; complete new mode-ddr-evidence.json and matching mode-ddr.snapshot.json retained. Session exported and closed. Research only; parent owns the production fix and live tests.

Export:138 records,17,519,002 bytes, SHA256 e8bf2bd14e173638cc9129aaa149aa0915cecaa2437940c3eda78746cf8f1af1. Snapshot:32,701,881 bytes, SHA256 1a409b149ad71b5ed197fa7a795f2368f0b783df34e949f6d583af26b1c8256e.

Constructor omits mode initialization

InfoSystem allocation CreateInfoviewMessage100753f0 calls operator_new(0x110), then constructor1006b660, and publishes its result at DAT_100ef01c. There is no pre-constructor zeroing. Constructor explicitly clears neighboring+18, +1e,+20/+24 and many other fields, but omits+1c (shop mode) and+1d. Original constructor assembly contains no direct store initializing+1c. Current lifted constructor matches this omission; it is not an adapter dropping an original initialization instruction. This establishes omission, not author intent or a requirement to preserve uninitialized behavior.

Creation evidence ev_af082145f79ee8d4b073858de5a4075603dac896a8f826f841b3544982d88e40; constructor pseudo ev_0b27d01531907b9337c7b35c2dd94a5514f066862204829a6f0239f81ab16615; complete constructor assembly ev_b1eaa07f8aad2bda4e9884a519239f74da0f7357ba1a24890688ec7293f96de2. Constructor's positioning1006cc00 and close1006cbd0 helpers do not initialize mode: ev_f1732a6bc1f4548b8e105c56e6997700949af8acb4aeb9edeb5f3f5e3915df20, ev_e484440be4c75d07487656399e73e95469fb6e0a994892624c6eb91b9006b236.

Reviewed mode writers and routes

General info entry1006d8f0 writes this+1c from argument2, byte[EBP+c], at1006d94c (file/text branch) or1006dae3 (ordinary target branch). It may early-return before this assignment for a mismatched pending response or toggle-close, but those paths do not invoke player rendering. Evidence ev_701b6773ebeb5bb20f73104867570079622149f180b7640b4f58873f68a25e75.

Item description1006f480 saves mode to byte[EBP-1] at1006f4ee, sets mode0 at1006f4f6, then restores the prior byte at1006fc1e. This is the existing native pattern for rendering normal character/item state independent of the general shop context. Evidence ev_e66a60e8052c944b8856c3f28fe6cf03a9bd4db0a7c4f7821720f60ae7601dc3.

Reviewed resolved direct callers of general entry1006d8f0:

Address Entry Mode argument
1006d360 Previous target callback 0
100754b0 ShowItem 0
10075500 ShowActionMessage 0
10075560 ShowRefInfoOfIconMessage 0
100755c0 ShowRefInfoIDMessage 0
10075610 ShowShopItemMessage 1
10075670 LookAtRewardMessage 0
100756d0 ShowSkillInfoMessage 0
10075720 LookatPlanetLocationMessage 0
10075780 InfoPacketAvailableMessage, non-reference branch 0, ready=true
10075800 ShowTextMessage 0
10075990 ShowRefTextMessage 0
10075a10 ShowFileMessage 0
10075b50 ShowTemplateMessage 0
10075cb0 ResizeWindowMessage Preserves prior mode

All caller pseudocode is complete in the export. Caller inventory evidence ev_b13316212e3fbfe1dbcf87e1c6977c6e46a4791dadb4a0f69859a48addf3927d. Positive shop route evidence ev_a98a846a670ec70cbadbd3a27efbe245c365d4fc4726bac836edc87bcb25a3ef; resize preservation ev_9c698771d098739341548518e8d55432c7f0832ac4190b440de3447350f45225.

These are the direct this+1c writers found in the reviewed InfoSystem method range. No other direct store to that field was found; unknown indirect alias writes outside this bounded scope are not exhaustively excluded.

Reference callback bypasses general context setup

Request helper10074b20 sets current identity+0/+4 and pending+20/+24, then requests the InfoPacket. It does not set mode. Evidence ev_786d0d87d62057798f3699ba134899c455beab0c1ddb18397885f1d71da5c8b3. InfoPacketAvailable10075780 calls10074a20 when current identity matches; otherwise it calls the general entry with mode0, ready=true. Evidence ev_4870e557f1a993dae5d62d3d87397ed82b358683673d7edd1d13b687c7f74a7e. Reference callback10074a20 checks pending identity, calls IsNpc, and for non-NPC calls1006fc30(identity,true) directly at10074a5d. It neither sets nor restores mode. Evidence ev_3f39ec4b762c8669e9b46cfccc78c8858116c3ef4ceeba6a8985d7a40c22f869.

The only resolved direct player renderer1006fc30 callers are1006d8f0 and 10074a20: ev_f7a0e96912ced0325f858f2b947e6a8c3730d1f6f42cda5cfdfbb7a1abe74d2d. The general route already assigns its explicit mode before invoking renderer. The reviewed ready=true normal-player general entry passes0. No additional resolved ready-player bypass was found. Unresolved computed calls remain a static-analysis limitation.

Player renderer reads368 VisualProfession,37 TitleLevel,54 Level,33 Side and 470 MapReaderUpgrades through100735d0. These are normal target-character stats. Its three native RET8 sites are1006fd1f (request/wait),100710fb and 10071118 (completed-text cleanup). Assembly evidence ev_9826c82f49ffdffebccacf6abe83f814cfa79041147f5498e2c8db53ddad338b.

Focused recommendation: scope mode0 around only10074a20's non-NPC CALL1006fc30, restoring the prior byte after return. This covers the direct reference route and all renderer return paths without changing the general shop display contract. Constructor-only initialization would leave a later legitimate ShowShopItem(mode1) context able to break references. The pattern has original precedent in item renderer1006f480. This is a recommended bug fix, not a claim that original10074a20 already scopes the mode.

Callback fixture import contracts

Original decorated imports, also retained in render-native-ranges.json:

DDR IAT Imported contract Guest cleanup including return
100b53cc AFCM::GetInstance, static cdecl, no args 4
100b53c4 AFCM::Send(int module,int event,const void *text,long length), thiscall 20
100b53b4 AFCM::SetData(const Identity_t &), thiscall 8
100b5b84 ATextString_t::GetStrippedText(char *output,bool), thiscall 12
100b5d6c N3InterfaceModule_t::GetInstance, static cdecl, no args 4
100b5e94 N3InterfaceModule_t::N3Msg_IsNpc(const Identity_t &), thiscall, AL result 8

10074a20 deliberately prepends future Send/SetData arguments before calling GetInstance; that no-argument getter must leave them on the stack. It then sets ECX to the returned AFCM. Send's native module/event are0x20/0xb2; stripped text is NUL-terminated and the scan yields length including NUL. SetData attaches the original target identity after the Send. This state and payload order should remain part of the parent's callback fixture assertions.

Live observations reported by parent: this+1c=141 during every player helper call, causing shop branch and no KKR scalar getter; snapshot mode141 afterward. This is consistent with the missing constructor/general-entry initialization, but the exact allocation history that produced byte141 remains unproved here.