aorecomp

Anarchy Online classic in the browser

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


docs/research-notes/nano-range-research/native/ledger.md (12313B)


AO 14.9.1 nano range: retained native evidence audit

Scope: only the four retained JSON reports identified below and matching maintained client/game/kkr.dll C. No binary was read, no REA session was opened, no new binary export was requested, and no server, database, or browser was used. This is static evidence, not an observation of original game execution.

The retained reports identify the original x86 PE kkr.dll SHA-256 as a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. That identity was read from retained metadata, not recomputed from the binary. Maintained C addresses use 0x36... where retained original addresses use 0x10....

Findings

  1. Answered: range inputs and arithmetic. 10098c10 reads nano stat 0x11f (287) in mode 2 and caster stat 0x17d (381) in mode 0. At 10098c3f signed integer multiplication retains the low 32 bits; 10098c45 loads that value as a signed integer into x87, multiplies by the binary32 coefficient at 10170894, and adds the original signed base range before the ftol call at 10098c51. For ordinary, nonoverflowing inputs this is ftol(base + (base * effective_stat381) * coefficient). It is not integer division by 100, and it is not a multiplicative stat whose neutral value is 100. Source: lifted-0046.c:2395, especially lines 2413-2451; retained decompile wrapper ev_9081c9ee969a3f64c9cfb5aec6a5d90477aa638090d6ed38e5791a3d0d58eeda, item 0x10098c10. The decompile omits the x87 arithmetic, so the maintained instruction comments supply the additional operation detail.

  2. Answered: coefficient precision; partially answered: exact runtime precision. The retained complete four-byte read of 10170894 is 0ad7233c, i.e. binary32 0.00999999977648258209228515625 = 5368709/536870912. Evidence: focused record 8, ev_09c60b565e012a81f81e9d3c94ec67d0c24254ef6f3b10e62c82b7bed44dbf50. The range helper has no intervening binary32 store after multiply/add. Thus substituting decimal/binary64 0.01 or forcing binary32 rounding at each arithmetic step is not instruction equivalent. For example, evaluating the recorded coefficient at sufficient precision gives base 20/stat381 25: 24.999999888241291..., truncating to 24; stat381 100 gives 39.999999552965164..., truncating to 39. These are arithmetic deductions, not observed runtime examples. The scoped evidence does not establish the process x87 control word/precision or the imported CRT helper implementation. Retained pseudocode names the helper ftol; maintained 1015fd8c is only an import thunk (lifted-0105.c:1907). Ordinary finite truncation toward zero is the standard helper interpretation; exceptional values/overflow remain open.

  3. Answered: signed upper cap and absence of a minimum in this helper. 10098c56 compares the converted integer to 40, and signed jle at 10098c5a preserves it; otherwise eax=40. No lower clamp appears anywhere in this complete maintained function. Negative inputs/results remain signed; a minimum of 1, 0, or base range is not present here. Same source/evidence as finding 1. Stat381 -100 with base 20 yields a small positive residue before conversion and integer zero at sufficient precision; -101 still truncates a small negative result toward zero. Stat381 -110 yields a negative integer with the recorded coefficient. Negative percentage does not imply a clamp.

  4. Answered: stat381 default and additive effective retrieval; partial: trickle data. 10072760 explicitly sets the default table entry [0x17d]=0. Evidence: combat-rules record 14, ev_262150600e8d5205a324934ce17968bf1440814efc918e5344b3ad29103466e9; maintained instruction 36072efa, lifted-0034.c:881. Stat mode 0 dispatches through 1006dfb0 -> 10075ca0. 10075ca0 obtains 10075c60 and adds 10074a30's modifier result. 10075c60 obtains mode-2 base and adds a converted 10073fa0 trickle result. Modifier entry absence yields zero for stat381; the ability/skill penalty branch in 10074a30 applies only to stats 16-21 and 100-168, not 381. 100747b4 adds a modifier to the stored dword; 10074b47 subtracts one. There is no unsigned normalization or nonnegative clamp in these operations. Focused records 0-6 respectively: ev_74652ec491811d2dbb9348174f59fabc0739128af4fc0567877aee64d3b28a0e, ev_c27bbca88da1a49ac67c28b427c73045affc7be7b57c2cf2814043387c7a4714, ev_2c98108acd73789969ea7727ff8f5f7bca6eb7e99423b9db494fb68749b32a07, ev_57658a87b490182c351df832518ad2cf4faa5ad2ffc195dd8597861aec6e1b1d, ev_c3dc476ddb84eedb69e4e81bbbd80a7c5bf28e3aca92e4d8e2e0386d6813ad6f, ev_b2a9656c468675646d49b31ff6317ecdfd16fc3991e0dc6484322a01038bea1c, ev_8fbad422c0792a1be57aad44cb4daaa490d05eaa8c77c68e55c15f94fe2215fc. Maintained sources: lifted-0033.c:1585, lifted-0034.c:3153, :4170, :4664, :4811, :7502, :7547. The scoped retained evidence does not include stat381's actual trickle-weight table entry. Zero trickle for this specific stat therefore is not independently demonstrated by this audit. The effective path includes the generic call.

  5. Answered: connected spatial cast predicates include a stricter second gate. 100646a0 gets both global position vectors. Each caster-minus-target coordinate difference is stored as binary32 (10064adb, 10064ae7, 10064af0). x87 then squares the z and y differences, adds them, squares x, adds it, and takes sqrt. 10064b12 invokes the same ftol helper. Signed jle at 10064b19 accepts distance_integer <= range_integer. There is no radius/height subtraction or epsilon in this branch. This first gate alone ordinarily permits distances below R+1 for nonnegative integer R. It does not establish the effective predicate for a complete cast. After another intervening predicate, 10064b72 calls 10066310 and a false result rejects the cast (10064b77..10064b79). Source lifted-0030.c:6179 through :6226; decompile20 wrapper ev_b222a29a2449ed800e75228fac8a9ad597f8c73dce740b461b7fae780389796b, item 0x100646a0. The decompile omits the distance arithmetic; maintained instructions preserve it. Caller connection: lifted-0030.c:6273 through :6287; the retained decompile names FUN_10066310 in this same path.

    10066310 first compares target object with caster object (10066320) and skips to its success epilogue when equal (10066322 -> 100665d2). For other actors, 10066328..1006635a loads global binary32 coordinates and computes the three differences in x87 without spilling those differences to binary32. It squares and sums z, y, then x and takes sqrt (10066362..10066372). Only the final distance is spilled to binary32 at 1006637a. It computes range again (1006637d -> 10098c10), loads the signed int32 range into x87 (10066385) and compares against the binary32 distance (10066388). The tested x87 C0 status rejects range < distance; finite equality passes (1006638d..10066390). This gate does not convert distance to integer. Source: lifted-0030.c:10373 through :10487, success epilogue :10791. No body of 10066310 occurs in the four scoped retained reports; only the caller reference is present in decompile20. The maintained source therefore supplies this second-gate instruction evidence, with no new original-binary export or new Evidence ID claimed.

    Effective ordinary other-actor range policy: use the final binary32 distance <= integer range, with no additional one-metre allowance. The full original client path applies both gates; the first rounded-difference gate and the second final-distance rounding are not bitwise identical. At ordinary finite distances the strict second gate removes the apparent R+1 allowance: e.g. distance 20.9 and range 20 fail, despite passing the first gate. Exact floating-point boundary equivalence additionally depends on runtime x87 precision and coordinate snapshots between the two checks. The server may implement the second predicate directly as its ordinary fidelity policy; that remains a policy derived from client evidence, not historical-server execution evidence.

  6. Answered: self-only target handling in the observed path. When nano-object byte +0x98 is nonzero, 10064821..10064836 replaces the copied target identity with the caster's identity. It then follows ordinary target lookup and cast predicates, including the first distance comparison; there is no self-only return-success or range bypass in 100646a0. 10066310 does skip its own second spatial gate for any target object equal to the caster, independently of why that target was selected. This bypass occurs after the first gate has passed. For finite self position the initial computed distance is zero; a negative returned range therefore still fails the first comparison. Sources lifted-0030.c:5821 and :10396; same decompile20 evidence as finding 5. The exact resource flag that populates byte +0x98 is not established by the scoped records, so interpreting its provenance as a particular numeric SelfOnly flag remains a separate question.

Server-policy and fidelity gaps

Retained search boundary and connected excerpt

The search for 10066310 covered every record/item of exactly the four scoped reports, including both metadata and stored result text. The combat-rules bundle, decompile5, and focused evidence returned no match. Decompile20 item 0x100646a0 contains the caller reference but no separate body. This negative search is bounded to those reports and does not establish absence elsewhere. connected-predicates.txt contains line-numbered excerpts of the maintained C for the first gate, required downstream call, second gate, and self-success epilogue, tied to the unchanged maintained source hash below.

Audited source hashes (SHA-256)

Source SHA-256
local/reports/combat-rules-1491-evidence.json 7d82955884bf72ee6d19f008099c13f9d01ef5716e1b3cfac0daafb080b13b52
local/reports/combat-client-decompiles-5.json 33dbde924935aa619d18277afaceffc72a285f36190def4d46746b5fad344973
local/reports/combat-client-decompiles-20.json 523430bfad626abd55b57c288b701a43476eba47fdd7503827631efe87e45f8a
local/signed-stat-research/focused-evidence.json edd3417e042bd921f27c4fb9d1d6ab96b8f3243405f091658c64349e6d0f0613
client/game/kkr.dll/lifted-0030.c 47d7665a2edc609c0de5c437874dd565b96184a909ac3814af2f26b3dc8fb1de
client/game/kkr.dll/lifted-0033.c 864da26391874dbdae17e80ed29e6cbc51641cf55842594c5373de272f66f541
client/game/kkr.dll/lifted-0034.c b1bfedd42a59d1468ab3adc8cfb392db6785be1c39523ca060072188dd773326
client/game/kkr.dll/lifted-0046.c 2b2e6f30e15fb013dba6a744a314586ff881cea756c809063652a3ab7567c500
client/game/kkr.dll/lifted-0105.c 58507cce41480195633a91a576246e8bc79ebae884c0d0bfc4a2b84e85208a14