Crusader_Decomp/docs/Yoda/cheats-and-debug.md
2026-10-11 18:49:46 +02:00

41 lines
No EOL
6.3 KiB
Markdown

# Yoda Stories: PC Cheats and Debug Artifacts
## Summary
Static REA/Ghidra analysis of `Yodesk.exe` found two exact-match strings handled by one game routine: `goyoda` and `gojedi`. The first produces an `Invincible!` message and sets a handler field; the actual invulnerability effect was not traced. The second produces `Super Jedi!` and routes seven fixed game-data entries through an item-list helper. Their record names and exact gameplay effects remain unresolved.
A hardcoded `c:\yodalog.txt` writer is also present. No debug menu, console command, or debug-named game procedure was confirmed in the searched strings/procedure names. The logger is a diagnostic artifact, not evidence of a user-facing debug interface.
## Scope and Method
- Target: `C:\RE\Yoda_Stories\Star Wars - Yoda Stories (1997)(LucasArts)\Yoda\Yodesk.exe`, PE x86, SHA-256 `4d9876339d494cab141c3f4178f37a2725d178e41c7785887c84d021a8e695e7`.
- Analysis: REA with Ghidra 12.1.4. The executable was analyzed statically in an ephemeral project. The game was not launched, executable bytes were not changed, and the Ghidra project was not saved.
- The selected image contains 2,051 analyzed procedures and 999 defined strings. Addresses below are virtual addresses in `Yodesk.exe`.
- String and procedure searches were bounded to cheat/debug-related terms. A negative search does not exclude encoded checks, unnamed logic, or behavior supplied by external game data.
## Embedded Codes
`FUN_00418cb0` compares the byte string at `this + 0x17c` against two embedded lowercase strings. The comparison is exact and case-sensitive. The strings are at `0x457214` (`goyoda`) and `0x457200` (`gojedi`); each has one direct reference in this handler. REA Evidence: handler pseudocode `ev_004e22d593fd6345794a575f11a6992f6f482a02a1513377ba49ce4db56d641f`; string inventory/search `ev_ade26cfa241bee347b0fd23213ff40f18c6361e54fb63ee6554a7ed3acfbdf50`; string xrefs `ev_1165b25725959f7b15e6e778150ae6104ba146717c74db2272159e1ff7c72701` and `ev_e20e0aaa72523fcb0b1b24587335bb51a9417256dc69a88e6bcce3f99eea3bee`.
| Code | Binary-observed behavior | What remains unverified |
| --- | --- | --- |
| `goyoda` | Passes `Invincible!` to UI helper `FUN_0041a7b0` at coordinates derived from the current game position, then sets `this + 0x180` to `1`. The input field is reset afterward. | The handler does not itself show a health/damage update. Whether `this + 0x180` enables player invulnerability elsewhere was not traced; treat the label as a strong hint, not a fully established gameplay effect. |
| `gojedi` | Looks up table indices `0x1ff`, `0x200`, `0x201`, and `0x202` (the last four times) through `FUN_00404a70`, then passes the returned objects to `FUN_0041c3f0`. It displays `Super Jedi!` through the same UI helper and resets the input field. | `FUN_0041c3f0` inserts object-backed entries into a list, but the object names and exact gameplay effects are not recoverable from these executable references alone. The `YODESK.DTA` data records were not analyzed. |
The call to `FUN_0041a7b0` changes UI state and presents the supplied text; its use here is evidence for confirmation messages, not by itself proof of the associated cheat effect. The `gojedi` sequence and list behavior are visible in `FUN_00418cb0` and `FUN_0041c3f0`. REA Evidence: UI helper `ev_490ffce462d90c42b84b82a6272592d0345486c9f34128a7aacfa5dd97fdc72c`; list helper `ev_2a7abff77116595fc5e73e592ce41f3756dfeffd35a7cde29f0ff51d0b54a865`.
### Input Reachability
REA decoded a direct `CALL 0x00418cb0` at `0x41a088`. However, that callsite is not assigned to an analyzed procedure, and the resolved procedure-caller list for `FUN_00418cb0` is empty. The field at `this + 0x17c` is clearly compared with the two code strings, but this pass did not establish where the field is populated, the user-facing entry method, or whether the call is reachable in ordinary play. Do not infer a keyboard sequence or menu path from the comparisons alone. REA Evidence: callsite instruction `ev_a56dae62e987e14da434113e153ae803dbe6f13047c68829b7f1ed8a2f91d5d4`; caller result `ev_2f0331f64092b877fcb0cec7167ab0e1e76e3c865cc80a074621d4be53db6ec8`.
## Debug and Logging Artifacts
- `FUN_00401d20` opens the hardcoded path `c:\yodalog.txt`, writes its string argument, flushes, and closes the file. Its one resolved caller is `FUN_00423ef0`; the logger's file mode and the caller's precise logging conditions were not established. This supports the presence of file-based diagnostics, not an interactive debug facility. REA Evidence: logger pseudocode `ev_abd833e0e171e35a25a50a8bfd99fe2b2f39a1d915aeb907727ae94e8e0aef83`; caller list `ev_40c9282abeabc1b563740c277d22cf7b288f7831b5950cb8e953688f892d706b`.
- Searches of the defined strings for `debug`, `cheat`, `secret`, `console`, `developer`, `test`, and related terms returned the two code strings, `c:\yodalog.txt`, `Invincible!`, and an MFC `CTestCmdUI` type string, but no named debug menu or console. Procedure-name search produced no game-specific debug/cheat routine. REA Evidence: string searches `ev_71610c8b15e3236479e7db351c31d39c296e0b4d15d1fab5e45427aac7e8bf7d`, `ev_49ae904a90daa0b4f76e6d2c053de584e71502204f4036bb99b2b1873db7242c`, and `ev_ade26cfa241bee347b0fd23213ff40f18c6361e54fb63ee6554a7ed3acfbdf50`; procedure search `ev_ee150208cd3debdd877edf3d8436ffe202e335ce55dc8b3f10d0244544897512`.
## Evidence and Confidence
- **High, binary-observed:** target identity; the exact lowercase strings; the two comparison branches; the `Invincible!` and `Super Jedi!` messages; the fixed `gojedi` table-index sequence; the UI/list helper behavior; and the hardcoded log writer.
- **Medium, inference:** `goyoda` is intended to signal an invincibility cheat, and `gojedi` is intended to provide a special item loadout. The code names/messages support these interpretations, but the actual game-state effects and item identities were not independently traced.
- **Unresolved:** how the compared field is filled; whether either check is reachable in normal gameplay; whether `this + 0x180` affects damage handling; the object names behind indices `0x1ff`-`0x202`; logger mode/conditions; and any debug behavior not represented by searched plaintext strings or analyzed procedure names.
- **Not performed:** launching the game, testing either code, analyzing `YODESK.DTA`, patching bytes, or saving a Ghidra project.