- Posts: 189
- Thank you received: 1
Spam Prevention - PLEASE READ !! (23 Apr 2021)
Due to a problem with spammers the rules for posting in the forums have changed for new users.
Newly registered users won't have their posts published until a moderator approves them.
Mission Loading Screen
- Copy-Cat
-
- Elite Member
-
Less
More
5 years 1 week ago - 5 years 1 week ago #1598
by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
DarkSynopsis? You figure out anything on this?
I'm not looking foward to rewriting the op code, but here is what I was thinking.
There are 2 push instructions that push the image-x and image-y values on to the stack before the Call to SetRect. These 2 values will stretch the image if increased.
these combined is 2 bytes enough to call a jump short. There is empty space below the function that could be used as the offset.
We should insert a unconditional jmp short and check values with our known image resolution of 800 x 600 and if they equal modify the values and return
if ebx == 600 and edi == 800, set the values to our screen resolution and return.
Otherwise push ebx and edi and return
This way only 2 locations for each additional screen resolution could be updated in the future.
Hopefully there are no other calls to this function with images with the size of 800 x 600 and it should work.
I'm not looking foward to rewriting the op code, but here is what I was thinking.
There are 2 push instructions that push the image-x and image-y values on to the stack before the Call to SetRect. These 2 values will stretch the image if increased.
Code:
swat.exe+16B2BC - 53 - push ebx // y-value (600)
swat.exe+16B2BD - 57 - push edi // x-value (800)
these combined is 2 bytes enough to call a jump short. There is empty space below the function that could be used as the offset.
We should insert a unconditional jmp short and check values with our known image resolution of 800 x 600 and if they equal modify the values and return
if ebx == 600 and edi == 800, set the values to our screen resolution and return.
Otherwise push ebx and edi and return
This way only 2 locations for each additional screen resolution could be updated in the future.
Hopefully there are no other calls to this function with images with the size of 800 x 600 and it should work.
Please Log in or Create an account to join the conversation.
- Copy-Cat
-
- Elite Member
-
Less
More
- Posts: 189
- Thank you received: 1
5 years 1 week ago - 3 years 4 months ago #1599
by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
Warning: All hacks are done at your own risk. Don't try them at home
I've worked on this long enough... Here is the fix!
:::: This willl stretch the image to any predetermined resolution :::::
This is the jump to new method.
Here is an explanation of the above opcode.
Here is the new opcode for the method
Offset - 2C2D00
and an explanation:
I'm running some extensive tests to see if any crashes occur during game play, or map building activities.
Please post your crashes here, and please provide the following:
1. What you were doing when it crashed?
2. Single or Multiplayer?
3. In-game or in Debrief or menu screens?
4. What Resolution your running your game in LRM?
6. if in-game what is the map name?[/li]
I've worked on this long enough... Here is the fix!
:::: This willl stretch the image to any predetermined resolution :::::
This is the jump to new method.
Code:
16B2BC Change - 53 57 51 50 8D 44 24 3C
To - E9 3F AA 1D 00 90 90 90
Here is an explanation of the above opcode.
Warning: Spoiler!
Original opcode:
New opcode
Code:
16B2BC - 53 - push ebx y = 600
16B2BD - 57 - push edi x = 800
16B2BE - 51 - push ecx 0
16B2BF - 50 - push eax 0
16B2C0 - 8D 44 24 3C - lea eax,[esp+3C] Load effective address(for return)
Code:
16B2BC - E9 3FAA1D00 - jmp 345D00 jump to New method
16B2C1 - 90 - nop blank
16B2C2 - 90 - nop blank
16B2C3 - 90 - nop blank
Here is the new opcode for the method
Offset - 2C2D00
Code:
81 FB 58 02 00 00 75 14 81 FF 20 03 00 00 75 0C
81 C3 A8 00 00 00 81 C7 36 02 00 00 53 57 51 50
8D 44 24 3C E9 9B 55 E2 FF
Warning: Spoiler!
Code:
2C2D00 - 81 FB 58020000 - cmp ebx,00000258 if y doesn't = 600
75 14 - jne swat.exe+345D1C jump
81 FF 20030000 - cmp edi,00000320 if x doesn't = 800
75 0C - jne swat.exe+345D1C jump
81 C3 A8000000 - add ebx,000000A8 otherwise y = 600 + 168
81 C7 36020000 - add edi,00000236 otherwise x = 800 + 566
53 - push ebx y = 768
57 - push edi x = 1366
51 - push ecx 0
50 - push eax 0
8D 44 24 3C - lea eax,[esp+3C] Load effective address(for return)
E9 9B55E2FF - jmp swat.exe+16B2C4 jump back
I'm running some extensive tests to see if any crashes occur during game play, or map building activities.
Please post your crashes here, and please provide the following:
1. What you were doing when it crashed?
2. Single or Multiplayer?
3. In-game or in Debrief or menu screens?
4. What Resolution your running your game in LRM?
6. if in-game what is the map name?[/li]
Please Log in or Create an account to join the conversation.
- Slippery Jim
-
- Administrator
-
Less
More
- Posts: 774
- Thank you received: 15
5 years 1 week ago - 5 years 1 week ago #1600
by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
It is amazing how far you have come in reverse engineering! Awesome job!
So if we are to set the new standard for the Last Resort mod at 1920x1080 for map load screens with map makers and then hack the code it will shrink the image to whatever resolution we want?
For instance if the map maker has the load image at 1920x1080 but the player chooses 1366x768 as their 2D setting we can hack the proper game executable to display the load image in 1366x768? Also will it be able to display the original community made 800x600 map load screens that haven't been upgraded in 1366x768 at the same time?
So if we are to set the new standard for the Last Resort mod at 1920x1080 for map load screens with map makers and then hack the code it will shrink the image to whatever resolution we want?
For instance if the map maker has the load image at 1920x1080 but the player chooses 1366x768 as their 2D setting we can hack the proper game executable to display the load image in 1366x768? Also will it be able to display the original community made 800x600 map load screens that haven't been upgraded in 1366x768 at the same time?
Please Log in or Create an account to join the conversation.
- Copy-Cat
-
- Elite Member
-
Less
More
- Posts: 189
- Thank you received: 1
5 years 1 week ago - 5 years 1 week ago #1601
by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
That is a good point. So far I have managed to get 800 x 600 images to load full screen. What I should have been trying to do is, just set the values to what ever we want, and not add anything to the size of the image.
I will run a test in a minute and throw a 1920 x 1080 image at it just to see if it will resize it to 1366 x 768.
The only problem I see is trying to use the mov instruction to modify the registers. The add and sub instructions modify the registers indirectly. With the current method of implementing the change, we cannot use any of the registers for variables and we must preserve (keep up with) the stack.
The new code can be what ever we want, since we are not trying to squeeze it in-between other functions. It is located in a code cave towards the end of the exe.
I haven't tested shrinking the image just stretching the default 800 x 600. The 800 x 600 in my previous post are variables passed in from the image.hack the code it will shrink the image to whatever resolution we want?
I will run a test in a minute and throw a 1920 x 1080 image at it just to see if it will resize it to 1366 x 768.
The only problem I see is trying to use the mov instruction to modify the registers. The add and sub instructions modify the registers indirectly. With the current method of implementing the change, we cannot use any of the registers for variables and we must preserve (keep up with) the stack.
The new code can be what ever we want, since we are not trying to squeeze it in-between other functions. It is located in a code cave towards the end of the exe.
Please Log in or Create an account to join the conversation.
- Slippery Jim
-
- Administrator
-
Less
More
- Posts: 774
- Thank you received: 15
5 years 1 week ago - 5 years 1 week ago #1602
by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
It is really cool that you have figured out how to do things like this.
It may be that it can't be as flexible as we hope. It may just have to be that the 800x600 is still the standard but we have the option of including replacement high-res load screens. This feature won't be available to map makers unless they submit new graphics to be included in future updates of the mod.
This will be a large undertaking to get quality images that will be suitable replacement load screens.
- What you come up with has to be flexible enough to allow us to still use 800x600 load screens (specifically for community made maps).
- The Sierra load maps can be enlarged and included in each of the Last Resort .RES files and then used in conjunction with hacked game executables.
For example:
It may be that it can't be as flexible as we hope. It may just have to be that the 800x600 is still the standard but we have the option of including replacement high-res load screens. This feature won't be available to map makers unless they submit new graphics to be included in future updates of the mod.
This will be a large undertaking to get quality images that will be suitable replacement load screens.
- What you come up with has to be flexible enough to allow us to still use 800x600 load screens (specifically for community made maps).
- The Sierra load maps can be enlarged and included in each of the Last Resort .RES files and then used in conjunction with hacked game executables.
For example:
Code:
01.res (800x600 textures) that indirectly uses swat_800x600.exe
02.res (1366x768 textures) that indirectly uses swat_1366x768.exe
03.res (1920x1080 textures) that indirectly uses swat_1920x1080.exe
Please Log in or Create an account to join the conversation.
- Copy-Cat
-
- Elite Member
-
Less
More
- Posts: 189
- Thank you received: 1
5 years 1 week ago - 5 years 1 week ago #1603
by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
Thanks, all for the cause.
Gonna run some test now to see if it shrinks the image... Any ideas on how to handle the image resolutions?
we coud just continue checking and jumping. Remember it checks for the y-value first and exits if no match, so we technically could do it again for the LR standard..
Update: I just noticed, the Loading Text is still in the same spot..
UPDATE #2: It shrinks it..... Kewl, started with a 1920 x 1080 and shrunk it to 800 x 600. It also appears to be working with the mov instruction which is less bytes. That opens up some head room on the handling of Map_Loading Images.
Gonna run some test now to see if it shrinks the image... Any ideas on how to handle the image resolutions?
we coud just continue checking and jumping. Remember it checks for the y-value first and exits if no match, so we technically could do it again for the LR standard..
Update: I just noticed, the Loading Text is still in the same spot..
UPDATE #2: It shrinks it..... Kewl, started with a 1920 x 1080 and shrunk it to 800 x 600. It also appears to be working with the mov instruction which is less bytes. That opens up some head room on the handling of Map_Loading Images.
Please Log in or Create an account to join the conversation.
Moderators: DarkSynopsis
Time to create page: 0.186 seconds