Hack Swat 3's Executable To Give High Res

2 years 3 months ago - 5 months 1 day ago #2 by Slippery Jim
Hack Swat 3's Executable To Give High Res was created by Slippery Jim
The following thread is for mod makers only. It contains notes on how to modify Swat 3 files. This thread combines all our knowledge of how to hack Swat 3 to get a higher resolution in the 2D menus. Most of the credit goes to AlienAbducter and his magnificent hex editor/debugger.

All of Swat 3's menus run in 800x600. This resolution is hard coded right into the game's executable. Although you can get the game's 3D portion of the game to run in a higher resolution, all the 2D menus such as the weapon selection screen and chat lobby are stuck on 800x600. To force it to run custom menus we have to use a hacked version of the executable.

To hack the executable you need a version that has it's copy protection removed.

To hack Swat 3 so 2D menus are in 1024x768:
- First get yourself a Hex editor, and a version 2.1 "No-CD" crack of Swat 3 from GameCopyWorld.

- Open the Swat executable with the hex editor, search for the first occurrence of:
0x20 0x03 0x00 0x00 0xb9 0x58 0x02 0x00 0x00

(You will find it at decimal offset 13457)

- replace it with:
0x00 0x04 0x00 0x00 0xb9 0x00 0x03 0x00 0x00

For those who don't want to search the specific offsets to change the NOCD cracks are:
13457 (or in hex 0x00003491) - change it to 00
13458 (or in hex 0x00003492) - change it to 04
13462 (or in hex 0x00003496) - change it to 00
13463 (or in hex 0x00003497) - change it to 03

Here are the hex values you need for 1440x900:

0xA0 0x05 0x00 0x00 gives you 1440
0x84 0x03 0x00 0x00 gives you 900

There is an additional 800x600 reference that was being used after the game went to debrief:

Decimal offset 01191630 (or 0x00122ECE in hex)

0x58 0x02 0x00 0x00 0x68 0x20 0x03 0x00 0x00

changed to (for 1024 x 768):
0x00 0x03 0x00 0x00 0x68 0x00 0x04 0x00 0x00


changed to (for 1440 x 900):
0x84 0x03 0x00 0x00 0x68 0xA0 0x05 0x00 0x00

Swat 3 only allows texture sizes of 256x256 by default. The game can be hacked to take advantage of modern video cards that contain a lot of memory. We can hack the game to force it to allow texture resolutions of 1024x1024.

To force the game to allow 1024x1024 textures replace the following hex strings:

81 FF 00 01 00 00 7F 08 81 FB 00 01 00 00 (offset 1466240)
81 FF 00 04 00 00 7F 08 81 FB 00 04 00 00


81 FE 00 01 00 00 77 08 81 FB 00 01 00 00 (offset 1466998)
81 FE 00 04 00 00 77 08 81 FB 00 04 00 00

(Note: to get only 512x512 textures use 00 02

Additions Notes:

- There are several additional references to 0x20 0x03 0x00 0x00 fairly close to other 0x58 0x02 0x00 0x00 references. Not sure if these are resolution related because there are more data between them than usual. I have not experimented to see what they do.

You can find the small cluster of these references starting at decimal offset 02792636 if someone knows what they are for.

- It appears that you can't use the hacked .exe file when working in Worldcraft. You will have to use the virgin crack while making and testing maps and then switch back to the hacked version to play the game normally.

I have now also successfully converted and enlarged Swat 3's movies to use the XVID codec.

Just As an experiment the videos were enlarged to 1024x768 instead of the default 640x480 and run at 24 fps instead of 15fps. Even with the enlargement the movie files are still a lot smaller in terms of total file size. The XVID codec is very efficient. My final decision though was that it wasn't worth increasing the dimensions of the videos because it didn't increase the quality of them. They still looked the same as when they were lower resolution.

To get the movies to display properly I had to hack 5 locations in the Swat 3 executable. These 5 locations represent the 5 movies that play full screen. All other movies in Swat 3 are smaller and play within a window with other graphics around them.


To find the locations to hack in the Swat 3 executable do a search for the resolutions 640 and 480. 640 translates as 0x8002 and 480 translates as 0xE001

To replicate the enlarged movie experiment you will want to replace them with 1024 (0x0004) and 768 (0x0003)

Here are the decimal offsets to change:

34890 - change to 0x0003
34895 - change to 0x0004

34970 - change to 0x0003
34975 - change to 0x0004

35050 - change to 0x0003
35055 - change to 0x0004

35130 - change to 0x0003
35135 - change to 0x0004

35203 - change to 0x0003
35208 - change to 0x0004

UPDATE: woops I forgot one of the movies "Plane.avi" so there should be a sixth call. I suspect it is at decimal offset 31909 and 31915 but I haven't tested to confirm yet.
The topic has been locked.
2 years 3 months ago #3 by Slippery Jim
Replied by Slippery Jim on topic Hack Swat 3's Executable To Give High Res
Found the reference to the size of the bitmaps (map loading screens)

Decimal offset 301365 (or 0x00049935 in hex)

0x58 0x02 0x00 0x00

Decimal offset 301372 (or 0x0004993C in hex)

0x20 0x03 0x00 0x00
The topic has been locked.
2 years 3 months ago #4 by Slippery Jim
Replied by Slippery Jim on topic Hack Swat 3's Executable To Give High Res
There are additional 640x480 calls that I am not sure what they are for. What these additional calls could be are for the creation of the DirectDraw windows. If the window creation succeeds then it is resized and fully drawn.

640x480 (0x8002 0xE001):

* Decimal offset 13489 and 13494
* Decimal offset 31847 and 31852
* Decimal offset 260837 and 260842
* Decimal offset 264925 and 264932 (this has two bytes in between the height and width compared to all other calls that normally just have 1 byte separating them)

There are also a few others that may additional calls related to the movies. All of the other calls to the movies reversed the resolution in the executable (480 x 640).

480x640 (0xE001 0x8002):

* Decimal offset 18929 and 18934
* Decimal offset 31909 and 31915 (this has two bytes in between the height and width compared to all other calls that normally just have 1 byte separating them)
The topic has been locked.
2 years 1 month ago - 2 years 1 month ago #69 by Slippery Jim
Replied by Slippery Jim on topic Hack Swat 3's Executable To Give High Res
There is still problems with the resolution hacks. Rather than being centered some of the menus are located at the top left.

* When you select "Mission (Standard)" games aren't being centered
* When you select "Career (New)" the officer selection screen isn't being centered

I assume I need to locate and change more 800x600 or 640x480 calls.

UPDATE: I searched and tested for both 800x600 and 640x480 calls and they had no affect on the remaining screens. Perhaps on some screen calls there is a flag that is used to center the screen?
The topic has been locked.
Time to create page: 0.238 seconds
Powered by Kunena Forum