Repository navigation
Firmware Fn getCurrentCarPosition
Kristiyan edited this page Oct 2, 2026
·
2 revisions
Part of Firmware Reversing.
-
File offset:
0x796fbc(VA0xf7024cb0) -
Status: 🟢 Fully traced (108 bytes,
0x796fbc-0x797028— a genuine LEAF function: nostwu/mflrat all, no stack frame, no calls. A completely different function's own clean, freshstwu r1,-0x80(r1)prologue starts immediately after, no gap.) -
Full mangled name:
getCurrentCarPosition__FR11DyCoCCPDataR16vehicle_location(global function, 2 reference arguments) -
UPDATE, confirmed via real Hex-Rays decompilation:
0xf7024cb0is real, reachable code, but is not itself an independent function entry — IDA/Hex-Rays reports the real containing function starts 1,572 bytes earlier, at0xf702468c(file offset0x796998). The "genuine leaf, no stack frame at all" description above describes this address's own local behavior accurately, but the boundary framing needs correction: this is a call-reachable point inside a larger compiled function, the same pattern already documented on theEHTreeNodestruct-layout page. - Found via a real, confirmed call site on
SetRouteObject(AdasRouteObject::SetRouteObject) — a reliable source, unlike the raw symbol-table address search (see Firmware Reversing for 2 cases this session where that search gave a wrong identification).
0x796fbc: lwz r11, 0(r3)
0x796fc0: lwz r0, 4(r11)
0x796fc4: cmpwi r0, 0
0x796fc8: beq 0x796ff4
0x796fcc: mr r11, r0
0x796fd0: lwz r0, 0(r11)
0x796fd4: cmpwi r0, 0
0x796fd8: beq 0x797020
0x796fdc: lwz r11, 0(r11) ; <- loop: walk the chain
0x796fe0: lwz r0, 0(r11)
0x796fe4: cmpwi r0, 0
0x796fe8: bne 0x796fdc
0x796fec: b 0x797020
0x796ff0: mr r11, r9
0x796ff4: lwz r9, 8(r11)
0x796ff8: lwz r0, 4(r9)
0x796ffc: cmpw r11, r0
0x797000: beq 0x796ff0
0x797004: lwz r0, 4(r11)
0x797008: xor r0, r0, r9
0x79700c: addic r0, r0, -1
0x797010: subfe r0, r0, r0 ; branchless: r0 = (r11.field4 == r9) ? -1 : 0
0x797014: andc r9, r9, r0
0x797018: and r0, r11, r0
0x79701c: or r11, r0, r9 ; branchless select between r11 and r9
0x797020: stw r11, 0(r3)
0x797024: li r3, 0
0x797028: blr
A genuine leaf function — no stack frame, no calls, just pointer chasing and branchless logic:
- Reads
*arg1(theDyCoCCPDatareference), then walks a real linked structure (0x796fd0-0x796fec): follow0(r11)repeatedly until a NULL terminator, a classic chain-walk (same general shape as theEHTreeNodetraversals seen onmv_convert_slot_nr/SetRouteObject). - A branchless select (
xor/addic/subfe/andc/and/or,0x797004-0x79701c): compares a field of the found node against a secondary candidate (r9) and picks whichever one actually matches, without a conditional branch — a real, deliberate optimization (GCC commonly does this for short, performance- sensitive, branch-prediction-unfriendly selects). - Writes the resolved pointer into
*arg2(the outputvehicle_locationreference) and returns0(success).
Net read: resolves the real, current vehicle_location record by
walking a chain of candidate position records (from DyCoCCPData,
plausibly "Dynamic Coordinate/Car Position Data") and branchlessly
picking the correct match, writing it to the caller's output
reference. A small, self-contained, now fully understood utility —
genuinely complete, nothing left unresolved.
Road network
- eeu.rd
- eeu.il
- eeu.iof
- eeu.typ
- rt / rl / prl
- eeu.si (segment classification)
- eeu.tmc (TMC traffic data)
Places
- eeu.ctr
- cty / cl / ct
- eeu.cny (counties)
- eeu.stt (states/regions)
- eeu.ti (time-info/DST)
- pmc / pmm (postal-code merge)
- pol / pot / pmp (postal-code, empty)
Language / TTS support
- eeu.abc (alphabet)
- eeu.aff (affix)
- eeu.cal (country names)
- eeu.cat (country bboxes)
- prd (road phonetics)
- pct (city phonetics)
- pcl (phoneme cluster list)
- pca (country phonemes)
Map tiles
Container formats
Cross-cutting
- eeu.mod (schema dictionary)
- Road naming join
- Header trailer fields
- Map viewer tool
- Road editor tool
- Unexamined files
- Disc-root build script & subsystems
Firmware reversing