Skip to content

Port all 59NL/59NJ patches to 50YJ (US 1.24.3)#765

Open
Sifl46 wants to merge 2 commits into
fuzziqersoftware:masterfrom
Sifl46:50YJ-Patches
Open

Port all 59NL/59NJ patches to 50YJ (US 1.24.3)#765
Sifl46 wants to merge 2 commits into
fuzziqersoftware:masterfrom
Sifl46:50YJ-Patches

Conversation

@Sifl46
Copy link
Copy Markdown

@Sifl46 Sifl46 commented May 21, 2026

Tested to the best of my abilities.
As usual, DMC patch is largely untested. However, it at least does not cause any crashes.

Things to note:

"sig_check_begin" in MoreSaveSlots.s is structured a bit differently in this client than in 59NL/59NJ (Mainly swapping ecx and edx registers). I couldn't get this function to trigger in game, even with a breakpoint set. So I was unable to test if it works correctly. Otherwise, the patch seems to work flawlessly.

I included notes on getting this client up and running in a separate commit to the patches.
I don't know if GitHub lets you cherrypick which commits get pulled. If so, feel free to not include them if you don't want them.

I now see offsets when I close my eyes.

@anzz1
Copy link
Copy Markdown
Contributor

anzz1 commented May 22, 2026

To test the server-supplied version of MoreSaveSlots, you'll need to login -> select a character -> join a ship, at which point the patch applies, then disconnect from the server go back to the main menu, login again, and now in the character select screen more than 4 character slots should be available by scrolling down the list.

As a sidenote, the MoreSaveSlots patch is not very suitable as a server-supplied patch anyway as the patches fire only after you have already selected a character and joined a ship, too late. Hence in the MTethVer12513 and it's accompanying patches has MoreSaveSlots as a client-side patch.

@Sifl46
Copy link
Copy Markdown
Author

Sifl46 commented May 22, 2026

To test the server-supplied version of MoreSaveSlots, you'll need to login -> select a character -> join a ship, at which point the patch applies, then disconnect from the server go back to the main menu, login again, and now in the character select screen more than 4 character slots should be available by scrolling down the list.

As a sidenote, the MoreSaveSlots patch is not very suitable as a server-supplied patch anyway as the patches fire only after you have already selected a character and joined a ship, too late. Hence in the MTethVer12513 and it's accompanying patches has MoreSaveSlots as a client-side patch.

Hello! Thanks for the info. Though I am aware of this limitation, and how it works xD.

Funnily enough, I had actually used your version of the patch as a basis for testing. Since having to log in and apply the patch everytime I wanted to debug something was tedious.
(Thank you for making that project btw)

In the case of my note for the server sided patch, I am pretty certain that particular function is actually unused. Hence not being able to trigger it in my debugger.

@anzz1
Copy link
Copy Markdown
Contributor

anzz1 commented May 22, 2026

Ah now I get it, the signature check function doesn't get called but is patched anyway just-in-case and to match the other versions, while the functionality itself works. Good work on the ports.

[rant]

Funnily enough, I had actually used your version of the patch as a basis for testing.

Hah, you must have ran to the same problem that I did then and notice that the MSVC inline assembler is an absolute turd. That's why some of the patches there are wrapped in an #if 0 block for reference while the function itself is in bytecode as the inline assembler simply doesn't support many forms of even common instructions, and does things like use 3-byte forms for instructions that 2-byte forms exist. And in the 64-bit era they just gave up and don't support inline assembly at all for 64-bit x86 targets which is just crazy!

It's mind-boggling to me that company size of Microsoft can't get even a simple inline x86 assembler correct in the 30 years that Visual Studio has existed. If you look at the resource_dasm repo that is used for compiling the assembly for newserv, there's a feature-complete implementation for base x86 assembly in < 10k LOC done by one man. How can not Microsoft and its 250,000 employees create a working x86 inline assembler in 30 years? These type of things boggle my mind I cannot understand them.

[/rant]

@Sifl46
Copy link
Copy Markdown
Author

Sifl46 commented May 22, 2026

Haha, yeah.
Having used the inline assembler many times in the past, I have developed a specific workflow for it.

Write the inline assembly.
Attach cheat engine on the binary to view what it produced.
Inevitably find several incorrect instructions.
Replace said instructions with hardcoded bytes because I can't be bothered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants