Post AlXphYKemshVMSH9TU by foone@digipres.club
 (DIR) More posts by foone@digipres.club
 (DIR) Post #AlXhHV5zOo3yA1TuRk by foone@digipres.club
       2024-09-01T00:20:07Z
       
       0 likes, 0 repeats
       
       maybe I'd be better at getting back into my reverse engineering projects if getting back into them didn't involve first figuring out which of the 13 Ghidra versions I have installed is for that project
       
 (DIR) Post #AlXhNp8hn19g3xlc6S by foone@digipres.club
       2024-09-01T00:21:39Z
       
       0 likes, 0 repeats
       
       okay it's not 10.1-beta, because that one was used to hack on Spyro for the GBA, Excel '95, the Tandy-Memorex VIS BIOS, and the FlashPath kernel driver
       
 (DIR) Post #AlXhX4pko93ZLPJaFs by foone@digipres.club
       2024-09-01T00:22:23Z
       
       0 likes, 0 repeats
       
       10.1 non-beta was Railroad Tycoon and "MyPetChimp", whatever that was.
       
 (DIR) Post #AlXhX8kwDza5Vd5nIu by foone@digipres.club
       2024-09-01T00:22:51Z
       
       0 likes, 0 repeats
       
       10.1.5 was the DS9 point and click game and a WinCE powered printer
       
 (DIR) Post #AlXho6Txvp5JNdF5u4 by foone@digipres.club
       2024-09-01T00:23:56Z
       
       0 likes, 0 repeats
       
       10.1.4 was an aliexpress single-key-keyboard and some parts of the Borland Graphics Interface
       
 (DIR) Post #AlXho8vgpiRwyCEGOW by foone@digipres.club
       2024-09-01T00:24:46Z
       
       0 likes, 0 repeats
       
       10.0.4 was SOLELY for a GBA DBZ game
       
 (DIR) Post #AlXhwlEGJubE4R1dTs by cr1901@mastodon.social
       2024-09-01T00:24:12Z
       
       0 likes, 0 repeats
       
       @foone There's no upgrade path for projects? ._.(Was thinking of getting back into Ghidra for non-DPMI, non-8088 stuff...)
       
 (DIR) Post #AlXiBBJU8Vyb1WLQjw by foone@digipres.club
       2024-09-01T00:25:26Z
       
       0 likes, 0 repeats
       
       9.2.2 was a vape unit I was trying to run Doom on, Duke Nukem 1 for DOS, and Links386 for DOS
       
 (DIR) Post #AlXiNS4DfiwESY3U6C by foone@digipres.club
       2024-09-01T00:28:36Z
       
       0 likes, 0 repeats
       
       @cr1901 There is, but the extensions (for console CPUs and such) are tied to the exact version, so often I've got version X, but then I need to disassemble a new CPU, but the extension to do that is only available for version Y
       
 (DIR) Post #AlXiNUth9JInEm9cbw by foone@digipres.club
       2024-09-01T00:29:08Z
       
       0 likes, 0 repeats
       
       @cr1901 and I could PRESUMABLY manually build new extension versions myself from source, but frankly that's too much of a mess for me to bother when I can just install a separate version of ghidra
       
 (DIR) Post #AlXiNW072w1ueyAGFk by foone@digipres.club
       2024-09-01T00:29:22Z
       
       0 likes, 0 repeats
       
       @cr1901 until I end up with 13 versions installed and it's now a disaster
       
 (DIR) Post #AlXig84GFl2Dw0yrw0 by overanalytcl@hachyderm.io
       2024-09-01T00:30:27Z
       
       0 likes, 0 repeats
       
       @foone *why* do you have 13 versions?
       
 (DIR) Post #AlXimSubfRpGJsUCwq by foone@digipres.club
       2024-09-01T00:31:18Z
       
       0 likes, 0 repeats
       
       @endrift I think it was Dragon Ball Z: The Legacy of Goku II
       
 (DIR) Post #AlXisOMzT5axyBaYds by foone@digipres.club
       2024-09-01T00:31:31Z
       
       0 likes, 0 repeats
       
       @overanalytcl I explain here:https://digipres.club/@foone/113059464273865702
       
 (DIR) Post #AlXj3lw8BhbSFKS4nI by foone@digipres.club
       2024-09-01T00:33:51Z
       
       0 likes, 0 repeats
       
       ah-ha! It was 10.2.2
       
 (DIR) Post #AlXjEAtGGVYUXD4OMy by cr1901@mastodon.social
       2024-09-01T00:36:44Z
       
       0 likes, 0 repeats
       
       @foone Good to know your user experience so that I may adjust mine accordingly. Are extensions written in Java? Maybe I'll install a toolchain so I can compile extensions from source if I have to.
       
 (DIR) Post #AlXjczjurPWjBtX9yC by mjfgates@wandering.shop
       2024-09-01T00:43:19Z
       
       0 likes, 0 repeats
       
       @foone please tell me the printer could run Pocket Office, hopefully by printing screenshots and letting you enter coordinates for a mouse click
       
 (DIR) Post #AlXjjqULecbMWgWED2 by nex@fedi.transgender.ing
       2024-09-01T00:43:03.721Z
       
       0 likes, 0 repeats
       
       @foone@digipres.club Have you ever played doom on a normal device? do you even own a normal device? do you post from a smart cooker or something? That seems in character for you
       
 (DIR) Post #AlXjjrK6YC0B7CjYsi by foone@digipres.club
       2024-09-01T00:43:58Z
       
       0 likes, 0 repeats
       
       @nex yeah I've played it on DOS computers! that's relatively normal, if just anachronistic
       
 (DIR) Post #AlXju2WJm7hUjoIj1U by foone@digipres.club
       2024-09-01T00:44:08Z
       
       0 likes, 0 repeats
       
       @cr1901 yeah, they're java.
       
 (DIR) Post #AlXkMZtXHcNiM5lkJM by foone@digipres.club
       2024-09-01T00:46:13Z
       
       0 likes, 0 repeats
       
       okay now I can see why may2023!foone got stuck here. this is so fucking complicated.
       
 (DIR) Post #AlXkcq9gawEhQ54sQi by foone@digipres.club
       2024-09-01T00:47:21Z
       
       0 likes, 0 repeats
       
       I'm trying to decode a scripting language for a video game, but the problem it's not just a bytecode file, it's more like an EXE file. It's got multiple sorts of metadata that has to be properly parsed, and linking that needs to be done, and that task is proving to be a little too hard for my tiny brain
       
 (DIR) Post #AlXkcsqIbTVjkp1w80 by foone@digipres.club
       2024-09-01T00:48:38Z
       
       0 likes, 0 repeats
       
       especially because it's doing this kind of... in-place relocation thing?
       
 (DIR) Post #AlXkcu2OA0m9Sbh6bw by foone@digipres.club
       2024-09-01T00:52:05Z
       
       0 likes, 0 repeats
       
       like the bytecode will be:pvm_Call 0, 0and then the relocations will kick in and that'll turn into:pvm_Call Vanna.revealTile
       
 (DIR) Post #AlXkcvFtdHAtEn1PIu by foone@digipres.club
       2024-09-01T00:53:33Z
       
       0 likes, 0 repeats
       
       but because this is all done in an in-place loading style, it's really a pain to understand, so I've not yet been able to write a disassembler
       
 (DIR) Post #AlXkcwFDxGEOIziNtY by foone@digipres.club
       2024-09-01T00:54:06Z
       
       0 likes, 0 repeats
       
       it's also a typed VM, so that makes it even more complicated. (Because the types are stored in the executable metadata)
       
 (DIR) Post #AlXl2houCugN67gvjM by overanalytcl@hachyderm.io
       2024-09-01T00:51:27Z
       
       0 likes, 0 repeats
       
       @foone @cr1901 but doesn't that mean that with version Y you can also disassemble everything you could with version X?
       
 (DIR) Post #AlXlRub7pxMny0GUka by foone@digipres.club
       2024-09-01T00:52:35Z
       
       0 likes, 0 repeats
       
       @overanalytcl @cr1901 Yes. unless you also had an extension that only worked on version X
       
 (DIR) Post #AlXm4DMiVY1bB4n1Wa by gsuberland@chaos.social
       2024-09-01T01:01:34Z
       
       0 likes, 0 repeats
       
       @foone heh, this sounds like .NET
       
 (DIR) Post #AlXmDwQ6Mi1ZWC0k1A by foone@digipres.club
       2024-09-01T01:03:02Z
       
       0 likes, 0 repeats
       
       @gsuberland yeah, but the weird thing is that .net is a whole professional programming language thing, and this is a scripting language for a Wii game
       
 (DIR) Post #AlXmVFJ7Oazp1FzobQ by gsuberland@chaos.social
       2024-09-01T01:17:20Z
       
       0 likes, 0 repeats
       
       @foone yeah, certainly seems like they put a ton of effort into it. any evidence that it might be a licensed library?
       
 (DIR) Post #AlXmzSeULRzh5vOpRw by foone@digipres.club
       2024-09-01T01:24:53Z
       
       0 likes, 0 repeats
       
       huh. this game has a "SILENCE LOADING ERRORS" flag. there's no way to turn it on, so loading errors will always be reported.normally games have a verbose/debug flag that devs turn on, not a "be quiet" flag that never gets turned on
       
 (DIR) Post #AlXn6WYyCbpdFeBbeq by foone@digipres.club
       2024-09-01T01:25:41Z
       
       0 likes, 0 repeats
       
       @gsuberland Nope. All I can tell is that it's in-house, but they seem to have used it across several games
       
 (DIR) Post #AlXnGj0SnDLajvuUFs by Craigp@mastodon.social
       2024-09-01T01:28:03Z
       
       0 likes, 0 repeats
       
       @foone Terse flag!
       
 (DIR) Post #AlXnPRVJEgsb3yUkIy by foone@digipres.club
       2024-09-01T01:28:12Z
       
       0 likes, 0 repeats
       
       oh god. I thought I'd fill out the resolveTypes function of module loading but it turns out it's a five-pass loader that loads data in place
       
 (DIR) Post #AlXpSn1Bu2S8Z78BbE by foone@digipres.club
       2024-09-01T01:49:45Z
       
       0 likes, 0 repeats
       
       oh godif( fixup_passes>=64 ){  btype_failure = true; }
       
 (DIR) Post #AlXphYKemshVMSH9TU by foone@digipres.club
       2024-09-01T01:49:52Z
       
       0 likes, 0 repeats
       
       SIXTY FOUR FUCKING FIXUP PASSES?
       
 (DIR) Post #AlXqGiNtPCbgfmYWB6 by sadmac356@social.restless.systems
       2024-09-01T02:01:42Z
       
       0 likes, 0 repeats
       
       @foone I'm sorry, what the fuck?
       
 (DIR) Post #AlXs4FD0FnfUcTdxkO by foone@digipres.club
       2024-09-01T02:21:47Z
       
       0 likes, 0 repeats
       
       I think these guys wrote their scripting language so that array types have a declared length, but then neglected to actually tell the script executor about that. it doesn't seem to save that information anywhere or compare it to anything
       
 (DIR) Post #AlXsGcUvUWk8KAvbfc by foone@digipres.club
       2024-09-01T02:23:59Z
       
       0 likes, 0 repeats
       
       the worst thing about this particular scripting language is that it's compiled to bytecode, but they also have a debug file that includes all the information removed by byte-compiling. So I have variable names and comments and such, right?but it's in a separate binary format that I can't load. So it's tempting but also useless
       
 (DIR) Post #AlXtfSXvjCDyebk1q4 by bloognoo@retro.pizza
       2024-09-01T02:39:09Z
       
       0 likes, 0 repeats
       
       @foone I would love to know the rationale behind these design choices. Then I remember a coworker who would wrote a new scripting language and engine per game we developed and it all makes sense.
       
 (DIR) Post #AlXtsFkmbOgyk6qzT6 by foone@digipres.club
       2024-09-01T02:41:18Z
       
       0 likes, 0 repeats
       
       @AT1ST @rotopenguin the funny thing is that you're not that far off.I'm hacking a video game based on a game show, but it's Wheel of Fortune, not Price is Right.
       
 (DIR) Post #AlXu1HlsTCJHbfflvE by foone@digipres.club
       2024-09-01T02:42:53Z
       
       0 likes, 0 repeats
       
       WFCommonJunction::getProfileGenderMY GENDER IS BETWEEN ME AND GOD, YOU CANNOT KNOW IT, GAME FOR THE NINTENDO WII
       
 (DIR) Post #AlXuIetvj7gaGWiuUy by foone@digipres.club
       2024-09-01T02:44:45Z
       
       0 likes, 0 repeats
       
       this game has been out for 14 years and no one has figured out the cheat codes for it.but I am dangerously close.
       
 (DIR) Post #AlXuTdnm9cOw2e56x6 by clayote@peoplemaking.games
       2024-09-01T02:46:03Z
       
       0 likes, 0 repeats
       
       @foone The relation between gender and a floppy disk is between gender and that floppy disk.
       
 (DIR) Post #AlXuiRjbIoWMxXBjtY by foone@digipres.club
       2024-09-01T02:47:22Z
       
       0 likes, 1 repeats
       
       @clayote and I keep my gender on a floppy disk! wait. shit. oh no... this explains a lot.
       
 (DIR) Post #AlXuwQt9FEJYODK6e8 by PJ_Evans@mas.to
       2024-09-01T02:50:01Z
       
       0 likes, 0 repeats
       
       @foone You would think they could kind of get their act together enough to do it in fewer.
       
 (DIR) Post #AlXv5fWyAs2YPMLz84 by PJ_Evans@mas.to
       2024-09-01T02:50:33Z
       
       0 likes, 0 repeats
       
       @foone Been there, done that (debug flag for writing stuff to the screen.)
       
 (DIR) Post #AlXvB1F2sgyHBuWMHg by davejmurphy@disabled.social
       2024-09-01T02:51:47Z
       
       0 likes, 0 repeats
       
       @foone why are all these ghidra versions not interchangeable?
       
 (DIR) Post #AlXvfwVeWcIrUY2Boe by davejmurphy@disabled.social
       2024-09-01T03:00:55Z
       
       0 likes, 0 repeats
       
       @foone lol nvm. I finally read to the relevant parts of the thread. https://digipres.club/@foone/113059464273865702Begs the question why newer versions of ghidra can't load extensions for old versions. Is there some kind of ABI breakage going on? An issue with java?
       
 (DIR) Post #AlXvfxHrdMrru4agxk by foone@digipres.club
       2024-09-01T03:01:57Z
       
       0 likes, 0 repeats
       
       @davejmurphy Ghidra just refuses to load incorrect-version extensions, even if they would work. So you'd have to set up the java environment to compile your own, which I've not bothered with
       
 (DIR) Post #AlXvtYqPJCOY9KEgLI by foone@digipres.club
       2024-09-01T03:02:14Z
       
       0 likes, 0 repeats
       
       @AT1ST @rotopenguin different one! no incest anime here.
       
 (DIR) Post #AlXw4IT2XPQeXiQQNs by foone@digipres.club
       2024-09-01T03:02:44Z
       
       0 likes, 0 repeats
       
       I think I officially did too much Rust programming. I'm back on my home turf of python(2), and I'm missing the match expression
       
 (DIR) Post #AlXxVC2idFVaOGVEcC by clayote@peoplemaking.games
       2024-09-01T03:21:57Z
       
       0 likes, 0 repeats
       
       @foone Just switch to Python 3.10 or later? Which has a match expression? https://peps.python.org/pep-0635/
       
 (DIR) Post #AlXxcJHW7KNcrromPI by foone@digipres.club
       2024-09-01T03:23:20Z
       
       0 likes, 0 repeats
       
       @clayote probably should do that yeah.
       
 (DIR) Post #AlXyDGNlrJeeahMcj2 by foone@digipres.club
       2024-09-01T03:30:19Z
       
       0 likes, 0 repeats
       
       okay it kind of does relocation backwards. my understanding is that the way this is done on sensible platforms is that there's an executable that's like "hey, when you load me, shove the pointer to GetWindowTextA at offset 0x234805 in my code"
       
 (DIR) Post #AlXyLxiecLcjJYHPbk by foone@digipres.club
       2024-09-01T03:31:50Z
       
       0 likes, 0 repeats
       
       this instead steps through the entire code looking for specific bytecode opcodes that it knows need relocation.so when it sees a pvm_Jump opcode, it knows that although that opcode takes an absolute address, it interprets the current "absolute address" as an index into a jump table, which it then overwrites the current value with.
       
 (DIR) Post #AlXzf6XGAAqE76dqpE by foone@digipres.club
       2024-09-01T03:46:11Z
       
       0 likes, 0 repeats
       
       I'd love to do more logging on what the game is actually doing at runtime, but it turns out this interpreter is multithreaded. It's running tons of scripts at the same time, and it's really a pain to track which execution is for which script
       
 (DIR) Post #AlXzoOeGBmgqtcLZho by foone@digipres.club
       2024-09-01T03:46:28Z
       
       0 likes, 0 repeats
       
       plus the debug logging capabilities of the emulator are abysmal
       
 (DIR) Post #AlY0apguwo96fTgbGi by foone@digipres.club
       2024-09-01T03:57:16Z
       
       0 likes, 0 repeats
       
       oh godplease tell me you fools didn't design a bytecode VM with DELAY SLOTS
       
 (DIR) Post #AlY1DdeHefdsc2xTCS by bersl2@furry.engineer
       2024-09-01T03:59:42Z
       
       0 likes, 0 repeats
       
       @foone wat
       
 (DIR) Post #AlY1TvcQbuHYylrFWy by foone@digipres.club
       2024-09-01T04:04:51Z
       
       0 likes, 0 repeats
       
       ahh, it uses a 24bit addressing scheme. nice.
       
 (DIR) Post #AlY1eSSlLrYHjtMFcm by foone@digipres.club
       2024-09-01T04:07:17Z
       
       0 likes, 0 repeats
       
       or rather, it's an encoding scheme where they tag their pointers. and if the upper byte of a 32bit pointer is 1 or 0, it gets relocated.
       
 (DIR) Post #AlY1xtUX5HxR4KSBBA by foone@digipres.club
       2024-09-01T04:11:30Z
       
       0 likes, 0 repeats
       
       so this resolveRefs function iterates through all the code and it sometimes sets a local booleanit never, ever, reads it. WHY IS THIS HERE?
       
 (DIR) Post #AlY2789PwyXB8lyuJs by foone@digipres.club
       2024-09-01T04:13:38Z
       
       0 likes, 0 repeats
       
       so, this specific bytecode looks like this:pvm_PushConstant 0 and you might think that just pushes a zero onto the stack. Nope! it instead looks up constant #0, which according to the table for this file, is... 0. oh.
       
 (DIR) Post #AlY2J3Vz0qgYElDrai by ChartreuseK@social.restless.systems
       2024-09-01T04:13:43Z
       
       0 likes, 0 repeats
       
       @foone Ah delay slots, the most annoying feature of RISC designs to be exposed to the programmer.
       
 (DIR) Post #AlY2iDasfzWmjhVno8 by overanalytcl@hachyderm.io
       2024-09-01T04:21:05Z
       
       0 likes, 0 repeats
       
       @foone what's wrong with that exactly?
       
 (DIR) Post #AlY36bSJbt51gz8JNI by sabik@rants.au
       2024-09-01T04:25:05Z
       
       0 likes, 0 repeats
       
       @foone This is important in case the value of 0 ever changes
       
 (DIR) Post #AlY4G6PlyU3cGp2NMm by wrosecrans@mstdn.social
       2024-09-01T04:37:50Z
       
       0 likes, 0 repeats
       
       @foone I've always been of the opinion that the death penalty for pointer tagging might not be a strong enough policy.
       
 (DIR) Post #AlY4yuWD3DqSPFPk5A by foone@digipres.club
       2024-09-01T04:46:05Z
       
       0 likes, 0 repeats
       
       for (iVar2 = 0; iVar2 < (int)(uint)*(ushort *)(((uint)((PVOpCode *)pdata + 4) & 0xfffffffc) + 2); iVar2 = iVar2 + 1) {is that enough casts, ghidra?
       
 (DIR) Post #AlY5D8KgUGh9IunzZQ by foone@digipres.club
       2024-09-01T04:48:53Z
       
       0 likes, 0 repeats
       
       You know you've got a great decompiler when it's way easier to figure out WTF the pointers are doing by just reading the powerpc disassembly
       
 (DIR) Post #AlY5RBME2OScjvE1Oi by ricci@discuss.systems
       2024-09-01T04:50:37Z
       
       0 likes, 0 repeats
       
       @foone https://types.pl/users/ionchy/statuses/112754152834331137
       
 (DIR) Post #AlY5mfzHLr9Polk1CK by MenhirMike@mastodon.social
       2024-09-01T04:55:19Z
       
       0 likes, 0 repeats
       
       @foone Yo, I heard you like numbers, so I cast your number to a number and cast it to a number and then cast it to a number.
       
 (DIR) Post #AlY6ccte5XVTI2sV6W by foone@digipres.club
       2024-09-01T05:04:26Z
       
       0 likes, 0 repeats
       
       okay I got most of the relocation step finished. I haven't managed the switch statement (IT'S COMPLICATED AND INVOLVES POINTERS) and the EnterFrame statement, because I'm not really sure what the fuck it's doing.
       
 (DIR) Post #AlY6pcs5UdAgycLdZo by oblomov@sociale.network
       2024-09-01T05:07:08Z
       
       0 likes, 0 repeats
       
       @foone «I mean, yes, but actually no»
       
 (DIR) Post #AlY7nsZUFY9t2oNXGq by SvenGeier@mathstodon.xyz
       2024-09-01T05:17:56Z
       
       0 likes, 0 repeats
       
       @foone "The plot is mediocre, but the cast is spectacular"
       
 (DIR) Post #AlY9JsRANsOlqhJBQm by lachlan@mastodon.social
       2024-09-01T05:34:45Z
       
       0 likes, 0 repeats
       
       @foone Railroad Tycoon? Anything interesting in there? (3 remains one if my favourite games, and still without true successor)
       
 (DIR) Post #AlYCKZ9frN4KCN99g8 by ubik@fedi.turbofish.cc
       2024-09-01T06:08:55Z
       
       0 likes, 0 repeats
       
       @foone this. Well there's now a match statement in python, but it's more of a switch/case.
       
 (DIR) Post #AlYSan3fXCc5Db60si by petrapup@mastodon.triggerphra.se
       2024-09-01T09:10:45Z
       
       0 likes, 0 repeats
       
       @foone is this. is this wheel of fortune
       
 (DIR) Post #AlYZVyM8nizWUPNzQe by mcSlibinas@river.group.lt
       2024-09-01T10:28:19Z
       
       0 likes, 0 repeats
       
       @foone @clayote
       
 (DIR) Post #AlYZz33MPsHPSHSwyW by sabik@rants.au
       2024-09-01T10:34:04Z
       
       0 likes, 0 repeats
       
       @foone Is `fixup_passes` a 6-bit variable, though
       
 (DIR) Post #AlYgZZRC5Yna2lPcX2 by http_error_418@hachyderm.io
       2024-09-01T11:47:28Z
       
       0 likes, 0 repeats
       
       @foone @clayote my gender is largely factory spec but there's a big screwdriver hole through the "warranty void if seal is broken" sticker
       
 (DIR) Post #AlYjJVs5sacgDF1sDw by wendy@post.lurk.org
       2024-09-01T12:18:24Z
       
       0 likes, 0 repeats
       
       @foone @clayote If you put magnets on it.. Could be interesting..
       
 (DIR) Post #AlYqd064QRq18Vo2UK by foone@digipres.club
       2024-09-01T13:40:00Z
       
       0 likes, 0 repeats
       
       @petrapup yes
       
 (DIR) Post #AlYqmnToBsUktua4GG by Taffer@mastodon.gamedev.place
       2024-09-01T13:42:16Z
       
       0 likes, 0 repeats
       
       @foone uh oh, I bet the original implementation was recursive and they blew the stack
       
 (DIR) Post #AlYvDEInUIhbR1I1s8 by misty@digipres.club
       2024-09-01T14:30:28Z
       
       0 likes, 0 repeats
       
       @foone Reminds me of a game I was looking at which used a virtual filesystem with a sidecar file containing the filenames…on one platform. They didn’t ship it on the other platform and the file sizes/orders didn’t line up.
       
 (DIR) Post #AlYy16nhqsiKYaevgm by foone@digipres.club
       2024-09-01T15:01:56Z
       
       0 likes, 0 repeats
       
       @misty yikes.
       
 (DIR) Post #AlZ3iivCUjZ90emUBU by raven667@hachyderm.io
       2024-09-01T16:06:37Z
       
       0 likes, 0 repeats
       
       @foone @misty A Professor teaching software engineering, or maybe anthropology, should make a course on the sins of game development, with some ways to avoid them without breaking time/budget within the skills that practicing game software developers have.  I think games have some different valid software engineering practices than business software or web services which is usually what most engineering texts are focused on.
       
 (DIR) Post #AlZAr7jCqcnrwR7i5Y by blackBoxRE@infosec.exchange
       2024-09-01T17:27:03Z
       
       0 likes, 0 repeats
       
       @foone lol, I don’t use Ghidra much for a variety of reasons but a friend once sent me this tip about turning off type casting: Tool Options -> Decompiler -> Display -> Disable Printing of Type Casts
       
 (DIR) Post #AlZKWHChQBUan3cHr6 by foone@digipres.club
       2024-09-01T19:14:58Z
       
       0 likes, 0 repeats
       
       @f00fc7c8 and some people!
       
 (DIR) Post #AlZKhV1QO01apdh6uW by foone@digipres.club
       2024-09-01T19:15:19Z
       
       0 likes, 0 repeats
       
       @blackBoxRE oooooh
       
 (DIR) Post #AlZKnw9iPsjeitdrjE by onezplusplus@chadthundercock.com
       2024-09-01T19:16:44Z
       
       0 likes, 0 repeats
       
       @foone @clayote I will format it
       
 (DIR) Post #AlZOiTokkVHfCdUSqu by KSargent@mastodon.social
       2024-09-01T20:01:52Z
       
       0 likes, 0 repeats
       
       @foone @clayote Spotted your problem: that little tab is down in the left upper corner. That makes it writeable.
       
 (DIR) Post #AlZwmODut2TrS8IQpE by foone@digipres.club
       2024-09-02T02:23:55Z
       
       0 likes, 0 repeats
       
       the fixup of the switchtable is unrolled.now, I'm looking at disassembly,  so that could be the compiler, but... here's the thing: I haven't seen any unrolled loops anywhere. I think they manually unrolled this shit.
       
 (DIR) Post #AlZy0Z0lfrHqv3T7Y0 by foone@digipres.club
       2024-09-02T02:37:33Z
       
       0 likes, 0 repeats
       
       I can't figure out whatever this shit is doing.
       
 (DIR) Post #AlZyEhIne6DMgedtGy by foone@digipres.club
       2024-09-02T02:40:01Z
       
       0 likes, 0 repeats
       
       pdata points to the beginning of the instruction, which looks like this:6E 7F 7F 7F 00 0C 00 00so pdata[0] is the pvm_EnterFrame, which is 6E. the 7Fs are a placeholder. So this frameptr is getting pointed at the first 00.Then that check in the middle of the for() loop is looking at the same location but plus 2, so the 00 00? so this loop in this case... doesn't run at all. Huh.
       
 (DIR) Post #AlZyScLSsA7rMpWhk0 by foone@digipres.club
       2024-09-02T02:42:43Z
       
       0 likes, 0 repeats
       
       but the next time it gets called, it's:6E 7F 7F 00 44 00 04 02 00 00 00 00 00 00
       
 (DIR) Post #AlZyaA2Vzp2rtaGBBA by foone@digipres.club
       2024-09-02T02:43:25Z
       
       0 likes, 0 repeats
       
       ugh I think the thing that's weird here is the &0xfffffffcIt's doing alignment, adjusting pointers to only be on 4s
       
 (DIR) Post #AlZykA7wWdmR3xZGiW by nickzoic@aus.social
       2024-09-02T02:44:14Z
       
       0 likes, 0 repeats
       
       @foone is it using useless_boolean to check if the loop is run at all?
       
 (DIR) Post #AlZys9rROnIKYPf5rE by foone@digipres.club
       2024-09-02T02:45:26Z
       
       0 likes, 0 repeats
       
       and that first bit of code is at 0x70, which is a multiple of 4, so 0x70+4 just equals 0x74. but the second time, it's at 0x79! so 0x79+4 is is 0x7D: but that turns into 0x7C when we apply the AND.
       
 (DIR) Post #AlZz78TSpx6wb4aYxk by foone@digipres.club
       2024-09-02T02:45:42Z
       
       0 likes, 0 repeats
       
       so this is a bytecode that has variable padding in order to align to 4 bytes. ugh.
       
 (DIR) Post #AlZzK7qKUkiaP6Tgrg by foone@digipres.club
       2024-09-02T02:45:59Z
       
       0 likes, 0 repeats
       
       @nickzoic useless_boolean is never checked at any point
       
 (DIR) Post #AlZzTcXZjQgqDVEWuG by afwaller@mastodon.social
       2024-09-02T02:51:11Z
       
       0 likes, 0 repeats
       
       @foone as countless historians have said, we believe this was done for ritualistic purposes
       
 (DIR) Post #AlZzaNwCQILixCybxY by rk@mastodon.well.com
       2024-09-02T02:52:01Z
       
       0 likes, 0 repeats
       
       @foone We call that a pseudoregister. #mips
       
 (DIR) Post #AlZzgAIw1ZFkPOMp6G by cr1901@mastodon.social
       2024-09-02T02:52:42Z
       
       0 likes, 0 repeats
       
       @foone Python switched to everything-is-2-byte bytecode in 3.6. And I'm pretty sure they reneged on that in recent versions back to variable-sized bytecode. :'D...
       
 (DIR) Post #AlZzoL6jk3kKENYjya by foone@digipres.club
       2024-09-02T02:55:26Z
       
       0 likes, 0 repeats
       
       oh, I think I've got what EnterFrame is: It's a way to easily shove multiple typed variables onto the stack, so the function/script can use them. and it's doing a fixup to know what the types are, since they're declared in the relocation header
       
 (DIR) Post #Ala00Gfi3np1wqbbaS by foone@digipres.club
       2024-09-02T02:59:46Z
       
       0 likes, 0 repeats
       
       yeah, it ends up looking like:pvm_EnterFrame int, int, bool, GuiAnim
       
 (DIR) Post #Ala0DyJn5xLP50t6Qq by grumpygamer@mastodon.gamedev.place
       2024-09-02T03:01:43Z
       
       0 likes, 0 repeats
       
       @foone @nickzoic The compiler should optimize it away.
       
 (DIR) Post #Ala0NG1GeSmCaMeRWq by foone@digipres.club
       2024-09-02T03:02:00Z
       
       0 likes, 0 repeats
       
       okay now I have a disassembler that can only disassemble the relocatable instructions (and can't fully do one of them, because it's complicated)I now need to add the ones that don't relocate, which is a separate headache
       
 (DIR) Post #Ala0UjeyqaeKXbnCD2 by foone@digipres.club
       2024-09-02T03:02:51Z
       
       0 likes, 0 repeats
       
       @grumpygamer @nickzoic it sure should, but since I'm looking at disassembly here... it didn't!
       
 (DIR) Post #Ala0oU82InAeAAngQq by ieure@retro.social
       2024-09-02T03:04:35Z
       
       0 likes, 0 repeats
       
       @foone wow you need a pvm to run that game
       
 (DIR) Post #Ala0ywBepv6853Tj2e by mdkcore@hachyderm.io
       2024-09-02T03:05:28Z
       
       0 likes, 0 repeats
       
       @foone `useless_boolean` lol
       
 (DIR) Post #Ala1KnLmN7JN2pdRRI by foone@digipres.club
       2024-09-02T03:15:03Z
       
       0 likes, 0 repeats
       
       ugh. apparently EnterFrame also adds a frame pointer (somewhere) and then the pvm_PushLocal operates off it.
       
 (DIR) Post #Ala1Q0r9aHKSNfnYga by foone@digipres.club
       2024-09-02T03:15:54Z
       
       0 likes, 0 repeats
       
       Food $200Data $150Rent $800Stacks $3,600Utility $150someone who is good at interpreters please help me budget this. my scripting language  is dying
       
 (DIR) Post #Ala2XXsHK0kWlYTpSK by 0xSim@hachyderm.io
       2024-09-02T03:27:28Z
       
       0 likes, 0 repeats
       
       @foone reduce your stacks usage
       
 (DIR) Post #Ala3S7dLYbCJt6TRDM by foone@digipres.club
       2024-09-02T03:38:14Z
       
       0 likes, 0 repeats
       
       @0xSim no
       
 (DIR) Post #Ala3ugRXjH3LxLZWC0 by foone@digipres.club
       2024-09-02T03:44:05Z
       
       0 likes, 0 repeats
       
       anyway I'm now at the point where I've written enough of a disassembler that I need to basically throw it away and make this thing better and more systematic, so I can eventually have it give me real source files (not log output) and even further on, so I can round-trip it and re-compile these scripts
       
 (DIR) Post #Ala42mlQ75ETsMjTs0 by foone@digipres.club
       2024-09-02T03:44:41Z
       
       0 likes, 0 repeats
       
       @athompso I think the answer is "my compiler crashes"
       
 (DIR) Post #Ala4AcEb93kbXJ78BU by RueNahcMohr@infosec.exchange
       2024-09-02T03:45:53Z
       
       0 likes, 0 repeats
       
       @foone useless_boolean will detect if the for loop never ran at all, because of the stop requirement.
       
 (DIR) Post #Ala4KbAPy7Cp7av26i by foone@digipres.club
       2024-09-02T03:47:32Z
       
       0 likes, 0 repeats
       
       @RueNahcMohr useless_boolean is actually never read by any code. thus the "useless"
       
 (DIR) Post #Ala4qbtimsIoedNEAa by RueNahcMohr@infosec.exchange
       2024-09-02T03:54:16Z
       
       0 likes, 0 repeats
       
       @foone .....huh, ok, maybe the author didn't turn out to actually need it in the end???
       
 (DIR) Post #Ala54uk9W4gj9oibtw by foone@digipres.club
       2024-09-02T03:56:50Z
       
       0 likes, 0 repeats
       
       @RueNahcMohr yeah! and apparently their compiler didn't warn them about this. or they didn't care
       
 (DIR) Post #AlaZbTpxZV77tEsbBo by foone@digipres.club
       2024-09-02T09:38:30Z
       
       0 likes, 0 repeats
       
       @riley I know of it in ram addressing, but not so much in files.Though I guess this game just fread()s the whole block, so on-disk padding is needed to allow for in-memory alignment
       
 (DIR) Post #AlaZkuDYrGzmJYPh3Y by foone@digipres.club
       2024-09-02T09:39:04Z
       
       0 likes, 0 repeats
       
       @pndc yeah, it's a Wii game, so it's PowerPC.
       
 (DIR) Post #AlaojGb6B9mOSO6DnU by skaverat@skaverat.net
       2024-09-02T12:28:30Z
       
       0 likes, 0 repeats
       
       @foone @clayote I stored mine in the blockchain and a scammer stole it
       
 (DIR) Post #Alb4EnWPJdDUrLOkca by JennyFluff@chitter.xyz
       2024-09-02T15:22:09Z
       
       0 likes, 0 repeats
       
       @foone @clayote that's okay, can be reformatted!
       
 (DIR) Post #Alb66dzT4JsgtGEN1s by zleap@qoto.org
       2024-09-02T15:43:08Z
       
       0 likes, 0 repeats
       
       @foone @clayote Held on with magnets of course :)
       
 (DIR) Post #Alb8q4bx8jxUOP1QKu by Batronyx@mastodon.social
       2024-09-02T16:13:33Z
       
       0 likes, 0 repeats
       
       @foone It looks like it's trying to win an obfuscated coding contest.