pixeltris/Lotd

Decompiling game source code

paulronla opened this issue · 3 comments

// Various "modes" which you can set when starting a duel (see YGOPopcornCore_beginduel_setDuelInfo.c)

Looking at your comments, it looks like you were able to decompile the game into C code. How did you do that? Or if I misunderstood, how did you figure out the offsets?

Link Evolution is out today on Steam and it'd be interesting to see if there are new duel modes or options there now. What I'm specifically interested in is if they left in the old code for MR4 (and potentially MR5 but with unrestricted Pendulum summons, so something like a MR3 but with Links) that can be flipped on or off with a switch. Something that might make this easier to investigate is that they accidentally released the Switch version of Link Evolution on Steam which has MR4, so that could be diffed with the correct updated version we have now.

I used IDA's x64 decompiler and did some rough annotations, but they are very rough and were only really helpful to me at the time when I was figuring out some rough structure of code. I don't think they would even be that useful to me now if I were to look back at them, which is why they weren't committed to this repo.

Some sort of toggle between MR4/MR5 might be somewhat feasible as the actual logic behind those two aren't so different. MR3 is probably long gone in code. They write all of their game code logic in C (which is the engine they've been using for many many years, duel links uses it too and has MR5 / all ~10k cards in it). It's very likely destructive on updates without lots of planning ahead code structure wise on their part. Like you said they accidentally released a version dated "Thu Aug 29 15:48:35 2019". That version can still be downloaded by anyone owning the game using the depot/manifest info https://steamdb.info/depot/1150641/manifests/

Note that the pendulum zones don't even exist on the board anymore as they were in MR3 so it would definitely be near impossible to make a toggle to MR3, even if MR4/MR5 could be done.

I will be updating my tools for both executables as it would be interesting to play the different styles of MR4/MR5 at times, but I wont personally be spending any time trying to write a toggle of the rules as it could be a lottt of work.

Right, what I was attempting to get at was more akin to a MR5 but being able to Pendulum Summon to the main monster zones without need Link Monsters. Fingers crossed that they're already options (albeit hidden) that can be toggled like tag duels.

EDIT: Thank you for the thorough explanation! Looking forward to whatever you can uncover.

When browsing through code to update my project I found this piece of code which is pretty interesting. It looks like MR4 is still available. There could be additional flags which set MR3, but I'm not too hopeful of that.

  if ( byte_140C8D1C9 )
  {
    sub_1408735B0("Engine_Init() 2020 Rules");
    dword_1433305AC |= 0x80u;
  }
  else
  {
    sub_1408735B0("Engine_Init() 2019 Rules");
    dword_1433305AC &= 0xFFFFFF7F;
  }