View previous topic :: View next topic |
Author |
Message |
strikemode How do I cheat?
Reputation: 0
Joined: 16 Feb 2023 Posts: 3
|
Posted: Thu Feb 16, 2023 6:27 am Post subject: Changing the aspect ratio of an older game |
|
|
I am trying to change the aspect ratio of an older 32-bit game from 4:3 to 16:9. I have already successfully changed the game's resolution to 4k (3840x2160) (hex - 00 0F 70 0 which is stored in the game's save game file (not the executable). However, there's no aspect ratio information stored in this same save game file. Hence, I am looking for it within the game's executable.
When searching for AB AA AA 3F (4/3 = 1.3333333) using a hex editor I am able to find one match. Changing it to 39 8E E3 3F (16/9 = 1.7777777) does not change the aspect ratio however. It's because I have found that this one match in the entire executable is actually the game's FOV and not the aspect ratio. The FOV of the camera changes as expected when this value is modified. However the game still remains stretched to the 4:3 aspect ratio.
When searching for 1.3333333 as a float exact match using Cheat Engine I am able to find an address and changing it to 1.7777777 changes the aspect ratio as desired. But I can't save the executable with the patch since it seems that Cheat Engine does not have the ability to do so. This address is dynamic however and I can't find it's static equivalent within the game's executable file. I have tried the DBVM find what accesses this address and the pointer scan process but I am not able to locate the static address in the exe. In Cheat Engine one thing that I always notice is that the address is always of the form 03xxx3C0 where xxx change every time a new instance of the executable is launched but the 03 and 3C0 always stay the same i.e. are constant.
I am trying to use x32dbg to perform the same change and be able to patch and save the executable with the desired change. I run the game exe, attach it using x32dbg and enter the entry point of the exe after pressing Run twice (menubar at the top shows game's exe). However, I am unable to find this 1.3333333 value or AB AA AA 3F using x32dbg while the game is running (which I can find using Cheat Engine float exact match).
I was wondering if someone would be able to guide me in the right direction.
I presume that the game derives this 4:3 (1.3333333) value in some other fashion than the standard method of specifying it directly as AB AA AA 3F and that's why it's not present in the game's exe as a direct match for it's hex value equivalent. However, since I am able to produce the desired result using Cheat Engine when the game is running is there a way using x32dbg to patch the game's executable permanently to change this aspect ratio value from AB AA AA 3F to 39 8E E3 3F?
Below is a snip from Cheat Engine's disassembler. After changing the AB to 39, AA to 8E, AA to E3 (AB AA AA 3F -> 39 8E E3 3F)I am able to change the aspect ratio of the running game to 16:9 as desired, however I can't patch the executable permanently using Cheat Engine and hence I am trying to achieve the same using x32dbg but cannot find the same disassembled output when the game is being run.
Description: |
|
Filesize: |
1.61 MB |
Viewed: |
3498 Time(s) |

|
Description: |
|
Filesize: |
1.5 MB |
Viewed: |
3498 Time(s) |

|
|
|
Back to top |
|
 |
strikemode How do I cheat?
Reputation: 0
Joined: 16 Feb 2023 Posts: 3
|
Posted: Fri Feb 17, 2023 3:02 pm Post subject: |
|
|
With the instruction mov eax,[eax+0C] it seems that the code is trying to move contents of a memory address into a register.
I was able to find the instruction in x32dbg and followed it in dump. I have no idea what steps to follow next though to make the change permanent.
I created a cheat table to fix the aspect ratio using the CE aobscan function. Maybe there's a better way to do it but at least it does the job for now. I am wondering if there's a way to permanently change it in the executable.
Code: |
[ENABLE]
aobscan(aspectratio, 00 00 70 45 00 00 07 45 AB AA AA 3F 20 00 00 00)
label(_aspectratio)
registersymbol(_aspectratio)
aspectratio:
_aspectratio:
db 00 00 70 45 00 00 07 45 39 8E E3 3F 20 00 00 00
[DISABLE]
_aspectratio:
db 00 00 70 45 00 00 07 45 AB AA AA 3F 20 00 00 00
unregistersymbol(_aspectratio)
| [/img]
Description: |
|
Filesize: |
456.57 KB |
Viewed: |
3425 Time(s) |

|
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Fri Feb 17, 2023 3:28 pm Post subject: |
|
|
Can you not patch the executable with the x32dbg?
|
|
Back to top |
|
 |
strikemode How do I cheat?
Reputation: 0
Joined: 16 Feb 2023 Posts: 3
|
Posted: Sat Feb 18, 2023 4:09 pm Post subject: |
|
|
++METHOS wrote: | Can you not patch the executable with the x32dbg? |
I want to achieve exactly that but I am not sure how to do that and need help on it. When I attach the game's process using x32dbg I can't find the bytes that are seen using cheat engine and I am not sure why. Maybe I need to follow certain steps but I am not there yet.
In Cheat Engine I follow these steps to achieve the in-memory hack:
1. Attach the game's process to CE.
2. Search for exact match of float 1.3333333333.
3. Change the value found at address 03xxx3C0 to 1.7777777777.
The cheat table that I created uses aobscan to look for a pattern of bytes that includes the 4:3 aspect ratio in hex and swaps them with the 16:9 aspect ratio hex bytes.
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Feb 18, 2023 7:36 pm Post subject: |
|
|
You will want to focus on the instruction that is handling that data, because the value itself will be written to some random location each time. So a patch will not be effective for that.
Try looking to see what is writing/accessing the aspect ratio address inside of CE and use the AOB pattern of that instruction to find the location in the debugger.
Once you find it, there are many tutorials online that will show you how to patch it. It is a simple process.
|
|
Back to top |
|
 |
|