Welcome Guest [Log In] [Register]
Welcome to NHL04 Rebuilt 2017. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Source code for DLLs? NHL09 possible?
Topic Started: Oct 10 2017, 06:58 PM (742 Views)
Violina77
Rookie
Hi there! I'm the new guy who also posted another topic about shaders. I'm kind of obsessed with making older games shine with new technologies. With this in mind, although I agree NHL04 is definitely the better game, I would like to attempt to use the launcher for NHL09 and modify the LUA code to enable 1920*1080. The problem with the current tools is that nothing will make NHL09 work at 1080P, and modifying the LUA code for the launcher will not work for NHL09 as the launcher looks for a checksum. Is the source code available for the DLLs, and do I have permission to take a shot at it?
Offline Profile Quote Post Goto Top
 
trent
Member Avatar
Project Leader
I have the Launcher set on 1920x1080.

Works for me. :blink:
My Blues 1995-1996 Season Report
My Blues 1998-1999 Season Report
My Flyers 1998-1999 Season Report
Offline Profile Quote Post Goto Top
 
Violina77
Rookie
For NHL09????
Offline Profile Quote Post Goto Top
 
trent
Member Avatar
Project Leader
No. Oops. For NHL04.

I thought you were talking about NHL04's Launcher.exe.
My Blues 1995-1996 Season Report
My Blues 1998-1999 Season Report
My Flyers 1998-1999 Season Report
Offline Profile Quote Post Goto Top
 
Vod
Member Avatar
Development Team
Violina77,10 October 2017
10:58 AM
Hi there! I'm the new guy who also posted another topic about shaders. I'm kind of obsessed with making older games shine with new technologies. With this in mind, although I agree NHL04 is definitely the better game, I would like to attempt to use the launcher for NHL09 and modify the LUA code to enable 1920*1080. The problem with the current tools is that nothing will make NHL09 work at 1080P, and modifying the LUA code for the launcher will not work for NHL09 as the launcher looks for a checksum. Is the source code available for the DLLs, and do I have permission to take a shot at it?

That's not really feasible. Even if you set the checksum to the 09 .exe, most of the code would have to be rewritten for it to work properly because the code is too integrated. Most of the work is done by patching the executable code directly. There are very few generalized hooks that can apply to multiple games.
NHL 2004 Launcher | My Changelog | NHL 2004 Preservation | NHL 2004 Debugger
Offline Profile Quote Post Goto Top
 
Violina77
Rookie
I think the way you wrote the lua code to hook the memory is brilliant! If I can find those from the NHL09.exe executable, I think I could be in pretty good shape, but I understand there is little need to do that since most people don't really care.

Believe it or not, in the last couple hours, I worked on getting NHL 09 to work in 1080P, and it actually works! To my knowledge, no one ever succeeded before, even the Wide09 software does not do that. I managed to do it by changing hex values in the exe, and then applying the resolution to the config files the same way the wide patch does. It now runs in native 1080P! The only issues I have left would be to configure the camera a little higher (there is an app that does that but I would like to streamline it a little), and change the fov so it is no longer stretched. I don't even know if it is possible, but since you did it for NHL 04 I thought maybe you would have a couple tips for me? I don't mind rewriting a new DLL only for widescreen for NHL09. I'm sure a lot of people would be grateful as it is the last NHL on PC after all! Let me know if that interests you!

Btw, thank you for the amazing work you do for 04!
Offline Profile Quote Post Goto Top
 
Vod
Member Avatar
Development Team
Violina77,10 October 2017
6:36 PM
Believe it or not, in the last couple hours, I worked on getting NHL 09 to work in 1080P, and it actually works! To my knowledge, no one ever succeeded before, even the Wide09 software does not do that. I managed to do it by changing hex values in the exe, and then applying the resolution to the config files the same way the wide patch does. It now runs in native 1080P! The only issues I have left would be to configure the camera a little higher (there is an app that does that but I would like to streamline it a little), and change the fov so it is no longer stretched. I don't even know if it is possible, but since you did it for NHL 04 I thought maybe you would have a couple tips for me? I don't mind rewriting a new DLL only for widescreen for NHL09. I'm sure a lot of people would be grateful as it is the last NHL on PC after all! Let me know if that interests you!

Btw, thank you for the amazing work you do for 04!

Good job on your work so far :). The steps I took to locate the aspect ratio and FOV was first I searched to see if the aspect ratio is a float constant that is stored in memory. In the case of NHL 04, that wasn't the case. The next step was to search the executable code to see if the float is cast as an integer constant and passed to a function. To do that I converted 1.333333 (4:3) into hex (0x3faaaaab) and searched the executable code. That lead me to a basic EA projection function that accepts FOV and aspect ratio as parameters. I then replaced that function with my own by allocating executable memory and JIT assembling the new function. Doing it that way allowed me to keep EA's camera zoom behavior by adding the FOV modifier value to to the default FOV value.
NHL 2004 Launcher | My Changelog | NHL 2004 Preservation | NHL 2004 Debugger
Offline Profile Quote Post Goto Top
 
Violina77
Rookie
Thank you, you pointed me in the right direction and now NHL 09 is fully working in 16/9 full screen with no stretch! I didn't do a launcher yet (I'm still new at coding, but getting pretty good), but I might later to practice my skills. Right now I just overwrote the 4/3 value for 16/9 in hex editor and combined with my resolution tweaked, it worked right away. Even tested in 4K.


I'm pretty much 100% sure this was never done before... Will share the results in the appropriate forums.

If I did want to create a launcher like you did, what kind of hook would I be looking to do in the dll? The lua scripts are pretty much self explanatory, but the dll are more misterious...
Offline Profile Quote Post Goto Top
 
Vod
Member Avatar
Development Team
Violina77,12 October 2017
6:50 AM
If I did want to create a launcher like you did, what kind of hook would I be looking to do in the dll? The lua scripts are pretty much self explanatory, but the dll are more misterious...

The hooking methods is situational based on the underlying ASM code and what you're trying to do. I don't know how far you plan on taking it, but if you plan on adding callbacks and that sort of thing, you'll have to figure out tricks here and there to patch in your function call or jmp. For instance, you may have to move some of EA's ASM code to your function if there's limited bytes to work with. When it comes to DX and other COM stuff, the fastest method is to patch the executable code directly and avoid patching the v-table. The benefit of patching the v-table is you don't need to know as much about the underlying code.
NHL 2004 Launcher | My Changelog | NHL 2004 Preservation | NHL 2004 Debugger
Offline Profile Quote Post Goto Top
 
Violina77
Rookie
I managed to inject Reshade in NHL 09 and created a preset. If you like the look, maybe we could try injecting those in NHL04? Have a look and let me know what you think!
https://www.youtube.com/watch?v=KRyy9hlbNaU
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · NHL 2004 Launcher · Next Topic »
Add Reply