-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSL3DEMO: Selectors are all zero #6
Comments
The example I've been working with is
In
Notice how Companion's disassembler put a comment on Clearly, the decompiler seems to prefer |
If I was bored enough, I'd go through what few non-system scripts there are and manually fix up the selectors myself. |
I fixed it! The whole thought process is on my twitter but here's the beef: https://twitter.com/NoxicoDev/status/1284492738831044613 And here's a direct link to today's build, with this fix included: http://helmet.kafuka.org/sci/SCICompanion.exe |
As it turns out, the fix wasn't perfect. While many selectors are now correctly identified, there are still many more identified as species. |
Well shit. Gonna look for "species" then, see what else is up. |
Found it! Direct download in the same place as before. |
@EricOakford, does it work? |
I'm just going to assume it works then. |
I know this is a very old thread, but I want to share that this is a fun bug with decompiler implications. What makes lsl3-demo different? It was compiled without optimizations. Sierra passed the Optimizations make decompiling SCI hard, so the last thing I'd expect is for a decompiler to choke on unoptimized instructions — those are supposed to be the easy ones! I am selfishly delighted because Phil's articles convinced me that "reverse instruction consumption" (my term) was too complicated to fit in my head, so I didn't do it in my decompiler. I also suspected (hoped!) that it was unnecessary complexity, and not suited to handling SC.EXE's optimizations and edge cases. And now it turns out that it didn't handle the unoptimized cases! I don't really know how this decompiler works, so maybe reverse instruction consumption is a few shallow bugs away from working flawlessly, but I suspect it is the cause of most silent inaccuracies and difficult to fix. Compiler optimizations and bugs create messy situations. Alternatively: my decompiler consumes instructions and control flow nodes from start to end, and maintains a small SCI VM-like state for expressions. It's easier to reason about, avoids a dependency tree data model, and naturally handles whatever pushes and loads the compiler spits out; optimized or not. In other words, I skipped all this =) Pretty neat that two such different approaches can get good results. |
The LSL3 demo is missing its selector table. No worries, I can grab the one from the full game.
However, there's a more serious issue here - when deompiling the game scripts (system scripts are unaffected), the decompiler gives every selector in code as zero! Thus, they're all called "species". This doesn't occur when looking at the disassembled scripts in SCI Viewer.
The text was updated successfully, but these errors were encountered: